Remote shutdown of Windows 2012 Servers

View servers have firewall enabled. Needed to allow remote management
through for shutdown script to work
pull/45/head
DemitasseNZ 2016-04-17 18:53:31 +12:00
parent 28dad18d02
commit 48804a4758
5 changed files with 14 additions and 1 deletions

View File

@ -25,6 +25,9 @@ If (([System.Environment]::OSVersion.Version.Major -eq 6) -and ([System.Environm
set-ItemProperty -path 'HKCU:\Control Panel\Desktop' -name ScreenSaveActive -value 0 set-ItemProperty -path 'HKCU:\Control Panel\Desktop' -name ScreenSaveActive -value 0
Write-BuildLog "Install admin tools" Write-BuildLog "Install admin tools"
Add-WindowsFeature RSAT-Feature-Tools,RSAT-DHCP,RSAT-DNS-Server,RSAT-AD-AdminCenter Add-WindowsFeature RSAT-Feature-Tools,RSAT-DHCP,RSAT-DNS-Server,RSAT-AD-AdminCenter
Write-BuildLog "Enable remote management through firewall"
Netsh firewall set service RemoteAdmin
Netsh advfirewall set currentprofile settings remotemanagement enable
} }
$Files = get-childitem "b:\view$viewinstall" $Files = get-childitem "b:\view$viewinstall"
for ($i=0; $i -lt $files.Count; $i++) { for ($i=0; $i -lt $files.Count; $i++) {

View File

@ -24,6 +24,9 @@ If (([System.Environment]::OSVersion.Version.Major -eq 6) -and ([System.Environm
set-ItemProperty -path 'HKCU:\Control Panel\Desktop' -name ScreenSaveActive -value 0 set-ItemProperty -path 'HKCU:\Control Panel\Desktop' -name ScreenSaveActive -value 0
Write-BuildLog "Install admin tools" Write-BuildLog "Install admin tools"
Add-WindowsFeature RSAT-Feature-Tools,RSAT-DHCP,RSAT-DNS-Server,RSAT-AD-AdminCenter Add-WindowsFeature RSAT-Feature-Tools,RSAT-DHCP,RSAT-DNS-Server,RSAT-AD-AdminCenter
Write-BuildLog "Enable remote management through firewall"
Netsh firewall set service RemoteAdmin
Netsh advfirewall set currentprofile settings remotemanagement enable
} }
if (Test-Path "C:\VMware-view*") { if (Test-Path "C:\VMware-view*") {
$Files = get-childitem "C:\" $Files = get-childitem "C:\"

View File

@ -368,6 +368,8 @@ dnscmd localhost /RecordAdd lab.local Host4 A 192.168.199.14 >> C:\DNS.log
dnscmd localhost /RecordAdd lab.local CS1 A 192.168.199.33 >> C:\DNS.log dnscmd localhost /RecordAdd lab.local CS1 A 192.168.199.33 >> C:\DNS.log
dnscmd localhost /RecordAdd lab.local CS2 A 192.168.199.34 >> C:\DNS.log dnscmd localhost /RecordAdd lab.local CS2 A 192.168.199.34 >> C:\DNS.log
dnscmd localhost /RecordAdd lab.local SS A 192.168.199.35 >> C:\DNS.log dnscmd localhost /RecordAdd lab.local SS A 192.168.199.35 >> C:\DNS.log
dnscmd localhost /RecordAdd lab.local v1 A 192.168.199.36 >> C:\DNS.log
dnscmd localhost /RecordAdd lab.local vbr A 192.168.199.37 >> C:\DNS.log
dnscmd localhost /RecordAdd lab.local DC2 A 192.168.201.4 >> C:\DNS.log dnscmd localhost /RecordAdd lab.local DC2 A 192.168.201.4 >> C:\DNS.log
dnscmd localhost /RecordAdd lab.local VC2 A 192.168.201.5 >> C:\DNS.log dnscmd localhost /RecordAdd lab.local VC2 A 192.168.201.5 >> C:\DNS.log
dnscmd localhost /RecordAdd lab.local Host11 A 192.168.201.11 >> C:\DNS.log dnscmd localhost /RecordAdd lab.local Host11 A 192.168.201.11 >> C:\DNS.log
@ -383,6 +385,8 @@ dnscmd localhost /RecordAdd 199.168.192.in-addr.arpa 14 PTR Host4.lab.local >> C
dnscmd localhost /RecordAdd 199.168.192.in-addr.arpa 33 PTR cs1.lab.local >> C:\DNS.log dnscmd localhost /RecordAdd 199.168.192.in-addr.arpa 33 PTR cs1.lab.local >> C:\DNS.log
dnscmd localhost /RecordAdd 199.168.192.in-addr.arpa 34 PTR cs2.lab.local >> C:\DNS.log dnscmd localhost /RecordAdd 199.168.192.in-addr.arpa 34 PTR cs2.lab.local >> C:\DNS.log
dnscmd localhost /RecordAdd 199.168.192.in-addr.arpa 35 PTR SS.lab.local >> C:\DNS.log dnscmd localhost /RecordAdd 199.168.192.in-addr.arpa 35 PTR SS.lab.local >> C:\DNS.log
dnscmd localhost /RecordAdd 199.168.192.in-addr.arpa 36 PTR v1.lab.local >> C:\DNS.log
dnscmd localhost /RecordAdd 199.168.192.in-addr.arpa 37 PTR vbr.lab.local >> C:\DNS.log
dnscmd localhost /RecordAdd 201.168.192.in-addr.arpa 4 PTR DC2.lab.local >> C:\DNS.log dnscmd localhost /RecordAdd 201.168.192.in-addr.arpa 4 PTR DC2.lab.local >> C:\DNS.log
dnscmd localhost /RecordAdd 201.168.192.in-addr.arpa 5 PTR VC2.lab.local >> C:\DNS.log dnscmd localhost /RecordAdd 201.168.192.in-addr.arpa 5 PTR VC2.lab.local >> C:\DNS.log
dnscmd localhost /RecordAdd 201.168.192.in-addr.arpa 11 PTR Host11.lab.local >> C:\DNS.log dnscmd localhost /RecordAdd 201.168.192.in-addr.arpa 11 PTR Host11.lab.local >> C:\DNS.log

View File

@ -24,6 +24,9 @@ If (([System.Environment]::OSVersion.Version.Major -eq 6) -and ([System.Environm
set-ItemProperty -path 'HKCU:\Control Panel\Desktop' -name ScreenSaveActive -value 0 set-ItemProperty -path 'HKCU:\Control Panel\Desktop' -name ScreenSaveActive -value 0
Write-BuildLog "Install admin tools" Write-BuildLog "Install admin tools"
Add-WindowsFeature RSAT-Feature-Tools,RSAT-DHCP,RSAT-DNS-Server,RSAT-AD-AdminCenter Add-WindowsFeature RSAT-Feature-Tools,RSAT-DHCP,RSAT-DNS-Server,RSAT-AD-AdminCenter
Write-BuildLog "Enable remote management through firewall"
Netsh firewall set service RemoteAdmin
Netsh advfirewall set currentprofile settings remotemanagement enable
} }
$Files = get-childitem "b:\view$viewinstall" $Files = get-childitem "b:\view$viewinstall"
for ($i=0; $i -lt $files.Count; $i++) { for ($i=0; $i -lt $files.Count; $i++) {

View File

@ -36,7 +36,7 @@ If ([string]::Compare($ReBuild, "Y", $True) -eq "0"){
exit exit
} }
} }
Write-host "Connect to Linux amchiunes to cache RSA Keys, say yes to all" Write-host "Connect to Linux machines to cache RSA Keys, say yes to all"
$ping = new-object System.Net.NetworkInformation.Ping $ping = new-object System.Net.NetworkInformation.Ping
$Reply = $ping.send("192.168.199.254") $Reply = $ping.send("192.168.199.254")
if ($Reply.status eq "Success") { if ($Reply.status eq "Success") {