This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function Get-SubdirectoryInfo { | |
[CmdletBinding()] | |
param( | |
[Parameter(HelpMessage="Specify the top level directory to search")] | |
[string]$TopLevelDir | |
) | |
#Find subdirectories with files | |
$Items = Get-ChildItem $TopLevelDir | Where-Object Attributes -ne Directory | Select-Object DirectoryName,Name,Length |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Paste these into the Developer Tools Console | |
// Calculate DNS lookup time in milliseconds | |
var pageNavArr = performance.getEntriesByType("navigation"); | |
var pageResArr = performance.getEntriesByType("resource"); | |
var pageArr = pageNavArr.concat(pageResArr); | |
pageArr.forEach(function(element) { | |
var dnsTime = element.domainLookupEnd - element.domainLookupStart; | |
if (dnsTime > 0) { // Don't display cached DNS entries | |
console.log(element.name); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang=en> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<title>AWS Test</title> | |
<meta name="description" content=""> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<style> | |
body {background-color: AliceBlue;} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[CmdletBinding()] | |
param( | |
[Parameter(HelpMessage="Specify the path to the CSV file")] | |
[string]$CSVPath, | |
[Parameter(HelpMessage="Specify one of OCHIN's supported drivers")] | |
[ValidateSet("HP LaserJet 4100 Series PCL6", "HP Universal Printing PCL 5 (v5.7.0)", "Kyocera TASKalfa 7551ci", "Sharp MX-3500N", "Xerox Global Print Driver PCL")]$Driver | |
) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[CmdletBinding()] | |
param ( | |
[Parameter(HelpMessage="Specify the username")] | |
[string]$Username, | |
[Parameter(HelpMessage="Specify the profile root directory")] | |
[string]$ProfileRoot, | |
[Parameter(HelpMessage="Specify the full path to log output to")] | |
[string]$LogPath = "C:\Automate\Set-TSProfilePath-log.txt", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function Test-LDAPS { | |
[CmdletBinding()] | |
param ( | |
[Parameter(Mandatory=$True)] | |
[string]$ADServer | |
) | |
$LDAPS = "LDAP://" + $ADServer + ":636" | |
try { | |
$global:Connection = [ADSI]($LDAPS) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function Resolve-EstablishedConnections { | |
$EstConnections = Get-NetTCPConnection -State Established | |
$ConnectionArr = New-Object System.Collections.ArrayList #Initialize the ArrayList | |
$Counter = 1 | |
ForEach ($Connection in $EstConnections) { | |
Write-Progress -Activity "Resolving PTR Record" -Status "Looking up $($Connection.RemoteAddress)" -PercentComplete ($Counter / $($EstConnections.Length)*100) | |
$ConnectionObj = [PSCustomObject][Ordered] @{ | |
LocalAddress = $Connection.LocalAddress |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function Get-UserGroups { | |
<# | |
.EXAMPLE | |
PS C:\> Get-UserGroups -GroupName "Domain Admins" | |
.EXAMPLE | |
PS C:\> [bool](Get-UserGroups -GroupName "Domain") | |
.EXAMPLE | |
PS C:\> Get-UserGroups -UserName [email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; No longer needed - embedded in script now | |
[version] | |
Signature=$chicago$ | |
AdvancedINF=2.5 | |
[DefaultInstall] | |
CustomDestination=CustInstDestSectionAllUsers | |
RunPreSetupCommands=RunPreSetupCommandsSection | |
[RunPreSetupCommandsSection] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function Get-StringHash { | |
param( | |
[CmdletBinding()] | |
[Parameter(ValueFromPipeline=$True,Mandatory=$True,HelpMessage="String to hash")] | |
$String, | |
[Parameter(HelpMessage="Hash algorithm")] | |
[ValidateSet('MD5','RIPEMD160','SHA1','SHA256','SHA384','SHA512')] | |
$Algorithm = "SHA1" | |
) | |
$StringBuilder = New-Object System.Text.StringBuilder |