Author: kimconnect

Create a Report of MTU Settings on All Hyper-V Hosts in the Domain/Forest

# mtuReportAllHyperVHosts.ps1 # Ensure that AD management module is available for PS Session function includeRSAT{…

Enable Jumbo Frames on a Windows Host

Overview: Whether the engineer or sysadmin works in the realm of 'networking', 'database', or 'Windows',…

Quick Script to Test SharePoint Online Credentials

$principle = "[email protected]" $password = 'PASSW0RT' $sharePointUrl = "https://SOMESHAREPOINT.COM/SitePages/Home.aspx" $credential=New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $principle,$(ConvertTo-securestring $password…

Installing Linux Kernel on Windows 10 Machines

# installLinuxOnWindows10.ps1 # Please don't try to run this on target OS Windoze XP or…

Hyper-V: De-register Storage File Share and/or Removing Paths from VMM

# vmmDeregisterFileSharePath.ps1 $pathSearch='\\DECOMMISSIONED-FILESHARE008' $unregister=$true $remove=$false $fileShares=Get-SCStorageFileShare|?{$_.SharePath -like "*$pathSearch*"} $thisLibraryServer = Get-SCLibraryServer if($unregister){$fileShares|%{Unregister-SCStorageFileShare -StorageFileShare $_ -LibraryServer…

Hyper-V: Search for Guest VMs Utilizing Certain Storage Paths

$pathSearch='C:\ClusterShare\RandomFolder' $pathSearch='C:\ProgramData' $allHyperVHosts={(Get-ClusterNode | Where { $_.State –eq "Up" }).Name | %{$_.ToLower()}}.Invoke() $allVms=foreach ($hyperVHost in…

PowerShell: Audit Failed Logins of A User

$username='rambo' function auditLockouts($userName,$domainController,$refreshMinutes=1){ function getLockouts($domainControler){ # Requirement: # Domain Controllers Audit Group Policy has been…

How to discover WSUS Server from Your Local Machine

# Method 1: PowerShell (the obvious choice) (Get-ItemProperty HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate).WuServer # Method 2: Command Line REG…

PowerShell: Create SMB Share and Grant NTFS Access

$localPath="C:\testShare" $fullAccessAccounts='everyone','authenticated users' function createSmbShare($localPath,$fullAccessAccounts){ $ErrorActionPreference='stop' try{ # First, create SMB Share $smbShareName=split-path $localPath -leaf…

WinRM Issues Caused by Service Principal Name (SPN) HTTP Protocol & Port Associations

Solution as Code: There is no easy solution to this problem. Certain IIS Pool Accounts…

Using Telnet and PowerShell to Test SMTP Relay

PowerShell Method: Example of Failure: PS C:\> sendTestEmail '[email protected]' 'password' '[email protected]'Detected MX Record : ywpjf4z5siycosmh7uqymtuygcjehuc67wa6o4rq4k2a3g2aodma.mx-verification.google.comKnown…

PowerShell: Add Root Domain to Trusted Sites

Windows Servers often have 'hard admin' modes, where accesses to external websites are painstakingly restricted.…

PowerShell: Convert CSV Into HashTable

This is an illustration of a function to convert a set of CSV contents into…

PowerShell: Extract Root Domain from URL

Please note that this function requires an updated variable named $domainsDictionary. Since LTD's are being…

PowerShell: Set Enhanced Protected Mode of Internet Explorer

function changeIeProtectedMode{ # $hives = 0..4|%{"HKLM:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\$_"} $hives = 0..4|%{"HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\$_"} $keyName='2500' # Key Name…

PowerShell: Get Try Catch Exception Type of a Function

# This function will return the exception type so that it could be specified on…

PowerShell: Generate Random Password

Previous version that does not require System.Web assembly: https://blog.kimconnect.com/powershell-randompassword-function/ # This function will quickly generate…

PowerShell: Get NIC MTU’s of All Hyper-V Hosts in Domain/Forest

# listHyperVHostsInForests.ps1 # Version: 0.02 function listHyperVHostsInForests{ # Ensure that AD management module is available…

PowerShell: Use Selenium Drivers to Automate Logins

Set Variables: $username='testrobot' $password='password' $url='https://blog.kimconnect.com' # Version 0.0.2 - return true or false, while keeping…

Hyper-V UEFI Error: The Image’s Hash and Certificate are Not Allowed (DB)

Symptom: Cause: Secure Boot has been enabled on this generation 2 guest virtual machine. This…