Friday 24 April 2020

Change registry value with command

overwrite windows update server

reg add HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU /v UseWUServer /t Reg_DWord /d 0

Optional: set windows AutoUpdate to disable

reg add HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU /v NoAutoUpdate/t Reg_DWord /d 0

Wednesday 8 April 2020

get ad security groups applied to an AD user

$id = [Security.Principal.WindowsIdentity]("username")
$groups = $id.Groups | foreach-object {$_.Translate([Security.Principal.NTAccount])}
$groups | select *

to find specific group:

$id = [Security.Principal.WindowsIdentity]("username")
$groups = $id.Groups | foreach-object {$_.Translate([Security.Principal.NTAccount])}
$groups | findstr /i "vpn"


to find members of a particular group in AD
Get-adgroupmember -identity "domain admins" -Recursive | Select-Object name, objectclass