Q: How can I force a Group Policy update on specific machines based on an Active Directory search filter?
A: Use the Get-ADComputer PowerShell cmdlet with the -filter parameter to control the objects to be returned. Objects are then piped to the Invoke-GPUpdate cmdlet. The following example searches for all objects starting with win8 in the passed organizational unit (OU):
Get-ADComputer –filter 'Name -like "win8*"' -Searchbase "ou=VDI Clients, dc=Savilltech, dc=net" | foreach{ Invoke-GPUpdate –computer $_.name -force}
0 comments
Hide comments