Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

join computer to domain powershell script

$dc = "ENTERPRISE" # Specify the domain to join.
$pw = "Password123" | ConvertTo-SecureString -asPlainText –Force # Specify the password for the domain admin.
$usr = "$dcT.Simpson" # Specify the domain admin account.
$creds = New-Object System.Management.Automation.PSCredential($usr,$pw)
Add-Computer -DomainName $dc -Credential $creds -restart -force -verbose # Note that the computer will be restarted automatically.
Source by blog.netwrix.com #
 
PREVIOUS NEXT
Tagged: #join #computer #domain #powershell #script
ADD COMMENT
Topic
Name
7+8 =