Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $nic=Get-Netadapter
- $password = "some_secret_pass" | ConvertTo-SecureString -asPlainText -Force
- $username = "some_AD_domain\some_user_id"
- $credential = New-Object System.Management.Automation.PSCredential($username,$password)
- $currenthost = $env:COMPUTERNAME
- Set-DNSClientServerAddress -InterfaceIndex $nic.ifindex -ServerAddresses "x.x.x.x","y.y.y.y"
- Add-Computer -DomainName some.domain -Credential $credential -ComputerName $currenthost -NewName NewTest -Restart
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement