Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Configuration SqlFirewallApp2
- {
- #Import-DscResource -ModuleName PSDesiredStateConfiguration
- Import-DSCResource -ModuleName xNetworking
- node $env:ComputerName
- {
- # instance rule
- xFireWall SQLFirewallRule
- {
- Name = "SqlApp2"
- DisplayName = 'Sql - App2'
- Group = 'DSC Configuration Rules'
- Ensure = 'Present'
- Enabled = 'True'
- Profile = ('Domain') # ,'Private'
- Direction = 'InBound'
- Protocol = 'TCP'
- Program = 'E:\sql\MSSQL12.APP2\MSSQL\Binn\sqlservr.exe'
- Description = 'Firewall Rule to allow SQL communication'
- }
- # dynamic port resolve rule
- xFireWall SQLFirewallRuleDynamicPortResolution
- {
- Name = "SqlDynamicPortQuery"
- DisplayName = 'Sql Dynamic Port Query'
- Group = 'DSC Configuration Rules'
- Ensure = 'Present'
- Enabled = 'True'
- Profile = ('Domain') # ,'Private'
- Direction = 'InBound'
- Protocol = 'UDP'
- LocalPort = ('1434')
- Description = 'Firewall Rule to allow SQL communication'
- }
- }
- }
- SqlFirewallApp2
- Start-DSCConfiguration -ComputerName $env:ComputerName -Path .\SqlFirewallApp2 -Wait -Verbose
Add Comment
Please, Sign In to add comment