Advertisement
Guest User

Untitled

a guest
Jun 22nd, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. # PING
  2. ECHO "Enabling ICMPv4"
  3. Import-Module NetSecurity
  4. Set-NetFirewallRule -DisplayName "File and Printer Sharing (Echo Request - ICMPv4-In)" -enabled True
  5. ECHO "Done"
  6.  
  7. # NAME
  8. ECHO "Changing server name"
  9. $name = Read-Host "Insert server name"
  10. Rename-Computer $name
  11. ECHO "Done"
  12.  
  13. # RDP
  14. ECHO "Enabling RDP"
  15. $server = hostname
  16. Invoke-Command -ComputerName $server -ScriptBlock {Set-ItemProperty -Path "HKLM:\System\CurrentControlSet\Control\Terminal Server" -Name "fDenyTSConnections" -Value 0}
  17. Invoke-Command -ComputerName $server -ScriptBlock {Enable-NetFirewallRule -DisplayGroup "Remote Desktop"}
  18. ECHO "Done"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement