上章節提到經過netdom join加域並指定對應OU,本章再補充一例現成powershell加域並指定對應OU的腳本,便於你們工做中使用。html
$PlainPassword = P@ssw0rd $UserName="Administrator" $DomainName="azureyun.com" $DomainUserName="$UserName@"+"$DomainName" $SecurePassword = $PlainPassword | ConvertTo-SecureString -AsPlainText -Force $DomainCredentials = New-Object System.Management.Automation.PSCredential -ArgumentList $DomainUserName,$SecurePassword Add-Computer –NewName 新計算機名 -DomainName azureyun.com -OUPath "OU=syncall,DC=azureyun,DC=com" -Confirm:$false -Credential $Credential –Restart
註解:紅色字體,新計算機名位置屬於您要更改的新計算機名便可。shell
歡迎關注微信公衆號:小溫研習社
微信