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
脚本休息,返回:
未能从其当前工作组加入域...系统找不到指定的文件
有什么想法?
这里的广告布局,万一我正在做一个愚蠢的错误:
感谢您添加您的答案。 –