Month: February 2022

PowerShell: Grant Current User Full Access to File or Folder

# Grant Current User Full Access to Object $object='C:\temp' $acl=Get-Acl $object $currentUser=[System.Security.Principal.WindowsIdentity]::GetCurrent().Name $grantAccess=New-Object System.Security.AccessControl.FileSystemAccessRule("$currentUser","FullControl","Allow") $acl.AddAccessRule($grantAccess)…

PowerShell: Check Windows Computers for Specific KB’s

# Check for specific KBs $kbs='KB5010790','KB5010419' $computernames=@('WINDOWS001','WINDOWS002') $regexIP = [regex] "\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b" $names=foreach($computername in $computernames){ if($computername…

How To Prevent Windows From Automatically Rebooting After Updates

# Add New Registry Key $regHive='REGISTRY::HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU' $keyname='NoAutoRebootWithLoggedOnUsers' $value=1 Set-ItemProperty -Path $regHive -Name $keyname -value $value…

PowerShell: Get IP’s From Computer Names

Resolve from Names to IPs: $names=@( 'TESTVM001', 'TESTVM002', 'TESTVM003' ) foreach($name in $names){ $ips =…

Virtual Machine Manager (VMM) Error ID: 1730

Symptom: $vmName='bad-guestvm' $vm = Get-SCVirtualMachine -Name $vmName Read-SCVirtualMachine -VM $vm Read-SCVirtualMachine : The selected action…