You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: public/New-DbaFirewallRule.ps1
+51-2Lines changed: 51 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -54,6 +54,16 @@ function New-DbaFirewallRule {
54
54
The firewall rule for the DAC will only be created if the DAC is configured for listening remotely.
55
55
Use `Set-DbaSpConfigure -SqlInstance SRV1 -Name RemoteDacConnectionsEnabled -Value 1` to enable remote DAC before running this command.
56
56
57
+
The firewall rule for database mirroring or Availability Groups will have the following configuration (parameters for New-NetFirewallRule):
58
+
59
+
DisplayName = 'SQL Server default instance (DatabaseMirroring)' or 'SQL Server instance <InstanceName> (DatabaseMirroring)'
60
+
Name = 'SQL Server default instance (DatabaseMirroring)' or 'SQL Server instance <InstanceName> (DatabaseMirroring)'
61
+
Group = 'SQL Server'
62
+
Enabled = 'True'
63
+
Direction = 'Inbound'
64
+
Protocol = 'TCP'
65
+
LocalPort = '5022' (can be overwritten by using the parameter Configuration)
66
+
57
67
.PARAMETERSqlInstance
58
68
The target SQL Server instance or instances.
59
69
@@ -63,7 +73,7 @@ function New-DbaFirewallRule {
63
73
.PARAMETERType
64
74
Specifies which firewall rule types to create for SQL Server network access.
65
75
Use this when you need to create specific rules instead of the automatic detection behavior.
66
-
Valid values are Engine (SQL Server instance), Browser (SQL Server Browser service), and DAC (Dedicated Admin Connection). When omitted, the function automatically creates Engine rules plus Browser rules for non-default ports and DAC rules when remote DAC is enabled.
76
+
Valid values are Engine (SQL Server instance), Browser (SQL Server Browser service), DAC (Dedicated Admin Connection) and DatabaseMirroring (database mirroring or Availability Groups). When omitted, the function automatically creates Engine rules plus Browser rules for non-default ports and DAC rules when remote DAC is enabled.
67
77
68
78
.PARAMETERConfiguration
69
79
Provides custom settings to override the default firewall rule configuration when calling New-NetFirewallRule.
@@ -113,13 +123,23 @@ function New-DbaFirewallRule {
113
123
114
124
Creates or recreates the firewall rule for the instance TEST on SRV1. Does not prompt for confirmation.
Copy file name to clipboardExpand all lines: public/Remove-DbaFirewallRule.ps1
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,7 @@ function Remove-DbaFirewallRule {
21
21
.PARAMETERType
22
22
Specifies which types of SQL Server firewall rules to remove from the target computer.
23
23
Use this to control exactly which network access rules are cleaned up when decommissioning or reconfiguring SQL Server instances.
24
-
Engine removes rules for SQL Server database connections, Browser removes UDP port 1434 rules for SQL Server Browser service, DAC removes Dedicated Admin Connection rules, and AllInstance removes all SQL Server-related rules. Defaults to Engine and DAC since Browser rules are often shared between multiple instances.
24
+
Engine removes rules for SQL Server database connections, Browser removes UDP port 1434 rules for SQL Server Browser service, DAC removes Dedicated Admin Connection rules, DatabaseMirroring removes database mirroring or Availability Groups rules, and AllInstance removes all SQL Server-related rules. Defaults to Engine and DAC since Browser rules are often shared between multiple instances.
25
25
26
26
.PARAMETERInputObject
27
27
Accepts firewall rule objects from Get-DbaFirewallRule for pipeline-based removal operations.
@@ -77,7 +77,7 @@ function Remove-DbaFirewallRule {
0 commit comments