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.2.0-0-0'
Learn more about managing modules with a PuppetfileDocumentation
sqlserverdsc
Table of Contents
Description
This is an auto-generated module, using the Puppet DSC Builder to vendor and expose the SqlServerDsc 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.2.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!
Long File Path Support
Several PowerShell modules with DSC Resources end up with very long file paths once vendored, many of which exceed the 260 character limit for file paths. Luckily in Windows 10 (build 1607+), Windows Server 2016 (build 1607+), and Windows Server 2019 there is now an option for supporting long file paths transparently!
We strongly recommend enabling long file path support on any machines using this module to avoid path length issues.
You can set this value using the Puppet registry_value
resource:
registry_value { 'HKLM\System\CurrentControlSet\Control\FileSystem\LongPathsEnabled':
ensure => 'present',
data => [1],
provider => 'registry',
type => 'dword',
}
You can also set this value outside of Puppet by following the Microsoft documentation.
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,
}
Credentials
Credentials are always specified as a hash of the username and password for the account. The password must use the Puppet Sensitive type; this ensures that logs and reports redact the password, displaying it instead as <Sensitive [value redacted]>.
dsc_psrepository { 'PowerShell Gallery':
dsc_name => 'psgAllery',
dsc_installationpolicy => 'Trusted',
dsc_psdscrunascredential => {
user => 'apple',
password => Sensitive('foobar'),
},
}
Class-Based Resources
Class-based DSC Resources can be used like any other DSC Resource in this module, with one important note:
Due to a bug in calling class-based DSC Resources by path instead of module name, each call to Invoke-DscResource
needs to temporarily munge the system-level environment variable for PSModulePath
;
the variable is reset prior to the end of each invocation.
CIM Instances
Because the CIM instances for DSC resources are fully mapped, the types actually explain fairly precisely what the shape of each CIM instance has to be - and, moreover, the type definition means that you get checking at catalog compile time. Puppet parses CIM instances are structured hashes (or arrays of structured hashes) that explicitly declare their keys and the valid types of values for each key.
So, for the dsc_accesscontrolentry
property of the dsc_ntfsaccessentry
type, which has a MOF type of NTFSAccessControlList[]
, Puppet defines the CIM instance as:
Array[Struct[{
accesscontrolentry => Array[Struct[{
accesscontroltype => Enum['Allow', 'Deny'],
inheritance => Enum['This folder only', 'This folder subfolders and files', 'This folder and subfolders', 'This folder and files', 'Subfolders and files only', 'Subfolders only', 'Files only'],
ensure => Enum['Present', 'Absent'],
cim_instance_type => 'NTFSAccessControlEntry',
filesystemrights => Array[Enum['AppendData', 'ChangePermissions', 'CreateDirectories', 'CreateFiles', 'Delete', 'DeleteSubdirectoriesAndFiles', 'ExecuteFile', 'FullControl', 'ListDirectory', 'Modify', 'Read', 'ReadAndExecute', 'ReadAttributes', 'ReadData', 'ReadExtendedAttributes', 'ReadPermissions', 'Synchronize', 'TakeOwnership', 'Traverse', 'Write', 'WriteAttributes', 'WriteData', 'WriteExtendedAttributes']]
}]],
forceprincipal => Optional[Boolean],
principal => Optional[String],
}]]
A valid example of that in a puppet manifest looks like this:
dsc_accesscontrollist => [
{
accesscontrolentry => [
{
accesscontroltype => 'Allow',
inheritance => 'This folder only',
ensure => 'Present',
filesystemrights => 'ChangePermissions',
cim_instance_type => 'NTFSAccessControlEntry',
},
],
principal => 'veryRealUserName',
},
]
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).
Validation Mode
By default, these resources use the property validation mode, which checks whether or not the resource is in the desired state the same way most Puppet resources are validated;
by comparing the properties returned from the system with those specified in the manifest.
Sometimes, however, this is insufficient;
many DSC Resources return data that does not compare properly to the desired state (some are missing properties, others are malformed, some simply cannot be strictly compared).
In these cases, you can set the validation mode to resource
, which falls back on calling Invoke-DscResource
with the Test
method and trusts that result.
When using the resource
validation mode, the resource is tested once and will then treat all properties of that resource as in sync (if the result returned true
) or not in sync.
This loses the granularity of change reporting for the resource but prevents flapping and unexpected behavior.
# This will flap because the DSC resource never returns name in SecurityPolicyDsc v2.10.0.0
dsc_securityoption { 'Enforce Anonoymous SID Translation':
dsc_name => 'Enforce Anonymous SID Translation',
dsc_network_access_allow_anonymous_sid_name_translation => 'Disabled',
}
# This will idempotently apply
dsc_psrepository { 'PowerShell Gallery':
validation_mode => 'resource',
dsc_name => 'Enforce Anonymous SID Translation',
dsc_network_access_allow_anonymous_sid_name_translation => 'Disabled',
}
It is important to note that this feature is only supported with a version of puppetlabs-pwshlib
equal to or higher than 0.9.0
, in which the supporting code for the DSC Base Provider to implement custom insync was shipped.
Finally, while this module's metadata says that the supported Puppet versions are 6.0.0 and up, the implementation of the validation_mode
parameter relies on the custom_insync
feature of the Puppet Resource API.
The custom_insync
feature first shipped in the puppet-resource_api
version 1.8.14
, which itself is only included in Puppet versions equal to or newer than 6.23.0
and 7.8.0
for the 6x and 7x platforms respectively.
Using this module against older Puppet versions will result in a warning (example below) and only use the default property-by-property change reporting, regardless of the setting of validation_mode
.
Warning: Unknown feature detected: ["custom_insync"]
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.
Right now, if you have the same version of a PowerShell module with class-based DSC Resources in your PSModulePath as vendored in a Puppetized DSC Module, you cannot use those class-based DSC Resources from inside of Puppet due to a bug in DSC which prevents using a module by path reference instead of name. Instead, DSC will see that there are two DSC Resources for the same module and version and then error out.
Configuring the LCM
In order for a Puppetized DSC module to function, the DSC Local Configuration Manager (LCM) RefreshMode
must be set to either Push
or Disabled
.
The default value for RefreshMode
in WMF 5.0 and WMF 5.1 is Push
- so if it has not been set to anything else then there is no action needed on your part.
However if the value of the LCM has been set to anything other than Push
then the module will not function and so the value must either be changed back or disabled.
The Puppetized DSC modules use the Invoke-DscResource
cmdlet to invoke DSC Resources of the target machine.
If the RefreshMode
is set to Pull
, DSC Resources will only run from a DSC Pull Server - in this setting DSC does not allow any DSC Resources to be run interactively on the host.
Module Installation
If you're using this module with Puppet Enterprise and Code Manager, everything should "just work" - no errors or issues acquiring and deploying this or any Puppetized DSC module to nodes.
Unfortunately, due a bug in minitar which prevents it from unpacking archives with long file paths, both r10k
and serverless Puppet (via puppet module install
) methods of installing modules with long path names will fail.
In short, minitar is unable to unpack modules that contain long file paths (though it can create them).
As a workaround, you can retrieve DSC modules from the forge via PowerShell and 7zip:
$ModuleAuthor = 'dsc'
$ModuleName = 'xremotedesktopsessionhost'
$ModuleVersion = '2.0.0-0-1'
$ArchiveFileName = "$ModuleAuthor-$ModuleName-$ModuleVersion.tar.gz"
$DownloadUri = "https://forge.puppet.com/v3/files/$ArchiveFileName"
# Download the module tar.gz to the current directory
Invoke-WebRequest -Uri $DownloadUri -OutFile ./$ArchiveFileName
# Use 7zip to extract the module to the current directory
& 7z x $ArchiveFileName -so | & 7z x -aoa -si -ttar
Reference
Table of Contents
Resource types
dsc_sqlag
: The DSC SqlAG resource type. Automatically generated from version 15.2.0dsc_sqlagdatabase
: The DSC SqlAGDatabase resource type. Automatically generated from version 15.2.0dsc_sqlagentalert
: The DSC SqlAgentAlert resource type. Automatically generated from version 15.2.0dsc_sqlagentfailsafe
: The DSC SqlAgentFailsafe resource type. Automatically generated from version 15.2.0dsc_sqlagentoperator
: The DSC SqlAgentOperator resource type. Automatically generated from version 15.2.0dsc_sqlaglistener
: The DSC SqlAGListener resource type. Automatically generated from version 15.2.0dsc_sqlagreplica
: The DSC SqlAGReplica resource type. Automatically generated from version 15.2.0dsc_sqlalias
: The DSC SqlAlias resource type. Automatically generated from version 15.2.0dsc_sqlalwaysonservice
: The DSC SqlAlwaysOnService resource type. Automatically generated from version 15.2.0dsc_sqlconfiguration
: The DSC SqlConfiguration resource type. Automatically generated from version 15.2.0dsc_sqldatabase
: The DSC SqlDatabase resource type. Automatically generated from version 15.2.0dsc_sqldatabasedefaultlocation
: The DSC SqlDatabaseDefaultLocation resource type. Automatically generated from version 15.2.0dsc_sqldatabasemail
: The DSC SqlDatabaseMail resource type. Automatically generated from version 15.2.0dsc_sqldatabaseobjectpermission
: The DSC SqlDatabaseObjectPermission resource type. Automatically generated from version 15.2.0dsc_sqldatabaseowner
: The DSC SqlDatabaseOwner resource type. Automatically generated from version 15.2.0dsc_sqldatabasepermission
: The DSC SqlDatabasePermission resource type. Automatically generated from version 15.2.0dsc_sqldatabaserecoverymodel
: The DSC SqlDatabaseRecoveryModel resource type. Automatically generated from version 15.2.0dsc_sqldatabaserole
: The DSC SqlDatabaseRole resource type. Automatically generated from version 15.2.0dsc_sqldatabaseuser
: The DSC SqlDatabaseUser resource type. Automatically generated from version 15.2.0dsc_sqlendpoint
: The DSC SqlEndpoint resource type. Automatically generated from version 15.2.0dsc_sqlendpointpermission
: The DSC SqlEndpointPermission resource type. Automatically generated from version 15.2.0dsc_sqllogin
: The DSC SqlLogin resource type. Automatically generated from version 15.2.0dsc_sqlmaxdop
: The DSC SqlMaxDop resource type. Automatically generated from version 15.2.0dsc_sqlmemory
: The DSC SqlMemory resource type. Automatically generated from version 15.2.0dsc_sqlpermission
: The DSC SqlPermission resource type. Automatically generated from version 15.2.0dsc_sqlprotocol
: The DSC SqlProtocol resource type. Automatically generated from version 15.2.0dsc_sqlprotocoltcpip
: The DSC SqlProtocolTcpIp resource type. Automatically generated from version 15.2.0dsc_sqlreplication
: The DSC SqlReplication resource type. Automatically generated from version 15.2.0dsc_sqlrole
: The DSC SqlRole resource type. Automatically generated from version 15.2.0dsc_sqlrs
: The DSC SqlRS resource type. Automatically generated from version 15.2.0dsc_sqlrssetup
: The DSC SqlRSSetup resource type. Automatically generated from version 15.2.0dsc_sqlscript
: The DSC SqlScript resource type. Automatically generated from version 15.2.0dsc_sqlscriptquery
: The DSC SqlScriptQuery resource type. Automatically generated from version 15.2.0dsc_sqlsecureconnection
: The DSC SqlSecureConnection resource type. Automatically generated from version 15.2.0dsc_sqlserverendpointstate
: The DSC SqlServerEndpointState resource type. Automatically generated from version 15.2.0dsc_sqlservernetwork
: The DSC SqlServerNetwork resource type. Automatically generated from version 15.2.0dsc_sqlserviceaccount
: The DSC SqlServiceAccount resource type. Automatically generated from version 15.2.0dsc_sqlsetup
: The DSC SqlSetup resource type. Automatically generated from version 15.2.0dsc_sqltraceflag
: The DSC SqlTraceFlag resource type. Automatically generated from version 15.2.0dsc_sqlwaitforag
: The DSC SqlWaitForAG resource type. Automatically generated from version 15.2.0dsc_sqlwindowsfirewall
: The DSC SqlWindowsFirewall resource type. Automatically generated from version 15.2.0
Resource types
dsc_sqlag
The DSC SqlAG resource type. Automatically generated from version 15.2.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.
validation_mode
Data type: Enum[property, resource]
Whether to check if the resource is in the desired state by property (default) or using Invoke-DscResource in Test mode (resource).
Default value: property
dsc_sqlagdatabase
The DSC SqlAGDatabase resource type. Automatically generated from version 15.2.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
dsc_force
dsc_instancename
dsc_psdscrunascredential
dsc_servername
name
validation_mode
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.
validation_mode
Data type: Enum[property, resource]
Whether to check if the resource is in the desired state by property (default) or using Invoke-DscResource in Test mode (resource).
Default value: property
dsc_sqlagentalert
The DSC SqlAgentAlert resource type. Automatically generated from version 15.2.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 the current computer name.
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.
validation_mode
Data type: Enum[property, resource]
Whether to check if the resource is in the desired state by property (default) or using Invoke-DscResource in Test mode (resource).
Default value: property
dsc_sqlagentfailsafe
The DSC SqlAgentFailsafe resource type. Automatically generated from version 15.2.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 the current computer name.
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.
validation_mode
Data type: Enum[property, resource]
Whether to check if the resource is in the desired state by property (default) or using Invoke-DscResource in Test mode (resource).
Default value: property
dsc_sqlagentoperator
The DSC SqlAgentOperator resource type. Automatically generated from version 15.2.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 the current computer name.
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.
validation_mode
Data type: Enum[property, resource]
Whether to check if the resource is in the desired state by property (default) or using Invoke-DscResource in Test mode (resource).
Default value: property
dsc_sqlaglistener
The DSC SqlAGListener resource type. Automatically generated from version 15.2.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.
validation_mode
Data type: Enum[property, resource]
Whether to check if the resource is in the desired state by property (default) or using Invoke-DscResource in Test mode (resource).
Default value: property
dsc_sqlagreplica
The DSC SqlAGReplica resource type. Automatically generated from version 15.2.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.
validation_mode
Data type: Enum[property, resource]
Whether to check if the resource is in the desired state by property (default) or using Invoke-DscResource in Test mode (resource).
Default value: property
dsc_sqlalias
The DSC SqlAlias resource type. Automatically generated from version 15.2.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.
validation_mode
Data type: Enum[property, resource]
Whether to check if the resource is in the desired state by property (default) or using Invoke-DscResource in Test mode (resource).
Default value: property
dsc_sqlalwaysonservice
The DSC SqlAlwaysOnService resource type. Automatically generated from version 15.2.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 the current computer name.
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.
validation_mode
Data type: Enum[property, resource]
Whether to check if the resource is in the desired state by property (default) or using Invoke-DscResource in Test mode (resource).
Default value: property
dsc_sqlconfiguration
The DSC SqlConfiguration resource type. Automatically generated from version 15.2.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 the current computer name.
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.
validation_mode
Data type: Enum[property, resource]
Whether to check if the resource is in the desired state by property (default) or using Invoke-DscResource in Test mode (resource).
Default value: property
dsc_sqldatabase
The DSC SqlDatabase resource type. Automatically generated from version 15.2.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 the current computer name.
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.
validation_mode
Data type: Enum[property, resource]
Whether to check if the resource is in the desired state by property (default) or using Invoke-DscResource in Test mode (resource).
Default value: property
dsc_sqldatabasedefaultlocation
The DSC SqlDatabaseDefaultLocation resource type. Automatically generated from version 15.2.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 the current computer name.
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.
validation_mode
Data type: Enum[property, resource]
Whether to check if the resource is in the desired state by property (default) or using Invoke-DscResource in Test mode (resource).
Default value: property
dsc_sqldatabasemail
The DSC SqlDatabaseMail resource type. Automatically generated from version 15.2.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 the current computer name.
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.
validation_mode
Data type: Enum[property, resource]
Whether to check if the resource is in the desired state by property (default) or using Invoke-DscResource in Test mode (resource).
Default value: property
dsc_sqldatabaseobjectpermission
The DSC SqlDatabaseObjectPermission resource type. Automatically generated from version 15.2.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 the current computer name.
Parameters
The following parameters are available in the dsc_sqldatabaseobjectpermission
type.
dsc_databasename
dsc_force
dsc_instancename
dsc_name
dsc_objectname
dsc_objecttype
dsc_psdscrunascredential
dsc_schemaname
name
validation_mode
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.
validation_mode
Data type: Enum[property, resource]
Whether to check if the resource is in the desired state by property (default) or using Invoke-DscResource in Test mode (resource).
Default value: property
dsc_sqldatabaseowner
The DSC SqlDatabaseOwner resource type. Automatically generated from version 15.2.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.
validation_mode
Data type: Enum[property, resource]
Whether to check if the resource is in the desired state by property (default) or using Invoke-DscResource in Test mode (resource).
Default value: property
dsc_sqldatabasepermission
The DSC SqlDatabasePermission resource type. Automatically generated from version 15.2.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 the current computer name.
Parameters
The following parameters are available in the dsc_sqldatabasepermission
type.
dsc_databasename
dsc_instancename
dsc_name
dsc_permissionstate
dsc_psdscrunascredential
name
validation_mode
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.
validation_mode
Data type: Enum[property, resource]
Whether to check if the resource is in the desired state by property (default) or using Invoke-DscResource in Test mode (resource).
Default value: property
dsc_sqldatabaserecoverymodel
The DSC SqlDatabaseRecoveryModel resource type. Automatically generated from version 15.2.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.
validation_mode
Data type: Enum[property, resource]
Whether to check if the resource is in the desired state by property (default) or using Invoke-DscResource in Test mode (resource).
Default value: property
dsc_sqldatabaserole
The DSC SqlDatabaseRole resource type. Automatically generated from version 15.2.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 the current computer name.
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.
validation_mode
Data type: Enum[property, resource]
Whether to check if the resource is in the desired state by property (default) or using Invoke-DscResource in Test mode (resource).
Default value: property
dsc_sqldatabaseuser
The DSC SqlDatabaseUser resource type. Automatically generated from version 15.2.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 the current computer name.
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.
validation_mode
Data type: Enum[property, resource]
Whether to check if the resource is in the desired state by property (default) or using Invoke-DscResource in Test mode (resource).
Default value: property
dsc_sqlendpoint
The DSC SqlEndpoint resource type. Automatically generated from version 15.2.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 the current computer name.
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.
validation_mode
Data type: Enum[property, resource]
Whether to check if the resource is in the desired state by property (default) or using Invoke-DscResource in Test mode (resource).
Default value: property
dsc_sqlendpointpermission
The DSC SqlEndpointPermission resource type. Automatically generated from version 15.2.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 the current computer name.
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.
validation_mode
Data type: Enum[property, resource]
Whether to check if the resource is in the desired state by property (default) or using Invoke-DscResource in Test mode (resource).
Default value: property
dsc_sqllogin
The DSC SqlLogin resource type. Automatically generated from version 15.2.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
. This cannot be updated on a pre-existing SQL Login and any attempt to do this will throw an exception.
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 the current computer name.
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.
validation_mode
Data type: Enum[property, resource]
Whether to check if the resource is in the desired state by property (default) or using Invoke-DscResource in Test mode (resource).
Default value: property
dsc_sqlmaxdop
The DSC SqlMaxDop resource type. Automatically generated from version 15.2.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 the current computer name.
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.
validation_mode
Data type: Enum[property, resource]
Whether to check if the resource is in the desired state by property (default) or using Invoke-DscResource in Test mode (resource).
Default value: property
dsc_sqlmemory
The DSC SqlMemory resource type. Automatically generated from version 15.2.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_maxmemorypercent
Data type: Optional[Integer[-2147483648, 2147483647]]
Maximum amount of memory, as a percentage of total server memory, 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_minmemorypercent
Data type: Optional[Integer[-2147483648, 2147483647]]
Minimum amount of memory, as a percentage of total server memory, 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 the current computer name.
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.
validation_mode
Data type: Enum[property, resource]
Whether to check if the resource is in the desired state by property (default) or using Invoke-DscResource in Test mode (resource).
Default value: property
dsc_sqlpermission
The DSC SqlPermission resource type. Automatically generated from version 15.2.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 the current computer name.
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.
validation_mode
Data type: Enum[property, resource]
Whether to check if the resource is in the desired state by property (default) or using Invoke-DscResource in Test mode (resource).
Default value: property
dsc_sqlprotocol
The DSC SqlProtocol resource type. Automatically generated from version 15.2.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[-2147483648, 2147483647]]
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 the current computer name.
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.
validation_mode
Data type: Enum[property, resource]
Whether to check if the resource is in the desired state by property (default) or using Invoke-DscResource in Test mode (resource).
Default value: property
dsc_sqlprotocoltcpip
The DSC SqlProtocolTcpIp resource type. Automatically generated from version 15.2.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 the current computer name.
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.
validation_mode
Data type: Enum[property, resource]
Whether to check if the resource is in the desired state by property (default) or using Invoke-DscResource in Test mode (resource).
Default value: property
dsc_sqlreplication
The DSC SqlReplication resource type. Automatically generated from version 15.2.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.
validation_mode
Data type: Enum[property, resource]
Whether to check if the resource is in the desired state by property (default) or using Invoke-DscResource in Test mode (resource).
Default value: property
dsc_sqlrole
The DSC SqlRole resource type. Automatically generated from version 15.2.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 the current computer name.
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.
validation_mode
Data type: Enum[property, resource]
Whether to check if the resource is in the desired state by property (default) or using Invoke-DscResource in Test mode (resource).
Default value: property
dsc_sqlrs
The DSC SqlRS resource type. Automatically generated from version 15.2.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.
validation_mode
Data type: Enum[property, resource]
Whether to check if the resource is in the desired state by property (default) or using Invoke-DscResource in Test mode (resource).
Default value: property
dsc_sqlrssetup
The DSC SqlRSSetup resource type. Automatically generated from version 15.2.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.
validation_mode
Data type: Enum[property, resource]
Whether to check if the resource is in the desired state by property (default) or using Invoke-DscResource in Test mode (resource).
Default value: property
dsc_sqlscript
The DSC SqlScript resource type. Automatically generated from version 15.2.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 the current computer name.
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
dsc_getfilepath
dsc_instancename
dsc_psdscrunascredential
dsc_setfilepath
dsc_testfilepath
name
validation_mode
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.
validation_mode
Data type: Enum[property, resource]
Whether to check if the resource is in the desired state by property (default) or using Invoke-DscResource in Test mode (resource).
Default value: property
dsc_sqlscriptquery
The DSC SqlScriptQuery resource type. Automatically generated from version 15.2.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]]
[15.2.0] - 2021-09-01
Changed
- SqlServerDsc
- Changed to the new GitHub deploy tasks that is required for the latest version of the Sampler module.
- Updated pipeline configuration to align with the latest changes in Sampler.
- Update codecov.yml to support carry forward flags.
- Updated pipelines files to latest from Sampler project.
- Updated GitHub issue templates.
- Remove pipeline jobs
Test_Integration_SQL2016
,Test_Integration_SQL2017
, andTest_Integration_SQL2019
and raplaced with a single jobTest_Integration
(issue #1713). - Update HQRM tests to run on the VM image
windows-2022
. - Update unit tests to run on the VM image
windows-2022
. - Update integration tests to run both on Windows Server 2019 and Windows Server 2022 (issue #1713).
- SqlSetup
- The helper function
Connect-SqlAnalysis
was usingLoadWithPartial()
to load the assembly Microsoft.AnalysisServices. On a node where multiple instances with different versions of SQL Server (regardless of features) is installed, this will result in the first assembly found in the GAC will be loaded into the session, not taking versions into account. This can result in an assembly version being loaded that is not compatible with the version of SQL Server it was meant to be used with. A new method of loading the assembly Microsoft.AnalysisServices was introduced under a feature flag;'AnalysisServicesConnection'
. This new functionality depends on the SqlServer module, and must be present on the node. The SqlServer module can be installed on the node by leveraging the new DSC resourcePSModule
in the PowerShellGet module (v2.1.2 and higher). This new method does not work with the SQLPS module due to the SQLPS module does not load the correct assembly, while SqlServer module (v21.1.18080 and above) does. The new functionality is used when the parameterFeatureFlag
is set to'AnalysisServicesConnection'
. This functionality will be the default in a future breaking release. - Under a feature flag
'AnalysisServicesConnection'
. The detection of a successful connection to the SQL Server Analysis Services has also been changed. Now it actually evaluates the propertyConnected
of the returnedMicrosoft.AnalysisServices.Server
object. The new functionality is used when the parameterFeatureFlag
is set to'AnalysisServicesConnection'
. This functionality will be the default in a future breaking release.
- The helper function
- SqlAgentAlert
- Switched README file with SqlAgentFailsafe (issue #1709).
- SqlAgentFailsafe
- Switched README file with SqlAgentAlert (issue #1709).
Added
- SqlMemory
- Added two new optional parameters MinMemoryPercent and MaxMemoryPercent. Provides the ability to set the minimum and/or maximum buffer pool used by the SQL Server instance as a percentage of total server memory. (issue #1397).
- SqlRSSetup
- Integration tests now install Microsoft SQL Server 2019 Reporting Services (issue #1717).
- SqlRS
- Integration tests now configures Microsoft SQL Server 2019 Reporting Services.
Fixed
- SqlSetup
- Fixed integration tests for SQL Server 2016 and SQL Server 2017.
- SqlServerDsc.Common
- Fixed so that CredScan no longer reports a password false-positive (issue #1712).
- SqlRS
- Fixed SSRS 2019 initialization (issue #1509).
- Fix a problem that did not correctly evaluate the
UseSSL
property against the current state.
Dependencies
- puppetlabs/pwshlib (>= 0.9.0 < 2.0.0)
Quality checks
We run a couple of automated scans to help you assess a module’s quality. Each module is given a score based on how well the author has formatted their code and documentation and select modules are also checked for malware using VirusTotal.
Please note, the information below is for guidance only and neither of these methods should be considered an endorsement by Puppet.
Malware scan results
The malware detection service on Puppet Forge is an automated process that identifies known malware in module releases before they’re published. It is not intended to replace your own virus scanning solution.
Learn more about malware scans- Module name:
- dsc-sqlserverdsc
- Module version:
- 15.2.0
- Scan initiated:
- September 1st 2021, 7:14:55
- Detections:
- 0 / 56
- Scan stats:
- 56 undetected
- 0 harmless
- 0 failures
- 0 timeouts
- 0 malicious
- 0 suspicious
- 16 unsupported
- Scan report:
- View the detailed scan report