Guest User

Untitled

a guest
Oct 22nd, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.42 KB | None | 0 0
  1. Configuration SqlFirewallApp2
  2. {
  3.  
  4. #Import-DscResource -ModuleName PSDesiredStateConfiguration
  5. Import-DSCResource -ModuleName xNetworking
  6.  
  7. node $env:ComputerName
  8. {
  9. # instance rule
  10. xFireWall SQLFirewallRule
  11. {
  12. Name = "SqlApp2"
  13. DisplayName = 'Sql - App2'
  14. Group = 'DSC Configuration Rules'
  15. Ensure = 'Present'
  16. Enabled = 'True'
  17. Profile = ('Domain') # ,'Private'
  18. Direction = 'InBound'
  19. Protocol = 'TCP'
  20. Program = 'E:\sql\MSSQL12.APP2\MSSQL\Binn\sqlservr.exe'
  21. Description = 'Firewall Rule to allow SQL communication'
  22. }
  23.  
  24. # dynamic port resolve rule
  25. xFireWall SQLFirewallRuleDynamicPortResolution
  26. {
  27. Name = "SqlDynamicPortQuery"
  28. DisplayName = 'Sql Dynamic Port Query'
  29. Group = 'DSC Configuration Rules'
  30. Ensure = 'Present'
  31. Enabled = 'True'
  32. Profile = ('Domain') # ,'Private'
  33. Direction = 'InBound'
  34. Protocol = 'UDP'
  35. LocalPort = ('1434')
  36. Description = 'Firewall Rule to allow SQL communication'
  37. }
  38. }
  39. }
  40.  
  41. SqlFirewallApp2
  42. Start-DSCConfiguration -ComputerName $env:ComputerName -Path .\SqlFirewallApp2 -Wait -Verbose
Add Comment
Please, Sign In to add comment