让Windows加入域的PowerShell

$domain = "midrange.lab"
$password = "MyPassword!" | ConvertTo-SecureString -asPlainText -Force
$username = "$domain\administrator"
$credential = New-Object System.Management.Automation.PSCredential($username,$password)
Add-Computer -DomainName $domain -Credential $credential

 

来源

========================

Join Computer to Domain With Powershell (One-Click Method)

http://community.spiceworks.com/scripts/show/1540-join-computer-to-domain-with-powershell-one-click-method

posted on 2015-06-03 15:00  中道学友  阅读(3331)  评论(0编辑  收藏  举报

导航

技术追求准确,态度积极向上