sqlserverdsc
Version information
This version is compatible with:
- Puppet Enterprise 2023.2.x, 2023.1.x, 2023.0.x, 2021.7.x, 2021.6.x, 2021.5.x, 2021.4.x, 2021.3.x, 2021.2.x, 2021.1.x, 2021.0.x, 2019.8.x, 2019.7.x, 2019.5.x, 2019.4.x, 2019.3.x, 2019.2.x, 2019.1.x, 2019.0.x
- Puppet >= 6.0.0 < 8.0.0
Start using this module
Add this module to your Puppetfile:
mod 'dsc-sqlserverdsc', '15.0.0-0-1'
Learn more about managing modules with a PuppetfileDocumentation
Table of Contents
Description
This is an auto-generated module, using the Puppet DSC Builder to vendor and expose the PowerShell module's DSC resources as Puppet resources. The functionality of this module comes entirely from the vendored PowerShell resources, which are pinned at v15.0.0. The PowerShell module describes itself like this:
Module with DSC resources for deployment and configuration of Microsoft SQL Server.
For information on troubleshooting to determine whether any encountered problems are with the Puppet wrapper or the DSC resource, see the troubleshooting section below.
Requirements
This module, like all auto-generated Puppetized DSC modules, relies on two important technologies in the Puppet stack: the Puppet Resource API and the puppetlabs/pwshlib Puppet module.
The Resource API provides a simplified option for writing types and providers and is responsible for how this module is structured. The Resource API ships inside of Puppet starting with version 6. While it is technically possible to add the Resource API functionality to Puppet 5.5.x, the DSC functionality has not been tested in this setup. For more information on the Resource API, review the documentation.
The module also depends on the pwshlib module. This Puppet module includes two important things: the ruby-pwsh library for running PowerShell code from ruby and the base provider for DSC resources, which this module leverages.
All of the actual work being done to call the DSC resources vendored with this module is in this file from the pwshlib module. This is important for troubleshooting and bug reporting, but doesn't impact your use of the module except that the end result will be that nothing works, as the dependency is not installed alongside this module!
Usage
You can specify any of the DSC resources from this module like a normal Puppet resource in your manifests. The examples below use DSC resources from from the PowerShellGet repository, regardless of what module you're looking at here; the syntax, not the specifics, is what's important.
For reference documentation about the DSC resources exposed in this module, see the Reference Forge tab, or the REFERENCE.md file.
# Include a meaningful title for your resource declaration
dsc_psrepository { 'Add team module repo':
dsc_name => 'foo',
dsc_ensure => present,
# This location is nonsense, can be any valid folder on your
# machine or in a share, any location the SourceLocation param
# for the DSC resource will accept.
dsc_sourcelocation => 'C:\Program Files',
# You must always pass an enum fully lower-cased;
# Puppet is case sensitive even when PowerShell isn't
dsc_installationpolicy => untrusted,
}
dsc_psrepository { 'Trust public gallery':
dsc_name => 'PSGallery',
dsc_ensure => present,
dsc_installationpolicy => trusted,
}
dsc_psmodule { 'Make Ruby manageable via uru':
dsc_name => 'RubyInstaller',
dsc_ensure => present,
}
For more information about using a built module, check out our narrative documentation.
Properties
Note that the only properties specified in a resource declaration which are passed to Invoke-Dsc are all prepended with dsc.
If a property does _not start with dsc_ it is used to control how Puppet interacts with DSC/other Puppet resources - for example,
specifying a unique name for the resource for Puppet to distinguish between declarations or Puppet metaparameters (notifies,
before, etc).
Troubleshooting
In general, there are three broad categories of problems:
- Problems with the way the underlying DSC resource works.
- Problems with the type definition, where you can't specify a valid set of properties for the DSC resource
- Problems with calling the underlying DSC resource - the parameters aren't being passed correctly or the resource can't be found
Unfortunately, problems with the way the underlying DSC resource works are something we can't help directly with. You'll need to file an issue with the upstream maintainers for the PowerShell module.
Problems with the type definition are when a value that should be valid according to the DSC resource's documentation and code is not accepted by the Puppet wrapper. If and when you run across one of these, please file an issue with the Puppet DSC Builder; this is where the conversion happens and once we know of a problem we can fix it and regenerate the Puppet modules. To help us identify the issue, please specify the DSC module, version, resource, property and values that are giving you issues. Once a fix is available we will regenerate and release updated versions of this Puppet wrapper.
Problems with calling the underlying DSC resource become apparent by comparing <value passed in in puppet>
with <value received by DSC>
.
In this case, please file an issue with the puppetlabs/pwshlib module, which is where the DSC base provider actually lives.
We'll investigate and prioritize a fix and update the puppetlabs/pwshlib module.
Updating to the pwshlib version with the fix will immediately take advantage of the improved functionality without waiting for this module to be reconverted and published.
For specific information on troubleshooting a generated module, check the troubleshooting guide for the puppet.dsc module.
Known Limitations
Currently, because of the way Puppet caches files on agents, use of the legacy puppetlabs-dsc
module is not compatible with this or any auto-generated DSC module.
Inclusion of both will lead to pluginsync conflicts.
Reference
Table of Contents
Resource types
dsc_sqlag
: The DSC SqlAG resource type. Automatically generated from version 15.0.0dsc_sqlagdatabase
: The DSC SqlAGDatabase resource type. Automatically generated from version 15.0.0dsc_sqlagentalert
: The DSC SqlAgentAlert resource type. Automatically generated from version 15.0.0dsc_sqlagentfailsafe
: The DSC SqlAgentFailsafe resource type. Automatically generated from version 15.0.0dsc_sqlagentoperator
: The DSC SqlAgentOperator resource type. Automatically generated from version 15.0.0dsc_sqlaglistener
: The DSC SqlAGListener resource type. Automatically generated from version 15.0.0dsc_sqlagreplica
: The DSC SqlAGReplica resource type. Automatically generated from version 15.0.0dsc_sqlalias
: The DSC SqlAlias resource type. Automatically generated from version 15.0.0dsc_sqlalwaysonservice
: The DSC SqlAlwaysOnService resource type. Automatically generated from version 15.0.0dsc_sqlconfiguration
: The DSC SqlConfiguration resource type. Automatically generated from version 15.0.0dsc_sqldatabase
: The DSC SqlDatabase resource type. Automatically generated from version 15.0.0dsc_sqldatabasedefaultlocation
: The DSC SqlDatabaseDefaultLocation resource type. Automatically generated from version 15.0.0dsc_sqldatabasemail
: The DSC SqlDatabaseMail resource type. Automatically generated from version 15.0.0dsc_sqldatabaseobjectpermission
: The DSC SqlDatabaseObjectPermission resource type. Automatically generated from version 15.0.0dsc_sqldatabaseowner
: The DSC SqlDatabaseOwner resource type. Automatically generated from version 15.0.0dsc_sqldatabasepermission
: The DSC SqlDatabasePermission resource type. Automatically generated from version 15.0.0dsc_sqldatabaserecoverymodel
: The DSC SqlDatabaseRecoveryModel resource type. Automatically generated from version 15.0.0dsc_sqldatabaserole
: The DSC SqlDatabaseRole resource type. Automatically generated from version 15.0.0dsc_sqldatabaseuser
: The DSC SqlDatabaseUser resource type. Automatically generated from version 15.0.0dsc_sqlendpoint
: The DSC SqlEndpoint resource type. Automatically generated from version 15.0.0dsc_sqlendpointpermission
: The DSC SqlEndpointPermission resource type. Automatically generated from version 15.0.0dsc_sqllogin
: The DSC SqlLogin resource type. Automatically generated from version 15.0.0dsc_sqlmaxdop
: The DSC SqlMaxDop resource type. Automatically generated from version 15.0.0dsc_sqlmemory
: The DSC SqlMemory resource type. Automatically generated from version 15.0.0dsc_sqlpermission
: The DSC SqlPermission resource type. Automatically generated from version 15.0.0dsc_sqlprotocol
: The DSC SqlProtocol resource type. Automatically generated from version 15.0.0dsc_sqlprotocoltcpip
: The DSC SqlProtocolTcpIp resource type. Automatically generated from version 15.0.0dsc_sqlreplication
: The DSC SqlReplication resource type. Automatically generated from version 15.0.0dsc_sqlrole
: The DSC SqlRole resource type. Automatically generated from version 15.0.0dsc_sqlrs
: The DSC SqlRS resource type. Automatically generated from version 15.0.0dsc_sqlrssetup
: The DSC SqlRSSetup resource type. Automatically generated from version 15.0.0dsc_sqlscript
: The DSC SqlScript resource type. Automatically generated from version 15.0.0dsc_sqlscriptquery
: The DSC SqlScriptQuery resource type. Automatically generated from version 15.0.0dsc_sqlsecureconnection
: The DSC SqlSecureConnection resource type. Automatically generated from version 15.0.0dsc_sqlserverendpointstate
: The DSC SqlServerEndpointState resource type. Automatically generated from version 15.0.0dsc_sqlservernetwork
: The DSC SqlServerNetwork resource type. Automatically generated from version 15.0.0dsc_sqlserviceaccount
: The DSC SqlServiceAccount resource type. Automatically generated from version 15.0.0dsc_sqlsetup
: The DSC SqlSetup resource type. Automatically generated from version 15.0.0dsc_sqltraceflag
: The DSC SqlTraceFlag resource type. Automatically generated from version 15.0.0dsc_sqlwaitforag
: The DSC SqlWaitForAG resource type. Automatically generated from version 15.0.0dsc_sqlwindowsfirewall
: The DSC SqlWindowsFirewall resource type. Automatically generated from version 15.0.0
Resource types
dsc_sqlag
The DSC SqlAG resource type. Automatically generated from version 15.0.0
Properties
The following properties are available in the dsc_sqlag
type.
dsc_automatedbackuppreference
Data type: Optional[Enum['Primary', 'SecondaryOnly', 'Secondary', 'None']]
Specifies the automated backup preference for the availability group. When creating a group the default is 'None'
.
dsc_availabilitymode
Data type: Optional[Enum['AsynchronousCommit', 'SynchronousCommit']]
Specifies the replica availability mode. When creating a group the default is 'AsynchronousCommit'
.
dsc_backuppriority
Data type: Optional[Integer[0, 4294967295]]
Specifies the desired priority of the replicas in performing backups. The acceptable values for this parameter are: integers from 0
through 100
. Of the set of replicas which are online and available, the replica that has the highest priority performs the backup. When creating a group the default is 50
.
dsc_basicavailabilitygroup
Data type: Optional[Boolean]
Specifies the type of availability group is Basic. This is only available is SQL Server 2016 and later and is ignored when applied to previous versions.
dsc_connectionmodeinprimaryrole
Data type: Optional[Enum['AllowAllConnections', 'AllowReadWriteConnections']]
Specifies how the availability replica handles connections when in the primary role.
dsc_connectionmodeinsecondaryrole
Data type: Optional[Enum['AllowNoConnections', 'AllowReadIntentConnectionsOnly', 'AllowAllConnections']]
Specifies how the availability replica handles connections when in the secondary role.
dsc_databasehealthtrigger
Data type: Optional[Boolean]
Specifies if the option Database Level Health Detection is enabled. This is only available is SQL Server 2016 and later and is ignored when applied to previous versions.
dsc_dtcsupportenabled
Data type: Optional[Boolean]
Specifies if the option Database DTC Support is enabled. This is only available is SQL Server 2016 and later and is ignored when applied to previous versions. This can not be altered once the availability group is created and is ignored if it is the case.
dsc_endpointhostname
Data type: Optional[String]
Specifies the hostname or IP address of the availability group replica endpoint. When creating a group the default is the instance network name.
dsc_endpointport
Data type: Optional[Integer[0, 4294967295]]
Returns the port the database mirroring endpoint is listening on.
dsc_endpointurl
Data type: Optional[String]
Returns the URL of the availability group replica endpoint.
dsc_ensure
Data type: Optional[Enum['Present', 'Absent']]
Specifies if the availability group should be present or absent. Default value is 'Present'
.
dsc_failovermode
Data type: Optional[Enum['Automatic', 'Manual']]
Specifies the failover mode. When creating a group the default is 'Manual'
.
dsc_failureconditionlevel
Data type: Optional[Enum['OnServerDown', 'OnServerUnresponsive', 'OnCriticalServerErrors', 'OnModerateServerErrors', 'OnAnyQualifiedFailureCondition']]
Specifies the automatic failover behavior of the availability group.
dsc_healthchecktimeout
Data type: Optional[Integer[0, 4294967295]]
Specifies the length of time, in milliseconds, after which AlwaysOn Availability Groups declare an unresponsive server to be unhealthy. When creating a group the default is 30000
.
dsc_isactivenode
Data type: Optional[Boolean]
Returns if the current node is actively hosting the SQL Server instance.
dsc_processonlyonactivenode
Data type: Optional[Boolean]
Specifies that the resource will only determine if a change is needed if the target node is the active host of the SQL Server instance.
dsc_servername
Data type: String
Hostname of the SQL Server to be configured.
dsc_version
Data type: Optional[Integer[0, 4294967295]]
Returns the major version of the SQL Server instance.
Parameters
The following parameters are available in the dsc_sqlag
type.
dsc_instancename
namevar
Data type: String
Name of the SQL instance to be configured.
dsc_name
namevar
Data type: String
Specifies the name of the availability group.
dsc_psdscrunascredential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
name
namevar
Data type: String
Description of the purpose for this resource declaration.
dsc_sqlagdatabase
The DSC SqlAGDatabase resource type. Automatically generated from version 15.0.0
Properties
The following properties are available in the dsc_sqlagdatabase
type.
dsc_backuppath
Data type: String
The path used to seed the availability group replicas. This should be a path that is accessible by all of the replicas.
dsc_databasename
Data type: Array[String]
The name of the database(s) to add to the availability group. This accepts wildcards.
dsc_ensure
Data type: Optional[Enum['Present', 'Absent']]
Specifies the membership of the database(s) in the availability group. The option 'Present'
means that the defined database(s) are added to the availability group. All other databases that may be a member of the availability group are ignored. The option 'Absent'
means that the defined database(s) are removed from the availability group. All other databases that may be a member of the availability group are ignored. The default is 'Present'
.
dsc_isactivenode
Data type: Optional[Boolean]
Returns if the current node is actively hosting the SQL Server instance.
dsc_matchdatabaseowner
Data type: Optional[Boolean]
If set to $true
, this ensures the database owner of the database on the primary replica is the owner of the database on all secondary replicas. This requires the database owner is available as a login on all replicas and that the PsDscRunAsCredential has impersonate any login, control server, impersonate login, or control login permissions. If set to $false
, the owner of the database will be the username specified in PsDscRunAsCredential. The default is $false
.
dsc_processonlyonactivenode
Data type: Optional[Boolean]
Specifies that the resource will only determine if a change is needed if the target node is the active host of the SQL Server instance.
dsc_replaceexisting
Data type: Optional[Boolean]
If set to $true
, this adds the restore option WITH REPLACE
. If set to $false
, existing databases and files will block the restore and throw error. The default is $false
.
Parameters
The following parameters are available in the dsc_sqlagdatabase
type.
dsc_availabilitygroupname
namevar
Data type: String
The name of the availability group in which to manage the database membership(s).
dsc_force
Data type: Optional[Boolean]
When parameter Ensure is set to 'Present'
it ensures the specified database(s) are the only databases that are a
member of the specified Availability Group. This parameter is ignored when parameter Ensure is set to 'Absent'
.
dsc_instancename
namevar
Data type: String
Name of the SQL Server instance where the primary replica of the availability group lives. If the availability group is not currently on this instance, the resource will attempt to connect to the instance where the primary replica lives.
dsc_psdscrunascredential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
dsc_servername
namevar
Data type: String
Hostname of the SQL Server where the primary replica of the availability group lives. If the availability group is not currently on this server, the resource will attempt to connect to the server where the primary replica lives.
name
namevar
Data type: String
Description of the purpose for this resource declaration.
dsc_sqlagentalert
The DSC SqlAgentAlert resource type. Automatically generated from version 15.0.0
Properties
The following properties are available in the dsc_sqlagentalert
type.
dsc_ensure
Data type: Optional[Enum['Present', 'Absent']]
Specifies if the SQL Server Agent alert should be present or absent. Default value is 'Present'
.
dsc_messageid
Data type: Optional[String]
The message id of the SQL Server Agent alert.
dsc_servername
Data type: Optional[String]
The host name of the SQL Server to be configured. Default value is $env:COMPUTERNAME
.
dsc_severity
Data type: Optional[String]
The severity of the SQL Server Agent alert.
Parameters
The following parameters are available in the dsc_sqlagentalert
type.
dsc_instancename
namevar
Data type: String
The name of the SQL Server instance to be configured.
dsc_name
namevar
Data type: String
The name of the SQL Server Agent alert.
dsc_psdscrunascredential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
name
namevar
Data type: String
Description of the purpose for this resource declaration.
dsc_sqlagentfailsafe
The DSC SqlAgentFailsafe resource type. Automatically generated from version 15.0.0
Properties
The following properties are available in the dsc_sqlagentfailsafe
type.
dsc_ensure
Data type: Optional[Enum['Present', 'Absent']]
Specifies if the SQL Server Agent failsafe operator should be present or absent. Default value is 'Present'
.
dsc_name
Data type: String
The name of the SQL Server Agent failsafe operator.
dsc_notificationmethod
Data type: Optional[Enum['None', 'NotifyEmail', 'Pager', 'NetSend', 'NotifyAll']]
The method of notification for the failsafe operator. The default value is 'None'
.
dsc_servername
Data type: Optional[String]
The host name of the SQL Server to be configured. Default value is $env:COMPUTERNAME
.
Parameters
The following parameters are available in the dsc_sqlagentfailsafe
type.
dsc_instancename
namevar
Data type: String
The name of the SQL Server instance to be configured.
dsc_psdscrunascredential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
name
namevar
Data type: String
Description of the purpose for this resource declaration.
dsc_sqlagentoperator
The DSC SqlAgentOperator resource type. Automatically generated from version 15.0.0
Properties
The following properties are available in the dsc_sqlagentoperator
type.
dsc_emailaddress
Data type: Optional[String]
The email address to be used for the SQL Server Agent operator.
dsc_ensure
Data type: Optional[Enum['Present', 'Absent']]
Specifies if the SQL Server Agent operator should be present or absent. Default value is 'Present'
.
dsc_servername
Data type: Optional[String]
The host name of the SQL Server to be configured. Default value is $env:COMPUTERNAME
.
Parameters
The following parameters are available in the dsc_sqlagentoperator
type.
dsc_instancename
namevar
Data type: String
The name of the SQL Server instance to be configured.
dsc_name
namevar
Data type: String
The name of the SQL Server Agent operator.
dsc_psdscrunascredential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
name
namevar
Data type: String
Description of the purpose for this resource declaration.
dsc_sqlaglistener
The DSC SqlAGListener resource type. Automatically generated from version 15.0.0
Properties
The following properties are available in the dsc_sqlaglistener
type.
dsc_dhcp
Data type: Optional[Boolean]
If DHCP should be used for the availability group listener instead of static IP address.
dsc_ensure
Data type: Optional[Enum['Present', 'Absent']]
If the availability group listener should be present or absent. Default value is 'Present'
.
dsc_ipaddress
Data type: Optional[Array[String]]
The IP address used for the availability group listener, in the format '192.168.10.45/255.255.252.0'
. If using DHCP, set to the first IP-address of the DHCP subnet, in the format '192.168.8.1/255.255.252.0'
. Must be valid in the cluster-allowed IP range.
dsc_name
Data type: String
The name of the availability group listener, max 15 characters. This name will be used as the Virtual Computer Object (VCO).
dsc_port
Data type: Optional[Integer[0, 65535]]
The port used for the availability group listener.
dsc_servername
Data type: String
The host name or fully qualified domain name (FQDN) of the primary replica.
Parameters
The following parameters are available in the dsc_sqlaglistener
type.
dsc_availabilitygroup
namevar
Data type: String
The name of the availability group to which the availability group listener is or will be connected.
dsc_instancename
namevar
Data type: String
The SQL Server instance name of the primary replica.
dsc_psdscrunascredential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
name
namevar
Data type: String
Description of the purpose for this resource declaration.
dsc_sqlagreplica
The DSC SqlAGReplica resource type. Automatically generated from version 15.0.0
Properties
The following properties are available in the dsc_sqlagreplica
type.
dsc_availabilitymode
Data type: Optional[Enum['AsynchronousCommit', 'SynchronousCommit']]
Specifies the replica availability mode. When creating a replica the default is 'AsynchronousCommit'
.
dsc_backuppriority
Data type: Optional[Integer[0, 4294967295]]
Specifies the desired priority of the replicas in performing backups. The acceptable values for this parameter are: integers from 0
through 100
. Of the set of replicas which are online and available, the replica that has the highest priority performs the backup. When creating a replica the default is 50
.
dsc_connectionmodeinprimaryrole
Data type: Optional[Enum['AllowAllConnections', 'AllowReadWriteConnections']]
Specifies how the availability replica handles connections when in the primary role.
dsc_connectionmodeinsecondaryrole
Data type: Optional[Enum['AllowNoConnections', 'AllowReadIntentConnectionsOnly', 'AllowAllConnections']]
Specifies how the availability replica handles connections when in the secondary role.
dsc_endpointhostname
Data type: Optional[String]
Specifies the hostname or IP address of the availability group replica endpoint. When creating a group the default is the instance network name which is set in the code because the value can only be determined when connected to the SQL Server instance.
dsc_endpointport
Data type: Optional[Integer[0, 65535]]
Returns the network port the endpoint is listening on.
dsc_endpointurl
Data type: Optional[String]
Returns the URL of the availability group replica endpoint.
dsc_ensure
Data type: Optional[Enum['Present', 'Absent']]
Specifies if the availability group replica should be present or absent. Default value is 'Present'
.
dsc_failovermode
Data type: Optional[Enum['Automatic', 'Manual']]
Specifies the failover mode. When creating a replica the default value is 'Manual'
.
dsc_isactivenode
Data type: Optional[Boolean]
Returns if the current node is actively hosting the SQL Server Database Engine instance.
dsc_primaryreplicainstancename
Data type: Optional[String]
Name of the SQL Server Database Engine instance where the primary replica lives.
dsc_primaryreplicaservername
Data type: Optional[String]
Hostname of the SQL Server where the primary replica is expected to be active. If the primary replica is not found here, the resource will attempt to find the host that holds the primary replica and connect to it.
dsc_processonlyonactivenode
Data type: Optional[Boolean]
Specifies that the resource will only determine if a change is needed if the target node is the active host of the SQL Server instance.
dsc_readonlyroutingconnectionurl
Data type: Optional[String]
Specifies the fully qualified domain name (FQDN) and port to use when routing to the replica for read only connections.
dsc_readonlyroutinglist
Data type: Optional[Array[String]]
Specifies an ordered list of replica server names that represent the probe sequence for connection director to use when redirecting read-only connections through this availability replica. This parameter applies if the availability replica is the current primary replica of the availability group.
dsc_servername
Data type: String
Hostname of the SQL Server to be configured.
Parameters
The following parameters are available in the dsc_sqlagreplica
type.
dsc_availabilitygroupname
namevar
Data type: String
The name of the availability group.
dsc_instancename
namevar
Data type: String
Name of the SQL Server instance to be configured.
dsc_name
namevar
Data type: String
The name of the availability group replica. For named instances this must be in the following format
'ServerName\InstanceName'
.
dsc_psdscrunascredential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
name
namevar
Data type: String
Description of the purpose for this resource declaration.
dsc_sqlalias
The DSC SqlAlias resource type. Automatically generated from version 15.0.0
Properties
The following properties are available in the dsc_sqlalias
type.
dsc_ensure
Data type: Optional[Enum['Present', 'Absent']]
Determines whether the alias should be added ('Present'
) or removed ('Absent'
). Default value is 'Present'
.
dsc_pipename
Data type: Optional[String]
Returns the Named Pipes path if Protocol is set to 'NP'
.
dsc_protocol
Data type: Optional[Enum['TCP', 'NP']]
Protocol to use when connecting. Valid values are 'TCP'
(TCP/IP) or 'NP'
(Named Pipes). Default value is 'TCP'
.
dsc_servername
Data type: Optional[String]
The SQL Server you are aliasing. This should be set to the NetBIOS name or fully qualified domain name (FQDN).
dsc_tcpport
Data type: Optional[Integer[0, 65535]]
The TCP port the SQL Server instance is listening on. Only used when Protocol is set to 'TCP'
. Default value is port 1433
.
dsc_usedynamictcpport
Data type: Optional[Boolean]
Specifies that the Net-Library will determine the port dynamically. The port number specified in Port will be ignored. Default value is $false
.
Parameters
The following parameters are available in the dsc_sqlalias
type.
dsc_name
namevar
Data type: String
The name of Alias (e.g. 'svr01\inst01'
).
dsc_psdscrunascredential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
name
namevar
Data type: String
Description of the purpose for this resource declaration.
dsc_sqlalwaysonservice
The DSC SqlAlwaysOnService resource type. Automatically generated from version 15.0.0
Properties
The following properties are available in the dsc_sqlalwaysonservice
type.
dsc_ensure
Data type: Enum['Present', 'Absent']
An enumerated value that describes if the SQL Server should have Always On High Availability and Disaster Recovery (HADR) property enabled ('Present'
) or disabled ('Absent'
).
dsc_ishadrenabled
Data type: Optional[Boolean]
Returns the status of AlwaysOn High Availability and Disaster Recovery (HADR).
dsc_restarttimeout
Data type: Optional[Integer[0, 4294967295]]
The length of time, in seconds, to wait for the service to restart. Default value is 120
seconds.
dsc_servername
Data type: Optional[String]
The hostname of the SQL Server to be configured. Default value is $env:COMPUTERNAME
.
Parameters
The following parameters are available in the dsc_sqlalwaysonservice
type.
dsc_instancename
namevar
Data type: String
The name of the SQL Server instance to be configured.
dsc_psdscrunascredential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
name
namevar
Data type: String
Description of the purpose for this resource declaration.
dsc_sqlconfiguration
The DSC SqlConfiguration resource type. Automatically generated from version 15.0.0
Properties
The following properties are available in the dsc_sqlconfiguration
type.
dsc_optionvalue
Data type: Integer[-2147483648, 2147483647]
The desired value of the configuration option.
dsc_restartservice
Data type: Optional[Boolean]
Determines whether the instance should be restarted after updating the configuration option.
dsc_restarttimeout
Data type: Optional[Integer[0, 4294967295]]
The length of time, in seconds, to wait for the service to restart. Default is 120
seconds.
dsc_servername
Data type: Optional[String]
The hostname of the SQL Server to be configured. Default value is $env:COMPUTERNAME
.
Parameters
The following parameters are available in the dsc_sqlconfiguration
type.
dsc_instancename
namevar
Data type: String
Name of the SQL Server instance to be configured.
dsc_optionname
namevar
Data type: String
The name of the SQL Server Database Engine instance configuration option. For all possible values reference the
article Server Configuration Options (SQL
Server)
or run sp_configure
.
dsc_psdscrunascredential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
name
namevar
Data type: String
Description of the purpose for this resource declaration.
dsc_sqldatabase
The DSC SqlDatabase resource type. Automatically generated from version 15.0.0
Properties
The following properties are available in the dsc_sqldatabase
type.
dsc_collation
Data type: Optional[String]
The name of the collation to use for the new database. Default value is the collation used by the server.
dsc_compatibilitylevel
Data type: Optional[Enum['Version80', 'Version90', 'Version100', 'Version110', 'Version120', 'Version130', 'Version140', 'Version150']]
Specifies the version of the SQL Database Compatibility Level to use for the specified database.
dsc_ensure
Data type: Optional[Enum['Present', 'Absent']]
When set to 'Present'
, the database will be created. When set to 'Absent'
, the database will be dropped. Default value is 'Present'
.
dsc_ownername
Data type: Optional[String]
Specifies the name of the login that should be the owner of the database.
dsc_recoverymodel
Data type: Optional[Enum['Simple', 'Full', 'BulkLogged']]
The recovery model for the specified database.
dsc_servername
Data type: Optional[String]
The host name of the SQL Server to be configured. Default value is $env:COMPUTERNAME
.
Parameters
The following parameters are available in the dsc_sqldatabase
type.
dsc_instancename
namevar
Data type: String
The name of the SQL Server instance to be configured.
dsc_name
namevar
Data type: String
The name of the SQL Server database.
dsc_psdscrunascredential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
name
namevar
Data type: String
Description of the purpose for this resource declaration.
dsc_sqldatabasedefaultlocation
The DSC SqlDatabaseDefaultLocation resource type. Automatically generated from version 15.0.0
Properties
The following properties are available in the dsc_sqldatabasedefaultlocation
type.
dsc_isactivenode
Data type: Optional[Boolean]
Returns if the current node is actively hosting the SQL Server instance.
dsc_path
Data type: String
The path to the default directory to be set for the type specified in the parameter Type.
dsc_processonlyonactivenode
Data type: Optional[Boolean]
Specifies that the resource will only determine if a change is needed if the target node is the active host of the SQL Server instance.
dsc_restartservice
Data type: Optional[Boolean]
If set to $true
then SQL Server and dependent services will be restarted if a change to the configuration is made. The default value is $false
.
dsc_servername
Data type: Optional[String]
The host name of the SQL Server to be configured. Default value is $env:COMPUTERNAME
.
Parameters
The following parameters are available in the dsc_sqldatabasedefaultlocation
type.
dsc_instancename
namevar
Data type: String
The name of the SQL Server instance to be configured.
dsc_psdscrunascredential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
dsc_type
namevar
Data type: Enum['Data', 'Log', 'Backup']
The type of database default location to be configured.
name
namevar
Data type: String
Description of the purpose for this resource declaration.
dsc_sqldatabasemail
The DSC SqlDatabaseMail resource type. Automatically generated from version 15.0.0
Properties
The following properties are available in the dsc_sqldatabasemail
type.
dsc_description
Data type: Optional[String]
The description for the Database Mail profile and account.
dsc_displayname
Data type: Optional[String]
The display name of the originating email address. Default value is the same value assigned to the parameter EmailAddress.
dsc_emailaddress
Data type: String
The e-mail address from which mail will originate.
dsc_ensure
Data type: Optional[Enum['Present', 'Absent']]
Specifies the desired state of the Database Mail account. When set to 'Present'
the Database Mail account will be created. When set to 'Absent'
the Database Mail account will be removed. Default value is 'Present'
.
dsc_logginglevel
Data type: Optional[Enum['Normal', 'Extended', 'Verbose']]
The logging level that the Database Mail will use. If not specified the default logging level is 'Extended'
.
dsc_mailservername
Data type: String
The fully qualified domain name (FQDN) of the mail server name to which e-mail are sent.
dsc_profilename
Data type: String
The name of the Database Mail profile.
dsc_replytoaddress
Data type: Optional[String]
The e-mail address to which the receiver of e-mails will reply to. Default value is the same e-mail address assigned to parameter EmailAddress.
dsc_servername
Data type: Optional[String]
The hostname of the SQL Server to be configured. Default value is $env:COMPUTERNAME
.
dsc_tcpport
Data type: Optional[Integer[0, 65535]]
The TCP port used for communication. Default value is port 25
.
Parameters
The following parameters are available in the dsc_sqldatabasemail
type.
dsc_accountname
namevar
Data type: String
The name of the Database Mail account.
dsc_instancename
namevar
Data type: String
The name of the SQL Server instance to be configured.
dsc_psdscrunascredential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
name
namevar
Data type: String
Description of the purpose for this resource declaration.
dsc_sqldatabaseobjectpermission
The DSC SqlDatabaseObjectPermission resource type. Automatically generated from version 15.0.0
Properties
The following properties are available in the dsc_sqldatabaseobjectpermission
type.
dsc_permission
Data type: Array[Struct[{ permission => Array[String], ensure => Optional[Enum['Present', 'Absent']], state => Optional[Enum['Grant', 'Deny', 'GrantWithGrant']] }]]
Specifies the permissions for the database object and the principal. The permissions is an array of embedded instances of the DSC_DatabaseObjectPermission
CIM class.
dsc_servername
Data type: Optional[String]
Specifies the host name of the SQL Server to be configured. Default value is $env:COMPUTERNAME
.
Parameters
The following parameters are available in the dsc_sqldatabaseobjectpermission
type.
dsc_databasename
namevar
Data type: String
Specifies the name of the database where the object resides.
dsc_force
Data type: Optional[Boolean]
Specifies that permissions that has parameter Ensure set to 'Present'
(the default value for permissions) should
always be enforced even if that encompasses cascading revocations. An example if the desired state is 'Grant'
but the
current state is 'GrantWithGrant'
. If parameter Force is set to $true
the With Grant permission is revoked, if
set to $false
an exception is thrown since the desired state could not be set. Default is to throw an exception.
dsc_instancename
namevar
Data type: String
Specifies the name of the SQL Server instance to be configured.
dsc_name
namevar
Data type: String
Specifies the name of the database user, user-defined database role, or database application role that will have the permission.
dsc_objectname
namevar
Data type: String
Specifies the name of the database object to set permission for. Can be an empty value when setting permission for a schema.
dsc_objecttype
namevar
Data type: Enum['Schema', 'Table', 'View', 'StoredProcedure']
Specifies the type of the database object specified in parameter ObjectName.
dsc_psdscrunascredential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
dsc_schemaname
namevar
Data type: String
Specifies the name of the schema for the database object.
name
namevar
Data type: String
Description of the purpose for this resource declaration.
dsc_sqldatabaseowner
The DSC SqlDatabaseOwner resource type. Automatically generated from version 15.0.0
Properties
The following properties are available in the dsc_sqldatabaseowner
type.
dsc_name
Data type: String
The name of the login that will become a owner of the desired sql database.
dsc_servername
Data type: Optional[String]
The host name of the SQL Server to be configured.
Parameters
The following parameters are available in the dsc_sqldatabaseowner
type.
dsc_databasename
namevar
Data type: String
The name of database to be configured.
dsc_instancename
namevar
Data type: String
The name of the SQL instance to be configured.
dsc_psdscrunascredential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
name
namevar
Data type: String
Description of the purpose for this resource declaration.
dsc_sqldatabasepermission
The DSC SqlDatabasePermission resource type. Automatically generated from version 15.0.0
Properties
The following properties are available in the dsc_sqldatabasepermission
type.
dsc_ensure
Data type: Optional[Enum['Present', 'Absent']]
If the permission should be granted ('Present'
) or revoked ('Absent'
).
dsc_permissions
Data type: Array[String]
The permissions to be granted or denied for the user in the database.
dsc_servername
Data type: Optional[String]
The host name of the SQL Server to be configured. Default value is $env:COMPUTERNAME
.
Parameters
The following parameters are available in the dsc_sqldatabasepermission
type.
dsc_databasename
namevar
Data type: String
The name of the database.
dsc_instancename
namevar
Data type: String
The name of the SQL Server instance to be configured. Default value is 'MSSQLSERVER'
.
dsc_name
namevar
Data type: String
The name of the user that should be granted or denied the permission.
dsc_permissionstate
namevar
Data type: Enum['Grant', 'Deny', 'GrantWithGrant']
The state of the permission.
dsc_psdscrunascredential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
name
namevar
Data type: String
Description of the purpose for this resource declaration.
dsc_sqldatabaserecoverymodel
The DSC SqlDatabaseRecoveryModel resource type. Automatically generated from version 15.0.0
Properties
The following properties are available in the dsc_sqldatabaserecoverymodel
type.
dsc_recoverymodel
Data type: Enum['Full', 'Simple', 'BulkLogged']
The recovery model to use for the database.
dsc_servername
Data type: Optional[String]
The host name of the SQL Server to be configured. Default value is $env:COMPUTERNAME.
Parameters
The following parameters are available in the dsc_sqldatabaserecoverymodel
type.
dsc_instancename
namevar
Data type: String
The name of the SQL instance to be configured.
dsc_name
namevar
Data type: String
The SQL database name
dsc_psdscrunascredential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
name
namevar
Data type: String
Description of the purpose for this resource declaration.
dsc_sqldatabaserole
The DSC SqlDatabaseRole resource type. Automatically generated from version 15.0.0
Properties
The following properties are available in the dsc_sqldatabaserole
type.
dsc_ensure
Data type: Optional[Enum['Present', 'Absent']]
If 'Present'
then the role will be added to the database and the role membership will be set. If 'Absent'
then the role will be removed from the database. Default value is 'Present'
.
dsc_members
Data type: Optional[Array[String]]
The members the database role should have. This parameter will replace all the current database role members with the specified members. Will only be used when parameter Ensure is set to 'Present'
.
dsc_membersindesiredstate
Data type: Optional[Boolean]
Returns whether the database role members are in the desired state.
dsc_memberstoexclude
Data type: Optional[Array[String]]
The members the database role should exclude. This parameter will only remove members from a database role. Will only be used when parameter Ensure is set to 'Present'
. Can not be used at the same time as parameter Members.
dsc_memberstoinclude
Data type: Optional[Array[String]]
The members the database role should include. This parameter will only add members to a database role. Will only be used when parameter Ensure is set to 'Present'
. Can not be used at the same time as parameter Members.
dsc_servername
Data type: Optional[String]
The host name of the SQL Server to be configured. Default value is $env:COMPUTERNAME
.
Parameters
The following parameters are available in the dsc_sqldatabaserole
type.
dsc_databasename
namevar
Data type: String
The name of the database in which the role should be configured.
dsc_instancename
namevar
Data type: String
The name of the SQL Server instance to be configured.
dsc_name
namevar
Data type: String
The name of the database role to be added or removed.
dsc_psdscrunascredential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
name
namevar
Data type: String
Description of the purpose for this resource declaration.
dsc_sqldatabaseuser
The DSC SqlDatabaseUser resource type. Automatically generated from version 15.0.0
Properties
The following properties are available in the dsc_sqldatabaseuser
type.
dsc_asymmetrickeyname
Data type: Optional[String]
Specifies the name of the asymmetric key to associate with the database user. This must be specified if parameter UserType is set to 'AsymmetricKey'
.
dsc_authenticationtype
Data type: Optional[String]
Returns the authentication type of the login connected to the database user. This will return either 'Windows'
, 'Instance'
, or 'None'
. The value 'Windows'
means the login is using Windows Authentication, 'Instance'
means that the login is using SQL Authentication, and 'None'
means that the database user have no login connected to it.
dsc_certificatename
Data type: Optional[String]
Specifies the name of the certificate to associate with the database user. This must be specified if parameter UserType is set to 'Certificate'
.
dsc_ensure
Data type: Optional[Enum['Present', 'Absent']]
Specifies if the database user should be present or absent. If 'Present'
then the database user will be added to the database and, if needed, the login mapping will be updated. If 'Absent'
then the database user will be removed from the database. Default value is 'Present'
.
dsc_loginname
Data type: Optional[String]
Specifies the name of the login to associate with the database user. This must be specified if parameter UserType is set to 'Login'
.
dsc_logintype
Data type: Optional[String]
Returns the login type of the login connected to the database user. If no login is connected to the database user this returns $null
.
dsc_servername
Data type: Optional[String]
Specifies the host name of the SQL Server on which the instance exist. Default value is $env:COMPUTERNAME
.
dsc_usertype
Data type: Optional[Enum['Login', 'NoLogin', 'Certificate', 'AsymmetricKey']]
Specifies the type of the database user. Default value is 'NoLogin'
.
Parameters
The following parameters are available in the dsc_sqldatabaseuser
type.
dsc_databasename
namevar
Data type: String
Specifies the name of the database in which to configure the database user.
dsc_force
Data type: Optional[Boolean]
Specifies if it is allowed to re-create the database user if either the user type, the asymmetric key, or the
certificate changes. Default value is $false
not allowing database users to be re-created.
dsc_instancename
namevar
Data type: String
Specifies the SQL Server instance in which the database exist.
dsc_name
namevar
Data type: String
Specifies the name of the database user to be added or removed.
dsc_psdscrunascredential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
name
namevar
Data type: String
Description of the purpose for this resource declaration.
dsc_sqlendpoint
The DSC SqlEndpoint resource type. Automatically generated from version 15.0.0
Properties
The following properties are available in the dsc_sqlendpoint
type.
dsc_endpointtype
Data type: Enum['DatabaseMirroring', 'ServiceBroker']
Specifies the type of endpoint. Currently the only types that are supported are the Database Mirroring and the Service Broker type.
dsc_ensure
Data type: Optional[Enum['Present', 'Absent']]
If the endpoint should be present or absent. Default values is 'Present'
.
dsc_ipaddress
Data type: Optional[String]
The network IP address the endpoint is listening on. Default value is '0.0.0.0'
which means listen on any valid IP address. The default value is only used during endpoint creation, it is not enforce.
dsc_ismessageforwardingenabled
Data type: Optional[Boolean]
Specifies whether messages received by this endpoint that are for services located elsewhere will be forwarded.
dsc_messageforwardingsize
Data type: Optional[Integer[0, 4294967295]]
Specifies the maximum amount of storage in megabytes to allocate for the endpoint to use when storing messages that are to be forwarded.
dsc_owner
Data type: Optional[String]
The owner of the endpoint. Default is the login used for the creation.
dsc_port
Data type: Optional[Integer[0, 65535]]
The network port the endpoint is listening on. Default value is 5022
, but default value is only used during endpoint creation, it is not enforce.
dsc_servername
Data type: Optional[String]
The host name of the SQL Server to be configured. Default value is $env:COMPUTERNAME
.
dsc_state
Data type: Optional[Enum['Started', 'Stopped', 'Disabled']]
Specifies the state of the endpoint. When an endpoint is created and the state is not specified then the endpoint will be started after it is created. The state will not be enforced unless the parameter is specified.
Parameters
The following parameters are available in the dsc_sqlendpoint
type.
dsc_endpointname
namevar
Data type: String
The name of the endpoint.
dsc_instancename
namevar
Data type: String
The name of the SQL Server instance to be configured.
dsc_psdscrunascredential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
name
namevar
Data type: String
Description of the purpose for this resource declaration.
dsc_sqlendpointpermission
The DSC SqlEndpointPermission resource type. Automatically generated from version 15.0.0
Properties
The following properties are available in the dsc_sqlendpointpermission
type.
dsc_ensure
Data type: Optional[Enum['Present', 'Absent']]
If the permission should be present or absent. Default value is 'Present'
.
dsc_name
Data type: String
The name of the endpoint.
dsc_permission
Data type: Optional[Enum['CONNECT']]
The permission to set for the login. Valid value for permission is only 'CONNECT'
.
dsc_servername
Data type: Optional[String]
The host name of the SQL Server to be configured. Default value is $env:COMPUTERNAME
.
Parameters
The following parameters are available in the dsc_sqlendpointpermission
type.
dsc_instancename
namevar
Data type: String
The name of the SQL Server instance to be configured.
dsc_principal
namevar
Data type: String
The login to which permission will be set.
dsc_psdscrunascredential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
name
namevar
Data type: String
Description of the purpose for this resource declaration.
dsc_sqllogin
The DSC SqlLogin resource type. Automatically generated from version 15.0.0
Properties
The following properties are available in the dsc_sqllogin
type.
dsc_defaultdatabase
Data type: Optional[String]
Specifies the default database name.
dsc_disabled
Data type: Optional[Boolean]
Specifies if the login is disabled. Default value is $false
.
dsc_ensure
Data type: Optional[Enum['Present', 'Absent']]
The specified login should be 'Present'
or 'Absent'
. Default is 'Present'
.
dsc_loginmustchangepassword
Data type: Optional[Boolean]
Specifies if the login is required to have its password change on the next login. Only applies to SQL Logins. Default value is $true
.
dsc_loginpasswordexpirationenabled
Data type: Optional[Boolean]
Specifies if the login password is required to expire in accordance to the operating system security policy. Only applies to SQL Logins. Default value is $true
.
dsc_loginpasswordpolicyenforced
Data type: Optional[Boolean]
Specifies if the login password is required to conform to the password policy specified in the system security policy. Only applies to SQL Logins. Default value is $true
.
dsc_logintype
Data type: Optional[Enum['WindowsUser', 'WindowsGroup', 'SqlLogin', 'Certificate', 'AsymmetricKey', 'ExternalUser', 'ExternalGroup']]
The type of login to be created. If LoginType is 'WindowsUser'
or 'WindowsGroup'
then provide the name in the format DOMAIN\name
. Default is 'WindowsUser'
. The login types 'Certificate'
, 'AsymmetricKey'
, 'ExternalUser'
, and 'ExternalGroup'
are not yet implemented and will currently throw an exception if used.
dsc_servername
Data type: Optional[String]
The hostname of the SQL Server to be configured. Default value is $env:COMPUTERNAME
.
Parameters
The following parameters are available in the dsc_sqllogin
type.
dsc_instancename
namevar
Data type: String
Name of the SQL Server instance to be configured.
dsc_logincredential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
Specifies the password as a [PSCredential]
object. Only applies to SQL Logins.
dsc_name
namevar
Data type: String
The name of the login.
dsc_psdscrunascredential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
name
namevar
Data type: String
Description of the purpose for this resource declaration.
dsc_sqlmaxdop
The DSC SqlMaxDop resource type. Automatically generated from version 15.0.0
Properties
The following properties are available in the dsc_sqlmaxdop
type.
dsc_dynamicalloc
Data type: Optional[Boolean]
If set to $true
then max degree of parallelism will be dynamically configured. When this is set parameter is set to $true
, the parameter MaxDop must be set to $null
or not be configured.
dsc_ensure
Data type: Optional[Enum['Present', 'Absent']]
When set to 'Present'
then max degree of parallelism will be set to either the value in parameter MaxDop or dynamically configured when parameter DynamicAlloc is set to $true
. When set to 'Absent'
max degree of parallelism will be set to 0
which means no limit in number of processors used in parallel plan execution.
dsc_isactivenode
Data type: Optional[Boolean]
Determines if the current node is actively hosting the SQL Server instance.
dsc_maxdop
Data type: Optional[Integer[-2147483648, 2147483647]]
A numeric value to limit the number of processors used in parallel plan execution.
dsc_processonlyonactivenode
Data type: Optional[Boolean]
Specifies that the resource will only determine if a change is needed if the target node is the active host of the SQL Server instance.
dsc_servername
Data type: Optional[String]
The host name of the SQL Server to be configured. Default value is $env:COMPUTERNAME
.
Parameters
The following parameters are available in the dsc_sqlmaxdop
type.
dsc_instancename
namevar
Data type: String
The name of the SQL instance to be configured.
dsc_psdscrunascredential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
name
namevar
Data type: String
Description of the purpose for this resource declaration.
dsc_sqlmemory
The DSC SqlMemory resource type. Automatically generated from version 15.0.0
Properties
The following properties are available in the dsc_sqlmemory
type.
dsc_dynamicalloc
Data type: Optional[Boolean]
If set to $true
then max memory will be dynamically configured. When this parameter is set to $true
, the parameter MaxMemory must be set to $null
or not be configured. Default value is $false
.
dsc_ensure
Data type: Optional[Enum['Present', 'Absent']]
When set to 'Present'
then min and max memory will be set to either the value in parameter MinMemory and MaxMemory, or dynamically configured when parameter DynamicAlloc is set to $true
. When set to 'Absent'
min and max memory will be set to its default values. Default value is 'Present'
.
dsc_isactivenode
Data type: Optional[Boolean]
Returns if the current node is actively hosting the SQL Server instance.
dsc_maxmemory
Data type: Optional[Integer[-2147483648, 2147483647]]
Maximum amount of memory, in MB, in the buffer pool used by the instance of SQL Server.
dsc_minmemory
Data type: Optional[Integer[-2147483648, 2147483647]]
Minimum amount of memory, in MB, in the buffer pool used by the instance of SQL Server.
dsc_processonlyonactivenode
Data type: Optional[Boolean]
Specifies that the resource will only determine if a change is needed if the target node is the active host of the SQL Server instance.
dsc_servername
Data type: Optional[String]
The host name of the SQL Server to be configured. Default value is $env:COMPUTERNAME
.
Parameters
The following parameters are available in the dsc_sqlmemory
type.
dsc_instancename
namevar
Data type: String
The name of the SQL Server instance to be configured.
dsc_psdscrunascredential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
name
namevar
Data type: String
Description of the purpose for this resource declaration.
dsc_sqlpermission
The DSC SqlPermission resource type. Automatically generated from version 15.0.0
Properties
The following properties are available in the dsc_sqlpermission
type.
dsc_ensure
Data type: Optional[Enum['Present', 'Absent']]
If the permission should be present or absent. Default value is 'Present'
.
dsc_permission
Data type: Optional[Array[Enum['ConnectSql', 'AlterAnyAvailabilityGroup', 'ViewServerState', 'AlterAnyEndPoint']]]
The permission to set for the login.
dsc_servername
Data type: Optional[String]
The host name of the SQL Server to be configured. Default value is $env:COMPUTERNAME
.
Parameters
The following parameters are available in the dsc_sqlpermission
type.
dsc_instancename
namevar
Data type: String
The name of the SQL Server instance to be configured.
dsc_principal
namevar
Data type: String
The login to which permission will be set.
dsc_psdscrunascredential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
name
namevar
Data type: String
Description of the purpose for this resource declaration.
dsc_sqlprotocol
The DSC SqlProtocol resource type. Automatically generated from version 15.0.0
Properties
The following properties are available in the dsc_sqlprotocol
type.
dsc_enabled
Data type: Optional[Boolean]
Specifies if the protocol should be enabled or disabled.
dsc_hasmultiipaddresses
Data type: Optional[Boolean]
Returns $true
or $false
whether the instance has multiple IP addresses or not.
dsc_keepalive
Data type: Optional[Integer[0, 65535]]
Specifies the keep alive duration in milliseconds. Only used for the TCP/IP protocol, ignored for all other protocols.
dsc_listenonallipaddresses
Data type: Optional[Boolean]
Specifies to listen on all IP addresses. Only used for the TCP/IP protocol, ignored for all other protocols.
dsc_pipename
Data type: Optional[String]
Specifies the name of the named pipe. Only used for the Named Pipes protocol, ignored for all other protocols.
dsc_restarttimeout
Data type: Optional[Integer[0, 65535]]
Timeout value for restarting the SQL Server services. The default value is 120
seconds.
dsc_servername
Data type: Optional[String]
Specifies the host name of the SQL Server to be configured. If the SQL Server belongs to a cluster or availability group specify the host name for the listener or cluster group. Default value is $env:COMPUTERNAME.
dsc_suppressrestart
Data type: Optional[Boolean]
If set to $true
then the any attempt by the resource to restart the service is suppressed. The default value is $false
.
Parameters
The following parameters are available in the dsc_sqlprotocol
type.
dsc_instancename
namevar
Data type: String
Specifies the name of the SQL Server instance to enable the protocol for.
dsc_protocolname
namevar
Data type: Enum['SharedMemory', 'NamedPipes', 'TcpIp']
Specifies the name of network protocol to be configured.
dsc_psdscrunascredential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
name
namevar
Data type: String
Description of the purpose for this resource declaration.
dsc_sqlprotocoltcpip
The DSC SqlProtocolTcpIp resource type. Automatically generated from version 15.0.0
Properties
The following properties are available in the dsc_sqlprotocoltcpip
type.
dsc_addressfamily
Data type: Optional[String]
Returns the IP address's adress family. Not applicable for IP address group 'IPAll'
.
dsc_enabled
Data type: Optional[Boolean]
Specified if the IP address group should be enabled or disabled. Only used if the parameter IpAddressGroup is not set to 'IPAll'
. If not specified, the existing value will not be changed.
dsc_ipaddress
Data type: Optional[String]
Specifies the IP address for the IP address group. Only used if the parameter IpAddressGroup is not set to 'IPAll'
. If not specified, the existing value will not be changed.
dsc_isactive
Data type: Optional[Boolean]
Returns $true
or $false
whether the IP address group is active. Not applicable for IP address group 'IPAll'
.
dsc_restarttimeout
Data type: Optional[Integer[0, 65535]]
Timeout value for restarting the SQL Server services. The default value is 120
seconds.
dsc_servername
Data type: Optional[String]
Specifies the host name of the SQL Server to be configured. If the SQL Server belongs to a cluster or availability group specify the host name for the listener or cluster group. Default value is $env:COMPUTERNAME
.
dsc_suppressrestart
Data type: Optional[Boolean]
If set to $true
then the any attempt by the resource to restart the service is suppressed. The default value is $false
.
dsc_tcpdynamicport
Data type: Optional[String]
Returns the TCP/IP dynamic port. Only applicable for the IP address group 'IPAll'
.
dsc_tcpport
Data type: Optional[String]
Specifies the TCP port(s) that SQL Server instance should be listening on. If the IP address should listen on more than one port, list all ports as a string value with the port numbers separated with a comma, e.g. '1433,1500,1501'
. This parameter is limited to 2047 characters. If not specified, the existing value will not be changed. This parameter is not allowed to be used at the same time as the parameter UseTcpDynamicPort.
dsc_usetcpdynamicport
Data type: Optional[Boolean]
Specifies whether the SQL Server instance should use a dynamic port. If not specified, the existing value will not be changed. This parameter is not allowed to be used at the same time as the parameter TcpPort.
Parameters
The following parameters are available in the dsc_sqlprotocoltcpip
type.
dsc_instancename
namevar
Data type: String
Specifies the name of the SQL Server instance to manage the IP address group for.
dsc_ipaddressgroup
namevar
Data type: String
Specifies the name of the IP address group in the TCP/IP protocol, e.g. 'IP1'
, 'IP2'
etc., or 'IPAll'
.
dsc_psdscrunascredential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
name
namevar
Data type: String
Description of the purpose for this resource declaration.
dsc_sqlreplication
The DSC SqlReplication resource type. Automatically generated from version 15.0.0
Properties
The following properties are available in the dsc_sqlreplication
type.
dsc_distributiondbname
Data type: Optional[String]
Distribution database name. If the parameter DistributionMode is set to 'Local'
this will be created, if 'Remote'
needs to match distribution database on remote distributor. Default value is 'distributor'
.
dsc_distributormode
Data type: Enum['Local', 'Remote']
'Local'
- Instance will be configured as it's own distributor. 'Remote'
- Instance will be configure with remote distributor (remote distributor needs to be already configured for distribution).
dsc_ensure
Data type: Optional[Enum['Present', 'Absent']]
'Present'
will configure replication, 'Absent'
will disable (remove) replication. Default value is 'Present'
.
dsc_remotedistributor
Data type: Optional[String]
Specifies the SQL Server network name that will be used as distributor for local instance. Required if parameter DistributionMode is set to 'Remote'
.
dsc_uninstallwithforce
Data type: Optional[Boolean]
Force flag for uninstall procedure. Default values is `$true´.
dsc_usetrustedconnection
Data type: Optional[Boolean]
Publisher security mode. Default value is $true
.
dsc_workingdirectory
Data type: String
Publisher working directory.
Parameters
The following parameters are available in the dsc_sqlreplication
type.
dsc_adminlinkcredentials
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
AdminLink password to be used when setting up publisher distributor relationship.
dsc_instancename
namevar
Data type: String
Specifies the SQL Server instance name where replication distribution will be configured.
dsc_psdscrunascredential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
name
namevar
Data type: String
Description of the purpose for this resource declaration.
dsc_sqlrole
The DSC SqlRole resource type. Automatically generated from version 15.0.0
Properties
The following properties are available in the dsc_sqlrole
type.
dsc_ensure
Data type: Optional[Enum['Present', 'Absent']]
An enumerated value that describes if the server role is added ('Present'
) or dropped ('Absent'
). Default value is 'Present'
.
dsc_members
Data type: Optional[Array[String]]
The members the server role should have. This parameter will replace all the current server role members with the specified members.
dsc_memberstoexclude
Data type: Optional[Array[String]]
The members the server role should exclude. This parameter will only remove members from a server role. Can only be used when parameter Ensure is set to 'Present'
. Can not be used at the same time as parameter Members.
dsc_memberstoinclude
Data type: Optional[Array[String]]
The members the server role should include. This parameter will only add members to a server role. Can not be used at the same time as parameter Members.
dsc_servername
Data type: Optional[String]
The host name of the SQL Server to be configured. Default value is $env:COMPUTERNAME
.
Parameters
The following parameters are available in the dsc_sqlrole
type.
dsc_instancename
namevar
Data type: String
The name of the SQL Server instance to be configured.
dsc_psdscrunascredential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
dsc_serverrolename
namevar
Data type: String
The name of of SQL Server Database Engine role to add or remove.
name
namevar
Data type: String
Description of the purpose for this resource declaration.
dsc_sqlrs
The DSC SqlRS resource type. Automatically generated from version 15.0.0
Properties
The following properties are available in the dsc_sqlrs
type.
dsc_databaseinstancename
Data type: String
Name of the SQL Server instance to host the Reporting Services database.
dsc_databaseservername
Data type: String
Name of the SQL Server to host the Reporting Services database.
dsc_isinitialized
Data type: Optional[Boolean]
Returns if the Reporting Services instance initialized or not.
dsc_reportserverreservedurl
Data type: Optional[Array[String]]
Report Server URL reservations. Optional. If not specified, 'http://+:80'
URL reservation will be used.
dsc_reportservervirtualdirectory
Data type: Optional[String]
Report Server Web Service virtual directory. Optional.
dsc_reportsreservedurl
Data type: Optional[Array[String]]
Report Manager or Report Web App URL reservations. Optional. If not specified, 'http://+:80'
URL reservation will be used.
dsc_reportsvirtualdirectory
Data type: Optional[String]
Report Manager or Report Web App virtual directory name. Optional.
dsc_suppressrestart
Data type: Optional[Boolean]
Reporting Services need to be restarted after initialization or settings change. If this parameter is set to $true
, Reporting Services will not be restarted, even after initialization.
dsc_usessl
Data type: Optional[Boolean]
If connections to the Reporting Services must use SSL. If this parameter is not assigned a value, the default is that Reporting Services does not use SSL.
Parameters
The following parameters are available in the dsc_sqlrs
type.
dsc_instancename
namevar
Data type: String
Name of the SQL Server Reporting Services instance to be configured.
dsc_psdscrunascredential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
name
namevar
Data type: String
Description of the purpose for this resource declaration.
dsc_sqlrssetup
The DSC SqlRSSetup resource type. Automatically generated from version 15.0.0
Properties
The following properties are available in the dsc_sqlrssetup
type.
dsc_action
Data type: Optional[Enum['Install', 'Uninstall']]
The action to be performed. Default value is 'Install'
which performs either install or upgrade.
dsc_currentversion
Data type: Optional[String]
Returns the current version of the installed Microsoft SQL Server Reporting Service instance.
dsc_edition
Data type: Optional[Enum['Development', 'Evaluation', 'ExpressAdvanced']]
Sets the custom free edition. This parameter is mutually exclusive with the parameter ProductKey.
dsc_editionupgrade
Data type: Optional[Boolean]
Upgrades the edition of the installed product. Requires that either the ProductKey or the Edition parameter is also assigned. By default no edition upgrade is performed.
dsc_errordumpdirectory
Data type: Optional[String]
Returns the path to error dump log files.
dsc_forcerestart
Data type: Optional[Boolean]
Forces a restart after installation is finished. If set to $true
then it will override the parameter SuppressRestart.
dsc_iacceptlicenseterms
Data type: Enum['Yes']
Accept licens terms. This must be set to 'Yes'
.
dsc_installfolder
Data type: Optional[String]
Sets the install folder, e.g. C:\Program Files\SSRS
. Default value is C:\Program Files\Microsoft SQL Server Reporting Services
.
dsc_logpath
Data type: Optional[String]
Specifies the setup log file location, e.g. log.txt
. By default log files are created under %TEMP%
.
dsc_productkey
Data type: Optional[String]
Sets the custom license key, e.g. '12345-12345-12345-12345-12345'
. This parameter is mutually exclusive with the parameter Edition.
dsc_servicename
Data type: Optional[String]
Returns the current name of the Microsoft SQL Server Reporting Service instance Windows service.
dsc_setupprocesstimeout
Data type: Optional[Integer[0, 4294967295]]
The timeout, in seconds, to wait for the setup process to finish. Default value is 7200
seconds (2 hours). If the setup process does not finish before this time an error will be thrown.
dsc_sourcepath
Data type: String
The path to the installation media file to be used for installation, e.g an UNC path to a shared resource. Environment variables can be used in the path.
dsc_suppressrestart
Data type: Optional[Boolean]
Suppresses any attempts to restart.
dsc_versionupgrade
Data type: Optional[Boolean]
Upgrades installed product version if the major product version of the source executable is higher than the currently installed major version. Requires that either the ProductKey or the Edition parameter is also assigned. Default is $false
.
Parameters
The following parameters are available in the dsc_sqlrssetup
type.
dsc_instancename
namevar
Data type: Enum['SSRS']
Name of the Microsoft SQL Server Reporting Service instance to installed. This can only be set to 'SSRS'
.
dsc_psdscrunascredential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
dsc_sourcecredential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
Credentials used to access the path set in the parameter SourcePath.
name
namevar
Data type: String
Description of the purpose for this resource declaration.
dsc_sqlscript
The DSC SqlScript resource type. Automatically generated from version 15.0.0
Properties
The following properties are available in the dsc_sqlscript
type.
dsc_disablevariables
Data type: Optional[Boolean]
Specifies, as a boolean, whether or not PowerShell will ignore Invoke-Sqlcmd
scripting variables that share a format such as $(variable_name)
. For more information how to use this, please go to the help documentation for Invoke-Sqlcmd.
dsc_getresult
Data type: Optional[Array[String]]
Returns the result from the T-SQL script provided in the parameter GetFilePath when Get was called.
dsc_querytimeout
Data type: Optional[Integer[0, 4294967295]]
Specifies, as an integer, the number of seconds after which the T-SQL script execution will time out. In some SQL Server versions there is a bug in Invoke-Sqlcmd
where the normal default value 0
(no timeout) is not respected and the default value is incorrectly set to 30 seconds.
dsc_servername
Data type: Optional[String]
Specifies the host name of the SQL Server to be configured. Default value is $env:COMPUTERNAME
.
dsc_variable
Data type: Optional[Array[String]]
Specifies, as a string array, a scripting variable for use in the T-SQL script, and sets a value for the variable. Use a Windows PowerShell array to specify multiple variables and their values. For more information how to use this, please go to the help documentation for Invoke-Sqlcmd.
Parameters
The following parameters are available in the dsc_sqlscript
type.
dsc_credential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
The credentials to authenticate with, using SQL Server Authentication. To authenticate using Windows Authentication assign the credentials to the built-in parameter PsDscRunAsCredential. If neither of the parameters Credential or PsDscRunAsCredential are assigned, then the SYSTEM account will be used to authenticate using Windows Authentication.
dsc_getfilepath
namevar
Data type: String
Path to the T-SQL file that will perform Get action. Any values returned by the T-SQL queries will also be returned
when calling Get (for example by using the cmdlet Get-DscConfiguration
) through the 'GetResult'
property.
dsc_instancename
namevar
Data type: String
Specifies the name of the SQL Server Database Engine instance. For the default instance specify the value
'MSSQLSERVER'
.
dsc_psdscrunascredential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
dsc_setfilepath
namevar
Data type: String
Path to the T-SQL file that will perform Set action.
dsc_testfilepath
namevar
Data type: String
Path to the T-SQL file that will perform Test action. Any script that does not throw an error or returns NULL
is
evaluated to $true
. The cmdlet Invoke-Sqlcmd
treats T-SQL PRINT
statements as verbose text, and will not cause the
test to return $false
.
name
namevar
Data type: String
Description of the purpose for this resource declaration.
dsc_sqlscriptquery
The DSC SqlScriptQuery resource type. Automatically generated from version 15.0.0
Properties
The following properties are available in the dsc_sqlscriptquery
type.
dsc_disablevariables
Data type: Optional[Boolean]
Specifies, as a boolean, whether or not PowerShell will ignore Invoke-SqlCmd
scripting variables that share a format such as $(variable_name)
. For more information how to use this, please go to the help documentation for Invoke-Sqlcmd.
dsc_getresult
Data type: Optional[Array[String]]
Returns the result from the T-SQL script provided in the parameter GetQuery when Get was called.
dsc_querytimeout
Data type: Optional[Integer[0, 4294967295]]
Specifies, as an integer, the number of seconds after which the T-SQL script execution will time out. In some SQL Server versions there is a bug in Invoke-Sqlcmd
where the normal default value 0
(no timeout) is not respected and the default value is incorrectly set to 30 seconds.
dsc_servername
Data type: Optional[String]
Specifies the host name of the SQL Server to be configured. Default value is $env:COMPUTERNAME
.
dsc_variable
Data type: Optional[Array[String]]
Specifies, as a string array, a scripting variable for use in the sql script, and sets a value for the variable. Use a Windows PowerShell array to specify multiple variables and their values. For more information how to use this, please go to the help documentation for Invoke-Sqlcmd.
Parameters
The following parameters are available in the dsc_sqlscriptquery
type.
dsc_credential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
The credentials to authenticate with, using SQL Server Authentication. To authenticate using Windows Authentication, assign the credentials to the built-in parameter PsDscRunAsCredential. If neither of the parameters Credential and PsDscRunAsCredential are assigned then the SYSTEM account will be used to authenticate using Windows Authentication.
dsc_getquery
namevar
Data type: String
Full T-SQL query that will perform Get action. Any values returned by the T-SQL queries will also be returned when
calling Get (for example by using the cmdlet Get-DscConfiguration
) through the 'GetResult'
property.
dsc_instancename
namevar
Data type: String
Specifies the name of the SQL Server Database Engine instance. For the default instance specify the value
'MSSQLSERVER'
.
dsc_psdscrunascredential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
dsc_setquery
namevar
Data type: String
Full T-SQL query that will perform Set action.
dsc_testquery
namevar
Data type: String
Full T-SQL query that will perform Test action. Any script that does not throw an error or returns NULL
is evaluated
to $true
. The cmdlet Invoke-Sqlcmd
treats T-SQL PRINT
statements as verbose text, and will not cause the test to
return $false
.
name
namevar
Data type: String
Description of the purpose for this resource declaration.
dsc_sqlsecureconnection
The DSC SqlSecureConnection resource type. Automatically generated from version 15.0.0
Properties
The following properties are available in the dsc_sqlsecureconnection
type.
dsc_ensure
Data type: Optional[Enum['Present', 'Absent']]
If encryption should be enabled ('Present'
) or disabled ('Absent'
).
dsc_forceencryption
Data type: Optional[Boolean]
If all connections to the SQL Server instance should be encrypted. If this parameter is not assigned a value, the default value is $true
meaning that all connections must be encrypted.
dsc_serviceaccount
Data type: String
Name of the account running the SQL Server Windows service. If this parameter is set to 'LocalSystem'
then a connection error is displayed, instead use the value 'SYSTEM'
.
dsc_suppressrestart
Data type: Optional[Boolean]
If set to $true
then the required restart will be suppressed. You will need to restart the service before changes will take effect. The default value is $false
.
dsc_thumbprint
Data type: String
Thumbprint of the certificate being used for encryption. If parameter Ensure is set to 'Absent'
then the parameter Certificate can be set to an empty string.
Parameters
The following parameters are available in the dsc_sqlsecureconnection
type.
dsc_instancename
namevar
Data type: String
Name of the SQL Server instance to be configured.
dsc_psdscrunascredential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
name
namevar
Data type: String
Description of the purpose for this resource declaration.
dsc_sqlserverendpointstate
The DSC SqlServerEndpointState resource type. Automatically generated from version 15.0.0
Properties
The following properties are available in the dsc_sqlserverendpointstate
type.
dsc_servername
Data type: Optional[String]
The host name of the SQL Server to be configured. Default value is $env:COMPUTERNAME.
dsc_state
Data type: Optional[Enum['Started', 'Stopped', 'Disabled']]
The state of the endpoint. Valid states are Started, Stopped or Disabled. Default value is 'Started'.
Parameters
The following parameters are available in the dsc_sqlserverendpointstate
type.
dsc_instancename
namevar
Data type: String
The name of the SQL instance to be configured.
dsc_name
namevar
Data type: String
The name of the endpoint.
dsc_psdscrunascredential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
name
namevar
Data type: String
Description of the purpose for this resource declaration.
dsc_sqlservernetwork
The DSC SqlServerNetwork resource type. Automatically generated from version 15.0.0
Properties
The following properties are available in the dsc_sqlservernetwork
type.
dsc_isenabled
Data type: Optional[Boolean]
Enables or disables the network protocol.
dsc_protocolname
Data type: Enum['Tcp']
The name of network protocol to be configured. Only tcp is currently supported.
dsc_restartservice
Data type: Optional[Boolean]
If set to $true then SQL Server and dependent services will be restarted if a change to the configuration is made. The default value is $false.
dsc_restarttimeout
Data type: Optional[Integer[0, 65535]]
Timeout value for restarting the SQL Server services. The default value is 120 seconds.
dsc_servername
Data type: Optional[String]
The host name of the SQL Server to be configured. Default value is $env:COMPUTERNAME.
dsc_tcpdynamicport
Data type: Optional[Boolean]
Specifies whether the SQL Server instance should use a dynamic port. Value cannot be set to 'True' if TcpPort is set to a non-empty string.
dsc_tcpport
Data type: Optional[String]
The TCP port(s) that SQL Server should be listening on. If the IP address should listen on more than one port, list all ports separated with a comma ('1433,1500,1501'). To use this parameter set TcpDynamicPorts to 'False'.
Parameters
The following parameters are available in the dsc_sqlservernetwork
type.
dsc_instancename
namevar
Data type: String
The name of the SQL instance to be configured.
dsc_psdscrunascredential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
name
namevar
Data type: String
Description of the purpose for this resource declaration.
dsc_sqlserviceaccount
The DSC SqlServiceAccount resource type. Automatically generated from version 15.0.0
Properties
The following properties are available in the dsc_sqlserviceaccount
type.
dsc_restartservice
Data type: Optional[Boolean]
Determines whether the service is automatically restarted when a change to the configuration was needed.
dsc_servername
Data type: Optional[String]
The host name of the SQL Server to be configured. Default value is $env:COMPUTERNAME
.
dsc_serviceaccountname
Data type: Optional[String]
Returns the service account username for the service.
dsc_versionnumber
Data type: Optional[String]
The version number for the service type to be managed for the instance that is specified in parameter InstanceName. Mandatory when parameter ServiceType is set to 'IntegrationServices'
.
Parameters
The following parameters are available in the dsc_sqlserviceaccount
type.
dsc_force
Data type: Optional[Boolean]
Forces the service account to be updated. Useful for password changes. This will cause Set to be run on each consecutive run.
dsc_instancename
namevar
Data type: String
The name of the SQL Server instance to be configured.
dsc_psdscrunascredential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
dsc_serviceaccount
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
The service account that should be used when running the Windows service.
dsc_servicetype
namevar
Data type: Enum['DatabaseEngine', 'SQLServerAgent', 'Search', 'IntegrationServices', 'AnalysisServices', 'ReportingServices', 'SQLServerBrowser', 'NotificationServices']
The service type to be managed for the instance that is specified in parameter InstanceName.
name
namevar
Data type: String
Description of the purpose for this resource declaration.
dsc_sqlsetup
The DSC SqlSetup resource type. Automatically generated from version 15.0.0
Properties
The following properties are available in the dsc_sqlsetup
type.
dsc_action
Data type: Optional[Enum['Install', 'Upgrade', 'InstallFailoverCluster', 'AddNode', 'PrepareFailoverCluster', 'CompleteFailoverCluster']]
The action to be performed. Default value is 'Install'
. NOTE: AddNode is not currently functional.
dsc_agtsvcaccountusername
Data type: Optional[String]
Returns the username for the SQL Agent's Windows service.
dsc_agtsvcstartuptype
Data type: Optional[Enum['Automatic', 'Disabled', 'Manual']]
Specifies the startup mode for the SQL Server Agent's Windows service.
dsc_asbackupdir
Data type: Optional[String]
Path for Analysis Services's backup files.
dsc_ascollation
Data type: Optional[String]
Collation for the SQL Server Analysis Services.
dsc_asconfigdir
Data type: Optional[String]
Path for Analysis Services's config files.
dsc_asdatadir
Data type: Optional[String]
Path for Analysis Services's data files.
dsc_aslogdir
Data type: Optional[String]
Path for Analysis Services's log files.
dsc_asservermode
Data type: Optional[Enum['MULTIDIMENSIONAL', 'TABULAR', 'POWERPIVOT']]
The server mode for SQL Server Analysis Services instance. The default is to install in Multidimensional mode. Valid values in a cluster scenario are 'MULTIDIMENSIONAL'
or 'TABULAR'
. Parameter ASServerMode is case-sensitive. All values must be expressed in upper case.
dsc_assvcaccountusername
Data type: Optional[String]
Returns the username for the SQL Server Analysis Services's Windows service.
dsc_assvcstartuptype
Data type: Optional[Enum['Automatic', 'Disabled', 'Manual']]
Specifies the startup mode for the SQL Server Analysis Services's Windows service.
dsc_assysadminaccounts
Data type: Optional[Array[String]]
Array of accounts to be made Analysis Services admins.
dsc_astempdir
Data type: Optional[String]
Path for Analysis Services's temp files.
dsc_browsersvcstartuptype
Data type: Optional[Enum['Automatic', 'Disabled', 'Manual']]
Specifies the startup mode for SQL Server Browser's Windows service.
dsc_errorreporting
Data type: Optional[String]
Enable error reporting.
dsc_failoverclustergroupname
Data type: Optional[String]
The name of the resource group to create for the clustered SQL Server instance. Default is 'SQL Server (InstanceName)'
.
dsc_failoverclusteripaddress
Data type: Optional[Array[String]]
Specifies an array of IP addresses to be assigned to the clustered SQL Server instance. IP addresses must be in dotted-decimal notation, for example '10.0.0.100'
. If no IP address is specified, uses 'DEFAULT'
for this setup parameter.
dsc_failoverclusternetworkname
Data type: Optional[String]
Host name to be assigned to the clustered SQL Server instance.
dsc_featureflag
Data type: Optional[Array[String]]
Feature flags are used to toggle DSC resource functionality on or off. See the DSC resource documentation for what additional functionality exist through a feature flag.
dsc_features
Data type: Optional[String]
SQL Server features to be installed.
dsc_forcereboot
Data type: Optional[Boolean]
Forces reboot.
dsc_ftsvcaccountusername
Data type: Optional[String]
Returns the username for the Full Text' Windows service.
dsc_installshareddir
Data type: Optional[String]
Installation path for shared SQL Server files.
dsc_installsharedwowdir
Data type: Optional[String]
Installation path for x86 shared SQL Server files.
dsc_installsqldatadir
Data type: Optional[String]
Root path for SQL Server database files.
dsc_instancedir
Data type: Optional[String]
Installation path for SQL Server instance files.
dsc_instanceid
Data type: Optional[String]
SQL Server instance ID (if different from parameter InstanceName).
dsc_isclustered
Data type: Optional[Boolean]
Returns a boolean value of $true
if the instance is clustered, otherwise it returns $false
.
dsc_issvcaccountusername
Data type: Optional[String]
Returns the username for the Integration Services's Windows service.
dsc_issvcstartuptype
Data type: Optional[Enum['Automatic', 'Disabled', 'Manual']]
Specifies the startup mode for the SQL Server Integration Services's Windows service.
dsc_npenabled
Data type: Optional[Boolean]
Specifies the state of the Named Pipes protocol for the SQL Server service. The value $true
will enable the Named Pipes protocol and $false
will disabled it.
dsc_productkey
Data type: Optional[String]
Product key for licensed installations.
dsc_rsinstallmode
Data type: Optional[Enum['SharePointFilesOnlyMode', 'DefaultNativeMode', 'FilesOnlyMode']]
Specifies the install mode for SQL Server Report Services service.
dsc_rssvcaccountusername
Data type: Optional[String]
Returns the username for the Reporting Services's Windows service.
dsc_rssvcstartuptype
Data type: Optional[Enum['Automatic', 'Disabled', 'Manual']]
Specifies the startup mode for the SQL Server Reporting Services's Windows service.
dsc_securitymode
Data type: Optional[Enum['SQL', 'Windows']]
Security mode to apply to the SQL Server instance. The value 'SQL'
indicates mixed-mode authentication while the value 'Windows'
indicates Windows Authentication. Default value is 'Windows'
.
dsc_setupprocesstimeout
Data type: Optional[Integer[0, 4294967295]]
The timeout, in seconds, to wait for the setup process to finish. Default value is 7200
seconds (2 hours). If the setup process does not finish before this time, an error will be thrown.
dsc_skiprule
Data type: Optional[Array[String]]
Specifies optional skip rules during setup.
dsc_sourcepath
Data type: Optional[String]
The path to the root of the source files for installation. I.e and UNC path to a shared resource. Environment variables can be used in the path.
dsc_sqlbackupdir
Data type: Optional[String]
Path for SQL Server backup files.
dsc_sqlcollation
Data type: Optional[String]
Collation for SQL Server Database Engine.
dsc_sqlsvcaccountusername
Data type: Optional[String]
Returns the username for the SQL Server's Windows service.
dsc_sqlsvcstartuptype
Data type: Optional[Enum['Automatic', 'Disabled', 'Manual']]
Specifies the startup mode for the SQL Server Database Engine's Windows service.
dsc_sqlsysadminaccounts
Data type: Optional[Array[String]]
An array of accounts to be made SQL Server administrators.
dsc_sqltempdbdir
Data type: Optional[String]
Path for SQL Server temporary database data files.
dsc_sqltempdbfilecount
Data type: Optional[Integer[0, 4294967295]]
Specifies the number of temporary database data files to be added by setup.
dsc_sqltempdbfilegrowth
Data type: Optional[Integer[0, 4294967295]]
Specifies the file growth increment of each temporary database data file in MB.
dsc_sqltempdbfilesize
Data type: Optional[Integer[0, 4294967295]]
Specifies the initial size of each temporary database data file in MB.
dsc_sqltempdblogdir
Data type: Optional[String]
Path for SQL Server temporary database log files.
dsc_sqltempdblogfilegrowth
Data type: Optional[Integer[0, 4294967295]]
Specifies the file growth increment of each temporary database data file in MB.
dsc_sqltempdblogfilesize
Data type: Optional[Integer[0, 4294967295]]
Specifies the initial size of each temporary database log file in MB.
dsc_sqluserdbdir
Data type: Optional[String]
Path for SQL Server database files.
dsc_sqluserdblogdir
Data type: Optional[String]
Path for SQL Server log files.
dsc_sqmreporting
Data type: Optional[String]
Enable customer experience reporting.
dsc_suppressreboot
Data type: Optional[Boolean]
Suppresses reboot.
dsc_tcpenabled
Data type: Optional[Boolean]
Specifies the state of the TCP protocol for the SQL Server service. The value $true
will enable the TCP protocol and $false
will disabled it.
dsc_updateenabled
Data type: Optional[String]
Enabled updates during installation.
dsc_updatesource
Data type: Optional[String]
Path to the source of updates to be applied during installation.
dsc_useenglish
Data type: Optional[Boolean]
Specifies to install the English version of SQL Server on a localized operating system when the installation media includes language packs for both English and the language corresponding to the operating system.
Parameters
The following parameters are available in the dsc_sqlsetup
type.
dsc_agtsvcaccount
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
Service account for the SQL Agent's Windows service.
dsc_assvcaccount
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
Service account for Analysis Services's Windows service.
dsc_ftsvcaccount
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
Service account for the Full Text's Windows service.
dsc_instancename
namevar
Data type: String
Specifies the name of the instance to be installed.
dsc_issvcaccount
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
Service account for Integration Services's Windows service.
dsc_psdscrunascredential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
dsc_rssvcaccount
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
Service account for Reporting Services's Windows service.
dsc_sapwd
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
Specifies the SA account's password. Only applicable if parameter SecurityMode is set to 'SQL'
.
dsc_sourcecredential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
Credentials used to access the path set in the parameter SourcePath. See section Considerations regarding the parameter SourceCredential.
dsc_sqlsvcaccount
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
Service account for the SQL Server's Windows service.
name
namevar
Data type: String
Description of the purpose for this resource declaration.
dsc_sqltraceflag
The DSC SqlTraceFlag resource type. Automatically generated from version 15.0.0
Properties
The following properties are available in the dsc_sqltraceflag
type.
dsc_restartservice
Data type: Optional[Boolean]
Forces a restart of the Database Engine service and dependent services after the desired state is set. Default values is $false.
[15.0.0] - 2020-12-06
Added
- SqlServerDsc
- Added new resource SqlTraceFlag to set or changes TraceFlags on SQL Server. This resource is based on @Zuldans code but with SqlServerDsc integrated SMO. Credits: https://github.com/Zuldan/cSQLServerTraceFlag
- Added a lot of test scripts to validated the code.
- SqlEndpoint
- Added support for the Service Broker Endpoint (issue #498).
- SqlDatabaseRole
- Added test to ensure Add-SqlDscDatabaseRoleMember throws the expected error (issue #1620).
Changed
- SqlServerDsc
- Updated code formatting using latest release of PSScriptAnalyzer.
- The URLs in the CHANGELOG.md that was pointing to issues is now referencing the new repository name and URL.
- SqlServerDsc.Common
- The helper function
Get-SqlInstanceMajorVersion
no longer have a default value for parameter InstanceName since the parameter is mandatory and it was never used.
- The helper function
- SqlReplication
- The resource are now using the helper function
Get-SqlInstanceMajorVersion
(issue #1408).
- The resource are now using the helper function
- SqlRole
- Major overhaul of resource.
- BREAKING CHANGE: Removed decision making from get-TargetResource; this prevented a simple solution for issue #550. it now just tels if a role exists or not. And what members are in that role. MembersToInclude and MembersToExclude now always return $null.
- Added sanitize function (
Get-CorrectedMemberParameters
) to make it so for the sysadmin role SA does not get altered (issue #550). - Added lots of tests.
- SqlWaitForAG
- BREAKING CHANGE: Fix for issue (issue #1569) The resource now waits for the Availability Group to become Available.
- Two parameters where added to test get and set resource at instance level.
- SqlSetup
- Minor change to the evaluation of the parameter
BrowserSvcStartupType
, if it has an assigned a value or not.
- Minor change to the evaluation of the parameter
Fixed
- SqlDatabaseRole
- Fixed check to see if the role and user existed in the database. The previous logic would always indicate the role or user was not found unless the role had the same name as the user. Also updated the DesiredMembersNotPresent string to be more accurate when an extra user is in the role (issue #1487).
- SqlAlwaysOnService
- Updated Get-TargetResource to return all defined schema properties (issue #150).
- SqlSetup
- Added a note to the documentation that the parameter
BrowserSvcStartupType
cannot be used for configurations that utilize the'InstallFailoverCluster'
action (issue #1627).
- Added a note to the documentation that the parameter
Dependencies
- puppetlabs/pwshlib (>= 0.7.0 < 2.0.0)