Join to domain powershell script

Join to domain powershell script

$username = "domain\admin"
$Password = "xxxxxxxx"
$pwd = $Password | ConvertTo-SecureString -asPlainText -Force
$credential = New-Object System.Management.Automation.PSCredential($UserName,$pwd)
$Domain = "domain.com"
Add-Computer -DomainName $Domain -Credential $credential –Restart

猜你喜欢

转载自www.cnblogs.com/oskb/p/9369852.html