I hope this helps someone!
Import-Module ActiveDirectory $computers = "PC1","PC2" # Optionally use Get-Content -Path C:\computers.txt $computers | ForEach-Object { $computer = "$($_)$"; Get-ADComputer -Filter { SamAccountName -eq $computer } | Move-ADObject -TargetPath "OU=Retired Workstations,OU=Company,DC=company,DC=corp" }
// michael
No comments:
Post a Comment