Skip to content

Commit

Permalink
SqlServerNetwork: Add PsDscRunAsCredential parameter to examples (dsc…
Browse files Browse the repository at this point in the history
…community#963)

- Changes to SqlServerNetwork
  - Added sysadmin account parameter usage to the examples.
  • Loading branch information
johlju authored Dec 25, 2017
1 parent 62f7e92 commit 4e919b4
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 13 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
- Changes to SqlAlias
- Fixed issue where exception was thrown if reg keys did not exist
([issue #949](https://github.com/PowerShell/SqlServerDsc/issues/949)).
- Changes to SqlServerNetwork
- Added sysadmin account parameter usage to the examples.
- Changes to SqlServiceAccount
- Default services are now properly detected
([issue #930](https://github.com/PowerShell/SqlServerDsc/issues/930)).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
.EXAMPLE
This example will enable TCP/IP protocol and set the custom static port to 4509.
When RestartService is set to $true the resource will also restart the SQL service.
The resource will be run as the account provided in $SystemAdministratorAccount.
#>
Configuration Example
{
Expand All @@ -10,7 +11,7 @@ Configuration Example
[Parameter(Mandatory = $true)]
[System.Management.Automation.PSCredential]
[System.Management.Automation.Credential()]
$SysAdminAccount
$SystemAdministratorAccount
)

Import-DscResource -ModuleName SqlServerDsc
Expand All @@ -19,12 +20,13 @@ Configuration Example
{
SqlServerNetwork 'ChangeTcpIpOnDefaultInstance'
{
InstanceName = 'MSSQLSERVER'
ProtocolName = 'Tcp'
IsEnabled = $true
TCPDynamicPort = $false
TCPPort = 4509
RestartService = $true
InstanceName = 'MSSQLSERVER'
ProtocolName = 'Tcp'
IsEnabled = $true
TCPDynamicPort = $false
TCPPort = 4509
RestartService = $true
PsDscRunAsCredential = $SystemAdministratorAccount
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
.EXAMPLE
This example will enable TCP/IP protocol and set the custom static port to 4509.
When RestartService is set to $true the resource will also restart the SQL service.
The resource will be run as the account provided in $SystemAdministratorAccount.
#>
Configuration Example
{
Expand All @@ -10,7 +11,7 @@ Configuration Example
[Parameter(Mandatory = $true)]
[System.Management.Automation.PSCredential]
[System.Management.Automation.Credential()]
$SysAdminAccount
$SystemAdministratorAccount
)

Import-DscResource -ModuleName SqlServerDsc
Expand All @@ -19,11 +20,12 @@ Configuration Example
{
SqlServerNetwork 'ChangeTcpIpOnDefaultInstance'
{
InstanceName = 'MSSQLSERVER'
ProtocolName = 'Tcp'
IsEnabled = $true
TCPDynamicPort = $true
RestartService = $true
InstanceName = 'MSSQLSERVER'
ProtocolName = 'Tcp'
IsEnabled = $true
TCPDynamicPort = $true
RestartService = $true
PsDscRunAsCredential = $SystemAdministratorAccount
}
}
}

0 comments on commit 4e919b4

Please sign in to comment.