-
Notifications
You must be signed in to change notification settings - Fork 0
/
VMM_AddWFWRule_VMMBITS.ps1
37 lines (27 loc) · 1.22 KB
/
VMM_AddWFWRule_VMMBITS.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
5#####################################################################################################################
#
# Creator: Ramazan Can
# Date Created: 16/02/2018
# Last Modified:
#
# - this script is to add FW rule for VMM ports 5985-5987, the port number can be modified at line28
#
#
#####################################################################################################################
cls
""
""
$vmms=Read-Host "VMMServer "
""
"Getting all VMM Managed Computers..."
$allvmmmanagedcomputers= (Get-SCVMMManagedComputer -VMMServer $vmms).Name | sort
$allcompcount=$allvmmmanagedcomputers.Count
"Done - $allcompcount total SCVMM managed computers found - starting foreach loop..."
""
foreach ($comp in $allvmmmanagedcomputers) {
""
Write-Host "Adding FW Rule for SCVMM BITS Traffic Allow port 5985-5986-5987 on $comp"
Invoke-Command -ComputerName $comp -ScriptBlock {
New-NetFirewallRule -DisplayName 'VMM Inbound Ports' -Profile @('Domain', 'Private') -Direction Inbound -Action Allow -Protocol TCP -LocalPort @('5985', '5986', '5987')
}
}