Bulk add computers to active directory group using powershell

Needed to go through the environment and find all the computers per datacenter and add them to their respective security groups so they would get WSUS group policy applied to them:

So I had to search for a list of computers using powershell, then add that very same list of computers to an active directory group

$pcs= Get-ADComputer -LDAPFilter "(name=sue*)" -SearchBase "ou=thick,ou=3_workstations,DC=domain,DC=local"
foreach ($pc in $pcs) 
   Add-ADGroupMember "WSUS_WKS1" $pc

Find all Active Directory computers NOT in a group(s) using PowerShell

Stretching my legs yet again in the MS world using powershell…

This time, I need to find all the computers in the Thick OU that are not members of WSUS groups!

Get-QADComputer -searchroot "ccs.local/3_workstations/thick" -NotMemberOf "WSUS_WKS1", "WSUS_WKS2", "WSUS_WKS3"

Find Active Directory object name from SID using Windows Powershell

Found some erroneous SID’s within a procmon capture, trying to figure out who they belonged to.

What else to use, PowerShell!

$objSID = New-Object System.Security.Principal.SecurityIdentifier `
 $objUser = $objSID.Translate( [System.Security.Principal.NTAccount])

Server not connecting to the correct DFS server

let me guess, your server is in site A, and instead of connecting to DFS server A, its connecting to DFS server B in site B? Bad cached DFS referral

here’s your fix!

From the client not connecting to the correct DFS server:

ServerManagerCmd -install RSAT-DFS-Mgmt-Con
dfsutil /pktflush

This will instantly fix your problem!