Powershell script to add computers to a Direct Access Computer group from an OU

Below you will find a powershell script that will add devices/users to a specific Group if they are in an OU.

get-adcomputer -SearchBase “OU=Windows 10,OU=Workstations,DC=boxne,DC=com” -Filter * | ForEach-Object {Add-ADGroupMember -Identity “Your Group Name” -Members $_.DistinguishedName}

If it’s BOLDED This is where your organization information will go!

Leave a Reply

Your email address will not be published. Required fields are marked *