1
以下DSC語句複製現有的Windows防火牆規則,而不是僅更新已存在的相同規則。我寧願更新而不是重複。由於使用DSC資源啓用ICMP xFirewall創建新規則
xFirewall EnableV4PingIn{
Name = 'File and Printer Sharing (Echo Request - ICMPv4-In)'
Group= 'File and Printer Sharing'
Protocol = 'ICMPv4'
Ensure='Present'
Enabled='True'
Direction='Inbound'
PsDscRunAsCredential = $DomainAdminCredential
}
xFirewall EnableV4PingOut{
Name = 'File and Printer Sharing (Echo Request - ICMPv4-Out)'
Group= 'File and Printer Sharing'
Protocol = 'ICMPv4'
Ensure='Present'
Enabled='True'
Direction='Outbound'
PsDscRunAsCredential = $DomainAdminCredential
}
xFirewall EnableV6PingIn{
Name = 'File and Printer Sharing (Echo Request - ICMPv6-In)'
Group= 'File and Printer Sharing'
Protocol = 'ICMPv6'
Ensure='Present'
Enabled='True'
Direction='Inbound'
PsDscRunAsCredential = $DomainAdminCredential
}
xFirewall EnableV6PingOut{
Name = 'File and Printer Sharing (Echo Request - ICMPv6-Out)'
Group= 'File and Printer Sharing'
Protocol = 'ICMPv6'
Ensure='Present'
Enabled='True'
Direction='Outbound'
PsDscRunAsCredential = $DomainAdminCredential
}
你有沒有想過一個方法來防止這個dups?我有同樣的問題... –