Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

join computer to domain powershell script

$dc = "ENTERPRISE"
$pw = "Password123" | ConvertTo-SecureString -asPlainText -Force
$usr = "$dcT.Simpson"
$pc = "WKS034, WKS052, WKS057" # Specify the computers that should be joined to the domain.
$creds = New-Object System.Management.Automation.PSCredential($usr$pw)
Add-Computer -ComputerName $pc -LocalCredential $pcadmin -DomainName $dc -Credential $creds -Restart -Force
Source by blog.netwrix.com #
 
PREVIOUS NEXT
Tagged: #join #computer #domain #powershell #script
ADD COMMENT
Topic
Name
6+5 =