Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- "This script will rename a remote computer, and it's Active Directory Account"
- #update domain and username in script before running
- #Will reboot system immediate upon completion. Remove -restart to allow machine to be manually rebooted.
- #If script fails - run set-execuitonPolicy unrestricted first.
- importsystemmodules
- $OldName = read-host "enter the name of the remote computer to RENAME now"
- $NewName = read-host "Enter the new computer name now"
- Rename-Computer -confirm -NewName $newName -Computername $oldName -domainCredential "DOMAIN\USERNAME" -restart
- Set-ExecutionPolicy restricted
- #If script fails - in an elevated command prompt or script, run this on Win7/8 hosts - netsh advfirewall firewall set rule group="windows management instrumentation (wmi)" new enable=yes
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement