Advertisement
D0cEvil

PowerShell -Rename and restart computer

Sep 19th, 2022
91
1
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PowerShell 0.26 KB | Software | 1 0
  1. ### Function to rename and restart the server###
  2.  
  3. ## Variable to store computer name##
  4. $COMPUTERNAME = Read-Host "Enter computer name:"
  5.  
  6. ##Command to rename computer##
  7. Rename-Computer $COMPUTERNAME
  8.  
  9. ##Command to restart computer##
  10. Restart-Computer -Confirm
Tags: powershell
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement