Skip to content

Instantly share code, notes, and snippets.

View MonitorConnection.ps1
function Start-ConnectionMonitoring
param($isp, $gateway, $Logfile,[int]$Delay = 10,[Ipaddress] $adapter, [switch]$ispPopup, [switch]$gateWayPopup)
$spacer = '--------------------------'
if(!(Test-Connection $gateway -source $adapter -count 1 -ea Ignore))
get-date | Add-Content -path $Logfile
"$gateWay Connection Failure" |add-content -Path $Logfile
crshnbrn66 / user-profile.psm1
Last active Sep 24, 2021 — forked from MSAdministrator/Create-NewProfile.ps1
PowerShell functions to create a new user profile
View user-profile.psm1
Rough PS functions to create new user profiles
Call the Create-NewProfile function directly to create a new profile
Create-NewProfile -Username 'testUser1' -Password 'testUser1'
Created by: Josh Rickard (@MS_dministrator) and Thom Schumacher (@driberif)
View Get-FileNameProperties.ps1
function Get-FileNameProperties
param( $path = "~",
[switch] $Recurse,
[array]$Properties = ('Fullname', 'LastAccessTime', 'LastWriteTime', 'CreationTime','Owner','Size','Directory','Extension'))
$sortedfiles = $null
$files = Get-ChildItem -Recurse:$Recurse -File $path #if $recurse is true it'll recurse other wise it won't
$params2 = @()
View NTFS.psm1
function Remove-PermissionsForGroup
Removes Ntfs permissions for the directory specified..
This script sets the ntfs permissions for the directory passed.
View DacToFile.ps1
param($dacpacPath = 'c:\dacpacPath', $dacpac = 'your.dacpac')
add-type -path 'C:\Program Files (x86)\Microsoft SQL Server\120\DAC\bin\Microsoft.SqlServer.Dac.Extensions.dll'
cd $dacpacPath
$model =[Microsoft.SqlServer.Dac.Model.TSqlModel]::new(((get-item ".\$dacpac").fullname))
$queryScopes = [Microsoft.SqlServer.Dac.Model.DacQueryScopes]::All
$returnObjects = $model.GetObjects([Microsoft.SqlServer.Dac.Model.DacQueryScopes]::All)
$s = ''
foreach($r in $returnObjects)
if ($r.TryGetScript([ref]$s))
View Get-RedirectedUrls.ps1
function get-redirectedUrls
$Uri = [uri]$url
$url2check = $url
$value = get-redirectedUrl -url $url2check
View SubScriptionExporter.ps1
#Requires -Version 5.0
# Source File Information (DO NOT MODIFY)
# Source ID: 8967ce63-8512-4998-b597-b65331d6a9f6
# Source File: subscriptionExporter.psf
#region File Recovery Data (DO NOT MODIFY)
View get-ccmlog.ps1
function Get-CMLog
Parses logs for System Center Configuration Manager.
Accepts a single log file or array of log files and parses them into objects. Shows both UTC and local time for troubleshooting across time zones.
Specifies the path to a log file or files.
crshnbrn66 / Compare-iisSites.ps1
Last active Jun 16, 2020
Retrieves IIS settings from remote machines and presents difference view in winmerge
View Compare-iisSites.ps1
#Requires -Modules webadministration
#Requires -RunAsAdministrator
#Requires -version 3.0
Provides a means to get the current backup location for iis changes
Changes made to the IIS instance are recorded in a history config file. This function provides the means to retreive where it is on the machine
View Copy-code.ps1
#requires -version 5.0
using namespace System.IO
using namespace System.IO.Compression
add-type -assemblyname 'System.IO.Compression'
add-type -assemblyname 'System.IO.Compression.FileSystem'