I have a text file in the following format:
Computer01
Computer02
I'm trying run this PowerShell Script against it that moves any computer name in the file over to the Dormant OU in our environment:
Import-module ActiveDirectory
$computerObjects = get-content C:\ComputerNames.txt
ForEach($computerObject in $computerObjects)
{Move-ADObject $computerObject -TargetPath "OU=Dormant, DC=company, DC=com"}
When I run it, I get the following error message:
"Move-ADObject : Cannot find an object with identity: 'Computer1' under: 'DC=company,DC=com'."
Can you provide some insight on the situation? Thanks!