Advertisement
easternnl

Easy WDS with PowerShell

May 8th, 2015
413
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $computername = read-host "Enter computername"
  2. $computername = $computername.ToUpper()
  3. $ou = read-host "Enter OU (Workstations or Servers)"
  4. $mac = read-host "Enter MAC"
  5. $mac = $mac.replace(":","")
  6.  
  7. $command1 = "/Add-Device /Device:$computername /ID:$mac /OU:""OU=$ou,OU=Eastern,DC=Easternnet,DC=Nl"""
  8. $command2 = "/Set-Device /Device:$computername /User:install /JoinRights:Full /JoinDomain:Yes /Domain:easternnet.nl /ResetAccount"
  9.  
  10. write-host "wdsutil $command1"
  11. write-host "wdsutil $command2"
  12.  
  13. $continue = read-host "Press enter to continue or ctrl-c to stop"
  14.  
  15. Start-Process -Wait "wdsutil" -ArgumentList $command1 -NoNewWindow
  16. Start-Process -Wait "wdsutil" -ArgumentList $command2 -NoNewWindow
  17.  
  18. $continue = read-host "Press enter to continue"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement