2
時所以當我運行下面的腳本,它將按預期工作更改主機名和域加入正常;但指定OU
$newname = Read-Host 'Desired hostname'
$user = Read-Host 'Domain admin username'
$cpc = hostname.exe
Add-Computer -DomainName DOMAIN.CO.UK -ComputerName $cpc -NewName $newname -Credential domain\$user
pause
然而,當我再嘗試添加-OUPath "OU=ourou,OU=ourou,DC=domain,DC=co,DC=uk"
像這樣:
$newname = Read-Host 'Desired hostname'
$user = Read-Host 'Domain admin username'
$cpc = hostname.exe
Add-Computer -DomainName DOMAIN.CO.UK -ComputerName $cpc -NewName $newname -Credential domain\$user -OUPath "OU=Workstations,OU=Windows 10,DC=domain,DC=co,DC=uk"
pause
腳本休息,返回:
未能從其當前工作組加入域...系統找不到指定的文件
有什麼想法?
這裏的廣告佈局,萬一我正在做一個愚蠢的錯誤:
感謝您添加您的答案。 –