Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $computername = read-host "Enter computername"
- $computername = $computername.ToUpper()
- $ou = read-host "Enter OU (Workstations or Servers)"
- $mac = read-host "Enter MAC"
- $mac = $mac.replace(":","")
- $command1 = "/Add-Device /Device:$computername /ID:$mac /OU:""OU=$ou,OU=Eastern,DC=Easternnet,DC=Nl"""
- $command2 = "/Set-Device /Device:$computername /User:install /JoinRights:Full /JoinDomain:Yes /Domain:easternnet.nl /ResetAccount"
- write-host "wdsutil $command1"
- write-host "wdsutil $command2"
- $continue = read-host "Press enter to continue or ctrl-c to stop"
- Start-Process -Wait "wdsutil" -ArgumentList $command1 -NoNewWindow
- Start-Process -Wait "wdsutil" -ArgumentList $command2 -NoNewWindow
- $continue = read-host "Press enter to continue"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement