sqlserverdsc
Version information
This version is compatible with:
- Puppet Enterprise 2023.8.x, 2023.7.x, 2023.6.x, 2023.5.x, 2023.4.x, 2023.3.x, 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
- Puppet >= 7.0.0 < 9.0.0
Start using this module
Add this module to your Puppetfile:
mod 'dsc-sqlserverdsc', '17.0.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 v17.0.0. The PowerShell module describes itself like this:
Module with DSC resources for deployment and configuration of Microsoft SQL Server.
For information on troubleshooting to determine whether any encountered problems are with the Puppet wrapper or the DSC resource, see the troubleshooting section below.
Requirements
This module, like all auto-generated Puppetized DSC modules, relies on two important technologies in the Puppet stack: the Puppet Resource API and the puppetlabs/pwshlib Puppet module.
The Resource API provides a simplified option for writing types and providers and is responsible for how this module is structured. The Resource API ships inside of Puppet starting with version 6. While it is technically possible to add the Resource API functionality to Puppet 5.5.x, the DSC functionality has not been tested in this setup. For more information on the Resource API, review the documentation.
The module also depends on the pwshlib module. This Puppet module includes two important things: the ruby-pwsh library for running PowerShell code from ruby and the base provider for DSC resources, which this module leverages.
All of the actual work being done to call the DSC resources vendored with this module is in this file from the pwshlib module. This is important for troubleshooting and bug reporting, but doesn't impact your use of the module except that the end result will be that nothing works, as the dependency is not installed alongside this module!
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.
-
When PowerShell Script Block Logging is enabled, data marked as sensitive in your manifest may appear in these logs as plain text. It is highly recommended, by both Puppet and Microsoft, that you also enable Protected Event Logging alongside this to encrypt the logs to protect this information.
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 17.0.0dsc_sqlagdatabase
: The DSC SqlAGDatabase resource type. Automatically generated from version 17.0.0dsc_sqlagentalert
: The DSC SqlAgentAlert resource type. Automatically generated from version 17.0.0dsc_sqlagentfailsafe
: The DSC SqlAgentFailsafe resource type. Automatically generated from version 17.0.0dsc_sqlagentoperator
: The DSC SqlAgentOperator resource type. Automatically generated from version 17.0.0dsc_sqlaglistener
: The DSC SqlAGListener resource type. Automatically generated from version 17.0.0dsc_sqlagreplica
: The DSC SqlAGReplica resource type. Automatically generated from version 17.0.0dsc_sqlalias
: The DSC SqlAlias resource type. Automatically generated from version 17.0.0dsc_sqlalwaysonservice
: The DSC SqlAlwaysOnService resource type. Automatically generated from version 17.0.0dsc_sqlaudit
: The DSC SqlAudit resource type. Automatically generated from version 17.0.0dsc_sqlconfiguration
: The DSC SqlConfiguration resource type. Automatically generated from version 17.0.0dsc_sqldatabase
: The DSC SqlDatabase resource type. Automatically generated from version 17.0.0dsc_sqldatabasedefaultlocation
: The DSC SqlDatabaseDefaultLocation resource type. Automatically generated from version 17.0.0dsc_sqldatabasemail
: The DSC SqlDatabaseMail resource type. Automatically generated from version 17.0.0dsc_sqldatabaseobjectpermission
: The DSC SqlDatabaseObjectPermission resource type. Automatically generated from version 17.0.0dsc_sqldatabasepermission
: The DSC SqlDatabasePermission resource type. Automatically generated from version 17.0.0dsc_sqldatabaserole
: The DSC SqlDatabaseRole resource type. Automatically generated from version 17.0.0dsc_sqldatabaseuser
: The DSC SqlDatabaseUser resource type. Automatically generated from version 17.0.0dsc_sqlendpoint
: The DSC SqlEndpoint resource type. Automatically generated from version 17.0.0dsc_sqlendpointpermission
: The DSC SqlEndpointPermission resource type. Automatically generated from version 17.0.0dsc_sqllogin
: The DSC SqlLogin resource type. Automatically generated from version 17.0.0dsc_sqlmaxdop
: The DSC SqlMaxDop resource type. Automatically generated from version 17.0.0dsc_sqlmemory
: The DSC SqlMemory resource type. Automatically generated from version 17.0.0dsc_sqlpermission
: The DSC SqlPermission resource type. Automatically generated from version 17.0.0dsc_sqlprotocol
: The DSC SqlProtocol resource type. Automatically generated from version 17.0.0dsc_sqlprotocoltcpip
: The DSC SqlProtocolTcpIp resource type. Automatically generated from version 17.0.0dsc_sqlreplication
: The DSC SqlReplication resource type. Automatically generated from version 17.0.0dsc_sqlrole
: The DSC SqlRole resource type. Automatically generated from version 17.0.0dsc_sqlrs
: The DSC SqlRS resource type. Automatically generated from version 17.0.0dsc_sqlrssetup
: The DSC SqlRSSetup resource type. Automatically generated from version 17.0.0dsc_sqlscript
: The DSC SqlScript resource type. Automatically generated from version 17.0.0dsc_sqlscriptquery
: The DSC SqlScriptQuery resource type. Automatically generated from version 17.0.0dsc_sqlsecureconnection
: The DSC SqlSecureConnection resource type. Automatically generated from version 17.0.0dsc_sqlserviceaccount
: The DSC SqlServiceAccount resource type. Automatically generated from version 17.0.0dsc_sqlsetup
: The DSC SqlSetup resource type. Automatically generated from version 17.0.0dsc_sqltraceflag
: The DSC SqlTraceFlag resource type. Automatically generated from version 17.0.0dsc_sqlwaitforag
: The DSC SqlWaitForAG resource type. Automatically generated from version 17.0.0dsc_sqlwindowsfirewall
: The DSC SqlWindowsFirewall resource type. Automatically generated from version 17.0.0
Resource types
dsc_sqlag
The DSC SqlAG resource type. Automatically generated from version 17.0.0
Properties
The following properties are available in the dsc_sqlag
type.
dsc_automatedbackuppreference
Data type: Optional[Enum['Primary', 'primary', 'SecondaryOnly', 'secondaryonly', 'Secondary', 'secondary', 'None', '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', 'asynchronouscommit', 'SynchronousCommit', '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', 'allowallconnections', 'AllowReadWriteConnections', 'allowreadwriteconnections']]
Specifies how the availability replica handles connections when in the primary role.
dsc_connectionmodeinsecondaryrole
Data type: Optional[Enum['AllowNoConnections', 'allownoconnections', 'AllowReadIntentConnectionsOnly', 'allowreadintentconnectionsonly', 'AllowAllConnections', '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', 'present', 'Absent', 'absent']]
Specifies if the availability group should be present or absent. Default value is 'Present'
.
dsc_failovermode
Data type: Optional[Enum['Automatic', 'automatic', 'Manual', 'manual']]
Specifies the failover mode. When creating a group the default is 'Manual'
.
dsc_failureconditionlevel
Data type: Optional[Enum['OnServerDown', 'onserverdown', 'OnServerUnresponsive', 'onserverunresponsive', 'OnCriticalServerErrors', 'oncriticalservererrors', 'OnModerateServerErrors', 'onmoderateservererrors', 'OnAnyQualifiedFailureCondition', '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_seedingmode
Data type: Optional[Enum['Automatic', 'automatic', 'Manual', 'manual']]
Specifies the seeding mode. When creating a group the default is 'Manual
'.
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]] }]]
dsc_timeout
Data type: Optional[Integer]
The maximum time in seconds to wait for the DSC resource to complete.
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 17.0.0
Properties
The following properties are available in the dsc_sqlagdatabase
type.
dsc_backuppath
Data type: String
The path used to seed the availability group replicas. This should be a path that is accessible by all of the replicas.
dsc_databasename
Data type: Array[String]
The name of the database(s) to add to the availability group. This accepts wildcards.
dsc_ensure
Data type: Optional[Enum['Present', 'present', 'Absent', '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
.
dsc_statementtimeout
Data type: Optional[Integer[-2147483648, 2147483647]]
Set the query timeout in seconds for the backup and restore operations. The default is 600 seconds (10mins).
Parameters
The following parameters are available in the dsc_sqlagdatabase
type.
dsc_availabilitygroupname
dsc_force
dsc_instancename
dsc_psdscrunascredential
dsc_servername
dsc_timeout
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.
dsc_timeout
Data type: Optional[Integer]
The maximum time in seconds to wait for the DSC resource to complete.
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 17.0.0
Properties
The following properties are available in the dsc_sqlagentalert
type.
dsc_ensure
Data type: Optional[Enum['Present', 'present', 'Absent', '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]] }]]
dsc_timeout
Data type: Optional[Integer]
The maximum time in seconds to wait for the DSC resource to complete.
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 17.0.0
Properties
The following properties are available in the dsc_sqlagentfailsafe
type.
dsc_ensure
Data type: Optional[Enum['Present', 'present', 'Absent', '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', 'none', 'NotifyEmail', 'notifyemail', 'Pager', 'pager', 'NetSend', 'netsend', 'NotifyAll', '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]] }]]
dsc_timeout
Data type: Optional[Integer]
The maximum time in seconds to wait for the DSC resource to complete.
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 17.0.0
Properties
The following properties are available in the dsc_sqlagentoperator
type.
dsc_emailaddress
Data type: Optional[String]
The email address to be used for the SQL Server Agent operator.
dsc_ensure
Data type: Optional[Enum['Present', 'present', 'Absent', '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]] }]]
dsc_timeout
Data type: Optional[Integer]
The maximum time in seconds to wait for the DSC resource to complete.
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 17.0.0
Properties
The following properties are available in the dsc_sqlaglistener
type.
dsc_dhcp
Data type: Optional[Boolean]
If DHCP should be used for the availability group listener instead of static IP address.
dsc_ensure
Data type: Optional[Enum['Present', 'present', 'Absent', '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_isactivenode
Data type: Optional[Boolean]
Determines if the current node is actively hosting the SQL Server instance.
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_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
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]] }]]
dsc_timeout
Data type: Optional[Integer]
The maximum time in seconds to wait for the DSC resource to complete.
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 17.0.0
Properties
The following properties are available in the dsc_sqlagreplica
type.
dsc_availabilitymode
Data type: Optional[Enum['AsynchronousCommit', 'asynchronouscommit', 'SynchronousCommit', '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', 'allowallconnections', 'AllowReadWriteConnections', 'allowreadwriteconnections']]
Specifies how the availability replica handles connections when in the primary role.
dsc_connectionmodeinsecondaryrole
Data type: Optional[Enum['AllowNoConnections', 'allownoconnections', 'AllowReadIntentConnectionsOnly', 'allowreadintentconnectionsonly', 'AllowAllConnections', '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', 'present', 'Absent', 'absent']]
Specifies if the availability group replica should be present or absent. Default value is 'Present'
.
dsc_failovermode
Data type: Optional[Enum['Automatic', 'automatic', 'Manual', '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_seedingmode
Data type: Optional[Enum['Automatic', 'automatic', 'Manual', 'manual']]
Specifies the seeding mode. When creating a replica the default value is 'Manual
'.
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
dsc_instancename
dsc_name
dsc_psdscrunascredential
dsc_timeout
name
validation_mode
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]] }]]
dsc_timeout
Data type: Optional[Integer]
The maximum time in seconds to wait for the DSC resource to complete.
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 17.0.0
Properties
The following properties are available in the dsc_sqlalias
type.
dsc_ensure
Data type: Optional[Enum['Present', 'present', 'Absent', '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', 'tcp', 'NP', '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]] }]]
dsc_timeout
Data type: Optional[Integer]
The maximum time in seconds to wait for the DSC resource to complete.
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 17.0.0
Properties
The following properties are available in the dsc_sqlalwaysonservice
type.
dsc_ensure
Data type: Enum['Present', 'present', 'Absent', '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_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]] }]]
dsc_timeout
Data type: Optional[Integer]
The maximum time in seconds to wait for the DSC resource to complete.
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_sqlaudit
The DSC SqlAudit resource type. Automatically generated from version 17.0.0
Properties
The following properties are available in the dsc_sqlaudit
type.
dsc_auditfilter
Data type: Optional[String]
dsc_auditguid
Data type: Optional[String]
dsc_enabled
Data type: Optional[Boolean]
dsc_ensure
Data type: Optional[Enum['Present', 'present', 'Absent', 'absent']]
dsc_logtype
Data type: Optional[Enum['SecurityLog', 'securitylog', 'ApplicationLog', 'applicationlog']]
dsc_maximumfiles
Data type: Optional[Integer[0, 4294967295]]
dsc_maximumfilesize
Data type: Optional[Integer[0, 4294967295]]
dsc_maximumfilesizeunit
Data type: Optional[Enum['Megabyte', 'megabyte', 'Gigabyte', 'gigabyte', 'Terabyte', 'terabyte']]
dsc_maximumrolloverfiles
Data type: Optional[Integer[0, 4294967295]]
dsc_onfailure
Data type: Optional[Enum['Continue', 'continue', 'FailOperation', 'failoperation', 'Shutdown', 'shutdown']]
dsc_path
Data type: Optional[String]
dsc_queuedelay
Data type: Optional[Integer[0, 4294967295]]
dsc_reasons
Data type: Optional[Array[Struct[{ phrase => Optional[String], code => Optional[String], }]]]
dsc_reservediskspace
Data type: Optional[Boolean]
dsc_servername
Data type: Optional[String]
Parameters
The following parameters are available in the dsc_sqlaudit
type.
dsc_credential
dsc_force
dsc_instancename
dsc_name
dsc_psdscrunascredential
dsc_timeout
name
validation_mode
dsc_credential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
dsc_force
Data type: Optional[Boolean]
dsc_instancename
namevar
Data type: String
dsc_name
namevar
Data type: String
dsc_psdscrunascredential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
dsc_timeout
Data type: Optional[Integer]
The maximum time in seconds to wait for the DSC resource to complete.
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 17.0.0
Properties
The following properties are available in the dsc_sqlconfiguration
type.
dsc_optionvalue
Data type: Integer[-2147483648, 2147483647]
The desired value of the configuration option.
dsc_restartservice
Data type: Optional[Boolean]
Determines whether the instance should be restarted after updating the configuration option.
dsc_restarttimeout
Data type: Optional[Integer[0, 4294967295]]
The length of time, in seconds, to wait for the service to restart. Default is 120
seconds.
dsc_servername
Data type: Optional[String]
The hostname of the SQL Server to be configured. Default value is 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]] }]]
dsc_timeout
Data type: Optional[Integer]
The maximum time in seconds to wait for the DSC resource to complete.
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 17.0.0
Properties
The following properties are available in the dsc_sqldatabase
type.
dsc_collation
Data type: Optional[String]
The name of the collation to use for the new database. Default value is the collation used by the server.
dsc_compatibilitylevel
Data type: Optional[Enum['Version80', 'version80', 'Version90', 'version90', 'Version100', 'version100', 'Version110', 'version110', 'Version120', 'version120', 'Version130', 'version130', 'Version140', 'version140', 'Version150', 'version150', 'Version160', 'version160']]
Specifies the version of the SQL Database Compatibility Level to use for the specified database.
dsc_ensure
Data type: Optional[Enum['Present', 'present', 'Absent', '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', 'simple', 'Full', 'full', 'BulkLogged', '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]] }]]
dsc_timeout
Data type: Optional[Integer]
The maximum time in seconds to wait for the DSC resource to complete.
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 17.0.0
Properties
The following properties are available in the dsc_sqldatabasedefaultlocation
type.
dsc_isactivenode
Data type: Optional[Boolean]
Returns if the current node is actively hosting the SQL Server instance.
dsc_path
Data type: String
The path to the default directory to be set for the type specified in the parameter Type.
dsc_processonlyonactivenode
Data type: Optional[Boolean]
Specifies that the resource will only determine if a change is needed if the target node is the active host of the SQL Server instance.
dsc_restartservice
Data type: Optional[Boolean]
If set to $true
then SQL Server and dependent services will be restarted if a change to the configuration is made. The default value is $false
.
dsc_servername
Data type: Optional[String]
The host name of the SQL Server to be configured. Default value is 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_timeout
Data type: Optional[Integer]
The maximum time in seconds to wait for the DSC resource to complete.
dsc_type
namevar
Data type: Enum['Data', 'data', 'Log', 'log', 'Backup', '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 17.0.0
Properties
The following properties are available in the dsc_sqldatabasemail
type.
dsc_description
Data type: Optional[String]
The description for the Database Mail profile and account.
dsc_displayname
Data type: Optional[String]
The display name of the originating email address. Default value is the same value assigned to the parameter EmailAddress.
dsc_emailaddress
Data type: String
The e-mail address from which mail will originate.
dsc_ensure
Data type: Optional[Enum['Present', 'present', 'Absent', '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', 'normal', 'Extended', 'extended', 'Verbose', '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
.
dsc_usedefaultcredentials
Data type: Optional[Boolean]
Specifies if the DatabaseEngine credentials are used for SMTP server authentication.
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]] }]]
dsc_timeout
Data type: Optional[Integer]
The maximum time in seconds to wait for the DSC resource to complete.
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 17.0.0
Properties
The following properties are available in the dsc_sqldatabaseobjectpermission
type.
dsc_permission
Data type: Array[Struct[{ permission => Optional[String], ensure => Optional[Enum['Present', 'present', 'Absent', 'absent']], state => Optional[Enum['Grant', 'grant', 'Deny', 'deny', 'GrantWithGrant', '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
dsc_timeout
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', 'schema', 'Table', 'table', 'View', 'view', 'StoredProcedure', '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.
dsc_timeout
Data type: Optional[Integer]
The maximum time in seconds to wait for the DSC resource to complete.
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 17.0.0
Properties
The following properties are available in the dsc_sqldatabasepermission
type.
dsc_permission
Data type: Optional[Array[Struct[{ permission => Array[Enum['AdministerDatabaseBulkOperations', 'administerdatabasebulkoperations', 'Alter', 'alter', 'AlterAnyApplicationRole', 'alteranyapplicationrole', 'AlterAnyAssembly', 'alteranyassembly', 'AlterAnyAsymmetricKey', 'alteranyasymmetrickey', 'AlterAnyCertificate', 'alteranycertificate', 'AlterAnyColumnEncryptionKey', 'alteranycolumnencryptionkey', 'AlterAnyColumnMasterKey', 'alteranycolumnmasterkey', 'AlterAnyContract', 'alteranycontract', 'AlterAnyDatabaseAudit', 'alteranydatabaseaudit', 'AlterAnyDatabaseDdlTrigger', 'alteranydatabaseddltrigger', 'AlterAnyDatabaseEventNotification', 'alteranydatabaseeventnotification', 'AlterAnyDatabaseEventSession', 'alteranydatabaseeventsession', 'AlterAnyDatabaseEventSessionAddEvent', 'alteranydatabaseeventsessionaddevent', 'AlterAnyDatabaseEventSessionAddTarget', 'alteranydatabaseeventsessionaddtarget', 'AlterAnyDatabaseEventSessionDisable', 'alteranydatabaseeventsessiondisable', 'AlterAnyDatabaseEventSessionDropEvent', 'alteranydatabaseeventsessiondropevent', 'AlterAnyDatabaseEventSessionDropTarget', 'alteranydatabaseeventsessiondroptarget', 'AlterAnyDatabaseEventSessionEnable', 'alteranydatabaseeventsessionenable', 'AlterAnyDatabaseEventSessionOption', 'alteranydatabaseeventsessionoption', 'AlterAnyDatabaseScopedConfiguration', 'alteranydatabasescopedconfiguration', 'AlterAnyDataspace', 'alteranydataspace', 'AlterAnyExternalDataSource', 'alteranyexternaldatasource', 'AlterAnyExternalFileFormat', 'alteranyexternalfileformat', 'AlterAnyExternalJob', 'alteranyexternaljob', 'AlterAnyExternalLanguage', 'alteranyexternallanguage', 'AlterAnyExternalLibrary', 'alteranyexternallibrary', 'AlterAnyExternalStream', 'alteranyexternalstream', 'AlterAnyFulltextCatalog', 'alteranyfulltextcatalog', 'AlterAnyMask', 'alteranymask', 'AlterAnyMessageType', 'alteranymessagetype', 'AlterAnyRemoteServiceBinding', 'alteranyremoteservicebinding', 'AlterAnyRole', 'alteranyrole', 'AlterAnyRoute', 'alteranyroute', 'AlterAnySchema', 'alteranyschema', 'AlterAnySecurityPolicy', 'alteranysecuritypolicy', 'AlterAnySensitivityClassification', 'alteranysensitivityclassification', 'AlterAnyService', 'alteranyservice', 'AlterAnySymmetricKey', 'alteranysymmetrickey', 'AlterAnyUser', 'alteranyuser', 'AlterLedger', 'alterledger', 'AlterLedgerConfiguration', 'alterledgerconfiguration', 'Authenticate', 'authenticate', 'BackupDatabase', 'backupdatabase', 'BackupLog', 'backuplog', 'Checkpoint', 'checkpoint', 'Connect', 'connect', 'ConnectReplication', 'connectreplication', 'Control', 'control', 'CreateAggregate', 'createaggregate', 'CreateAnyDatabaseEventSession', 'createanydatabaseeventsession', 'CreateAssembly', 'createassembly', 'CreateAsymmetricKey', 'createasymmetrickey', 'CreateCertificate', 'createcertificate', 'CreateContract', 'createcontract', 'CreateDatabase', 'createdatabase', 'CreateDatabaseDdlEventNotification', 'createdatabaseddleventnotification', 'CreateDefault', 'createdefault', 'CreateExternalLanguage', 'createexternallanguage', 'CreateExternalLibrary', 'createexternallibrary', 'CreateFulltextCatalog', 'createfulltextcatalog', 'CreateFunction', 'createfunction', 'CreateMessageType', 'createmessagetype', 'CreateProcedure', 'createprocedure', 'CreateQueue', 'createqueue', 'CreateRemoteServiceBinding', 'createremoteservicebinding', 'CreateRole', 'createrole', 'CreateRoute', 'createroute', 'CreateRule', 'createrule', 'CreateSchema', 'createschema', 'CreateService', 'createservice', 'CreateSymmetricKey', 'createsymmetrickey', 'CreateSynonym', 'createsynonym', 'CreateTable', 'createtable', 'CreateType', 'createtype', 'CreateUser', 'createuser', 'CreateView', 'createview', 'CreateXmlSchemaCollection', 'createxmlschemacollection', 'Delete', 'delete', 'DropAnyDatabaseEventSession', 'dropanydatabaseeventsession', 'EnableLedger', 'enableledger', 'Execute', 'execute', 'ExecuteAnyExternalEndpoint', 'executeanyexternalendpoint', 'ExecuteAnyExternalScript', 'executeanyexternalscript', 'Insert', 'insert', 'KillDatabaseConnection', 'killdatabaseconnection', 'OwnershipChaining', 'ownershipchaining', 'References', 'references', 'Select', 'select', 'Showplan', 'showplan', 'SubscribeQueryNotifications', 'subscribequerynotifications', 'TakeOwnership', 'takeownership', 'Unmask', 'unmask', 'Update', 'update', 'ViewAnyColumnEncryptionKeyDefinition', 'viewanycolumnencryptionkeydefinition', 'ViewAnyColumnMasterKeyDefinition', 'viewanycolumnmasterkeydefinition', 'ViewAnySensitivityClassification', 'viewanysensitivityclassification', 'ViewCryptographicallySecuredDefinition', 'viewcryptographicallysecureddefinition', 'ViewDatabasePerformanceState', 'viewdatabaseperformancestate', 'ViewDatabaseSecurityAudit', 'viewdatabasesecurityaudit', 'ViewDatabaseSecurityState', 'viewdatabasesecuritystate', 'ViewDatabaseState', 'viewdatabasestate', 'ViewDefinition', 'viewdefinition', 'ViewLedgerContent', 'viewledgercontent', 'ViewPerformanceDefinition', 'viewperformancedefinition', 'ViewSecurityDefinition', 'viewsecuritydefinition']], state => Enum['Grant', 'grant', 'GrantWithGrant', 'grantwithgrant', 'Deny', 'deny'] }]]]
dsc_permissiontoexclude
Data type: Optional[Array[Struct[{ permission => Array[Enum['AdministerDatabaseBulkOperations', 'administerdatabasebulkoperations', 'Alter', 'alter', 'AlterAnyApplicationRole', 'alteranyapplicationrole', 'AlterAnyAssembly', 'alteranyassembly', 'AlterAnyAsymmetricKey', 'alteranyasymmetrickey', 'AlterAnyCertificate', 'alteranycertificate', 'AlterAnyColumnEncryptionKey', 'alteranycolumnencryptionkey', 'AlterAnyColumnMasterKey', 'alteranycolumnmasterkey', 'AlterAnyContract', 'alteranycontract', 'AlterAnyDatabaseAudit', 'alteranydatabaseaudit', 'AlterAnyDatabaseDdlTrigger', 'alteranydatabaseddltrigger', 'AlterAnyDatabaseEventNotification', 'alteranydatabaseeventnotification', 'AlterAnyDatabaseEventSession', 'alteranydatabaseeventsession', 'AlterAnyDatabaseEventSessionAddEvent', 'alteranydatabaseeventsessionaddevent', 'AlterAnyDatabaseEventSessionAddTarget', 'alteranydatabaseeventsessionaddtarget', 'AlterAnyDatabaseEventSessionDisable', 'alteranydatabaseeventsessiondisable', 'AlterAnyDatabaseEventSessionDropEvent', 'alteranydatabaseeventsessiondropevent', 'AlterAnyDatabaseEventSessionDropTarget', 'alteranydatabaseeventsessiondroptarget', 'AlterAnyDatabaseEventSessionEnable', 'alteranydatabaseeventsessionenable', 'AlterAnyDatabaseEventSessionOption', 'alteranydatabaseeventsessionoption', 'AlterAnyDatabaseScopedConfiguration', 'alteranydatabasescopedconfiguration', 'AlterAnyDataspace', 'alteranydataspace', 'AlterAnyExternalDataSource', 'alteranyexternaldatasource', 'AlterAnyExternalFileFormat', 'alteranyexternalfileformat', 'AlterAnyExternalJob', 'alteranyexternaljob', 'AlterAnyExternalLanguage', 'alteranyexternallanguage', 'AlterAnyExternalLibrary', 'alteranyexternallibrary', 'AlterAnyExternalStream', 'alteranyexternalstream', 'AlterAnyFulltextCatalog', 'alteranyfulltextcatalog', 'AlterAnyMask', 'alteranymask', 'AlterAnyMessageType', 'alteranymessagetype', 'AlterAnyRemoteServiceBinding', 'alteranyremoteservicebinding', 'AlterAnyRole', 'alteranyrole', 'AlterAnyRoute', 'alteranyroute', 'AlterAnySchema', 'alteranyschema', 'AlterAnySecurityPolicy', 'alteranysecuritypolicy', 'AlterAnySensitivityClassification', 'alteranysensitivityclassification', 'AlterAnyService', 'alteranyservice', 'AlterAnySymmetricKey', 'alteranysymmetrickey', 'AlterAnyUser', 'alteranyuser', 'AlterLedger', 'alterledger', 'AlterLedgerConfiguration', 'alterledgerconfiguration', 'Authenticate', 'authenticate', 'BackupDatabase', 'backupdatabase', 'BackupLog', 'backuplog', 'Checkpoint', 'checkpoint', 'Connect', 'connect', 'ConnectReplication', 'connectreplication', 'Control', 'control', 'CreateAggregate', 'createaggregate', 'CreateAnyDatabaseEventSession', 'createanydatabaseeventsession', 'CreateAssembly', 'createassembly', 'CreateAsymmetricKey', 'createasymmetrickey', 'CreateCertificate', 'createcertificate', 'CreateContract', 'createcontract', 'CreateDatabase', 'createdatabase', 'CreateDatabaseDdlEventNotification', 'createdatabaseddleventnotification', 'CreateDefault', 'createdefault', 'CreateExternalLanguage', 'createexternallanguage', 'CreateExternalLibrary', 'createexternallibrary', 'CreateFulltextCatalog', 'createfulltextcatalog', 'CreateFunction', 'createfunction', 'CreateMessageType', 'createmessagetype', 'CreateProcedure', 'createprocedure', 'CreateQueue', 'createqueue', 'CreateRemoteServiceBinding', 'createremoteservicebinding', 'CreateRole', 'createrole', 'CreateRoute', 'createroute', 'CreateRule', 'createrule', 'CreateSchema', 'createschema', 'CreateService', 'createservice', 'CreateSymmetricKey', 'createsymmetrickey', 'CreateSynonym', 'createsynonym', 'CreateTable', 'createtable', 'CreateType', 'createtype', 'CreateUser', 'createuser', 'CreateView', 'createview', 'CreateXmlSchemaCollection', 'createxmlschemacollection', 'Delete', 'delete', 'DropAnyDatabaseEventSession', 'dropanydatabaseeventsession', 'EnableLedger', 'enableledger', 'Execute', 'execute', 'ExecuteAnyExternalEndpoint', 'executeanyexternalendpoint', 'ExecuteAnyExternalScript', 'executeanyexternalscript', 'Insert', 'insert', 'KillDatabaseConnection', 'killdatabaseconnection', 'OwnershipChaining', 'ownershipchaining', 'References', 'references', 'Select', 'select', 'Showplan', 'showplan', 'SubscribeQueryNotifications', 'subscribequerynotifications', 'TakeOwnership', 'takeownership', 'Unmask', 'unmask', 'Update', 'update', 'ViewAnyColumnEncryptionKeyDefinition', 'viewanycolumnencryptionkeydefinition', 'ViewAnyColumnMasterKeyDefinition', 'viewanycolumnmasterkeydefinition', 'ViewAnySensitivityClassification', 'viewanysensitivityclassification', 'ViewCryptographicallySecuredDefinition', 'viewcryptographicallysecureddefinition', 'ViewDatabasePerformanceState', 'viewdatabaseperformancestate', 'ViewDatabaseSecurityAudit', 'viewdatabasesecurityaudit', 'ViewDatabaseSecurityState', 'viewdatabasesecuritystate', 'ViewDatabaseState', 'viewdatabasestate', 'ViewDefinition', 'viewdefinition', 'ViewLedgerContent', 'viewledgercontent', 'ViewPerformanceDefinition', 'viewperformancedefinition', 'ViewSecurityDefinition', 'viewsecuritydefinition']], state => Enum['Grant', 'grant', 'GrantWithGrant', 'grantwithgrant', 'Deny', 'deny'] }]]]
dsc_permissiontoinclude
Data type: Optional[Array[Struct[{ permission => Array[Enum['AdministerDatabaseBulkOperations', 'administerdatabasebulkoperations', 'Alter', 'alter', 'AlterAnyApplicationRole', 'alteranyapplicationrole', 'AlterAnyAssembly', 'alteranyassembly', 'AlterAnyAsymmetricKey', 'alteranyasymmetrickey', 'AlterAnyCertificate', 'alteranycertificate', 'AlterAnyColumnEncryptionKey', 'alteranycolumnencryptionkey', 'AlterAnyColumnMasterKey', 'alteranycolumnmasterkey', 'AlterAnyContract', 'alteranycontract', 'AlterAnyDatabaseAudit', 'alteranydatabaseaudit', 'AlterAnyDatabaseDdlTrigger', 'alteranydatabaseddltrigger', 'AlterAnyDatabaseEventNotification', 'alteranydatabaseeventnotification', 'AlterAnyDatabaseEventSession', 'alteranydatabaseeventsession', 'AlterAnyDatabaseEventSessionAddEvent', 'alteranydatabaseeventsessionaddevent', 'AlterAnyDatabaseEventSessionAddTarget', 'alteranydatabaseeventsessionaddtarget', 'AlterAnyDatabaseEventSessionDisable', 'alteranydatabaseeventsessiondisable', 'AlterAnyDatabaseEventSessionDropEvent', 'alteranydatabaseeventsessiondropevent', 'AlterAnyDatabaseEventSessionDropTarget', 'alteranydatabaseeventsessiondroptarget', 'AlterAnyDatabaseEventSessionEnable', 'alteranydatabaseeventsessionenable', 'AlterAnyDatabaseEventSessionOption', 'alteranydatabaseeventsessionoption', 'AlterAnyDatabaseScopedConfiguration', 'alteranydatabasescopedconfiguration', 'AlterAnyDataspace', 'alteranydataspace', 'AlterAnyExternalDataSource', 'alteranyexternaldatasource', 'AlterAnyExternalFileFormat', 'alteranyexternalfileformat', 'AlterAnyExternalJob', 'alteranyexternaljob', 'AlterAnyExternalLanguage', 'alteranyexternallanguage', 'AlterAnyExternalLibrary', 'alteranyexternallibrary', 'AlterAnyExternalStream', 'alteranyexternalstream', 'AlterAnyFulltextCatalog', 'alteranyfulltextcatalog', 'AlterAnyMask', 'alteranymask', 'AlterAnyMessageType', 'alteranymessagetype', 'AlterAnyRemoteServiceBinding', 'alteranyremoteservicebinding', 'AlterAnyRole', 'alteranyrole', 'AlterAnyRoute', 'alteranyroute', 'AlterAnySchema', 'alteranyschema', 'AlterAnySecurityPolicy', 'alteranysecuritypolicy', 'AlterAnySensitivityClassification', 'alteranysensitivityclassification', 'AlterAnyService', 'alteranyservice', 'AlterAnySymmetricKey', 'alteranysymmetrickey', 'AlterAnyUser', 'alteranyuser', 'AlterLedger', 'alterledger', 'AlterLedgerConfiguration', 'alterledgerconfiguration', 'Authenticate', 'authenticate', 'BackupDatabase', 'backupdatabase', 'BackupLog', 'backuplog', 'Checkpoint', 'checkpoint', 'Connect', 'connect', 'ConnectReplication', 'connectreplication', 'Control', 'control', 'CreateAggregate', 'createaggregate', 'CreateAnyDatabaseEventSession', 'createanydatabaseeventsession', 'CreateAssembly', 'createassembly', 'CreateAsymmetricKey', 'createasymmetrickey', 'CreateCertificate', 'createcertificate', 'CreateContract', 'createcontract', 'CreateDatabase', 'createdatabase', 'CreateDatabaseDdlEventNotification', 'createdatabaseddleventnotification', 'CreateDefault', 'createdefault', 'CreateExternalLanguage', 'createexternallanguage', 'CreateExternalLibrary', 'createexternallibrary', 'CreateFulltextCatalog', 'createfulltextcatalog', 'CreateFunction', 'createfunction', 'CreateMessageType', 'createmessagetype', 'CreateProcedure', 'createprocedure', 'CreateQueue', 'createqueue', 'CreateRemoteServiceBinding', 'createremoteservicebinding', 'CreateRole', 'createrole', 'CreateRoute', 'createroute', 'CreateRule', 'createrule', 'CreateSchema', 'createschema', 'CreateService', 'createservice', 'CreateSymmetricKey', 'createsymmetrickey', 'CreateSynonym', 'createsynonym', 'CreateTable', 'createtable', 'CreateType', 'createtype', 'CreateUser', 'createuser', 'CreateView', 'createview', 'CreateXmlSchemaCollection', 'createxmlschemacollection', 'Delete', 'delete', 'DropAnyDatabaseEventSession', 'dropanydatabaseeventsession', 'EnableLedger', 'enableledger', 'Execute', 'execute', 'ExecuteAnyExternalEndpoint', 'executeanyexternalendpoint', 'ExecuteAnyExternalScript', 'executeanyexternalscript', 'Insert', 'insert', 'KillDatabaseConnection', 'killdatabaseconnection', 'OwnershipChaining', 'ownershipchaining', 'References', 'references', 'Select', 'select', 'Showplan', 'showplan', 'SubscribeQueryNotifications', 'subscribequerynotifications', 'TakeOwnership', 'takeownership', 'Unmask', 'unmask', 'Update', 'update', 'ViewAnyColumnEncryptionKeyDefinition', 'viewanycolumnencryptionkeydefinition', 'ViewAnyColumnMasterKeyDefinition', 'viewanycolumnmasterkeydefinition', 'ViewAnySensitivityClassification', 'viewanysensitivityclassification', 'ViewCryptographicallySecuredDefinition', 'viewcryptographicallysecureddefinition', 'ViewDatabasePerformanceState', 'viewdatabaseperformancestate', 'ViewDatabaseSecurityAudit', 'viewdatabasesecurityaudit', 'ViewDatabaseSecurityState', 'viewdatabasesecuritystate', 'ViewDatabaseState', 'viewdatabasestate', 'ViewDefinition', 'viewdefinition', 'ViewLedgerContent', 'viewledgercontent', 'ViewPerformanceDefinition', 'viewperformancedefinition', 'ViewSecurityDefinition', 'viewsecuritydefinition']], state => Enum['Grant', 'grant', 'GrantWithGrant', 'grantwithgrant', 'Deny', 'deny'] }]]]
dsc_reasons
Data type: Optional[Array[Struct[{ phrase => Optional[String], code => Optional[String], }]]]
dsc_servername
Data type: Optional[String]
Parameters
The following parameters are available in the dsc_sqldatabasepermission
type.
dsc_credential
dsc_databasename
dsc_instancename
dsc_name
dsc_psdscrunascredential
dsc_timeout
name
validation_mode
dsc_credential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
dsc_databasename
namevar
Data type: String
dsc_instancename
namevar
Data type: String
dsc_name
namevar
Data type: String
dsc_psdscrunascredential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
dsc_timeout
Data type: Optional[Integer]
The maximum time in seconds to wait for the DSC resource to complete.
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 17.0.0
Properties
The following properties are available in the dsc_sqldatabaserole
type.
dsc_databaseisupdateable
Data type: Optional[Boolean]
Returns if the database is updatable. If the database is updatable, this will return $true
. Otherwise it will return $false
.
dsc_ensure
Data type: Optional[Enum['Present', 'present', 'Absent', '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
dsc_instancename
dsc_name
dsc_psdscrunascredential
dsc_timeout
name
validation_mode
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]] }]]
dsc_timeout
Data type: Optional[Integer]
The maximum time in seconds to wait for the DSC resource to complete.
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 17.0.0
Properties
The following properties are available in the dsc_sqldatabaseuser
type.
dsc_asymmetrickeyname
Data type: Optional[String]
Specifies the name of the asymmetric key to associate with the database user. This must be specified if parameter UserType is set to 'AsymmetricKey'
.
dsc_authenticationtype
Data type: Optional[String]
Returns the authentication type of the login connected to the database user. This will return either 'Windows'
, 'Instance'
, or 'None'
. The value 'Windows'
means the login is using Windows Authentication, 'Instance'
means that the login is using SQL Authentication, and 'None'
means that the database user have no login connected to it.
dsc_certificatename
Data type: Optional[String]
Specifies the name of the certificate to associate with the database user. This must be specified if parameter UserType is set to 'Certificate'
.
dsc_databaseisupdateable
Data type: Optional[Boolean]
Returns if the database is updatable. If the database is updatable, this will return $true
. Otherwise it will return $false
.
dsc_ensure
Data type: Optional[Enum['Present', 'present', 'Absent', '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', 'login', 'NoLogin', 'nologin', 'Certificate', 'certificate', 'AsymmetricKey', '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
dsc_force
dsc_instancename
dsc_name
dsc_psdscrunascredential
dsc_timeout
name
validation_mode
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]] }]]
dsc_timeout
Data type: Optional[Integer]
The maximum time in seconds to wait for the DSC resource to complete.
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 17.0.0
Properties
The following properties are available in the dsc_sqlendpoint
type.
dsc_endpointtype
Data type: Enum['DatabaseMirroring', 'databasemirroring', 'ServiceBroker', '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', 'present', 'Absent', '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', 'started', 'Stopped', 'stopped', 'Disabled', '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]] }]]
dsc_timeout
Data type: Optional[Integer]
The maximum time in seconds to wait for the DSC resource to complete.
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 17.0.0
Properties
The following properties are available in the dsc_sqlendpointpermission
type.
dsc_ensure
Data type: Optional[Enum['Present', 'present', 'Absent', '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', '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]] }]]
dsc_timeout
Data type: Optional[Integer]
The maximum time in seconds to wait for the DSC resource to complete.
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 17.0.0
Properties
The following properties are available in the dsc_sqllogin
type.
dsc_defaultdatabase
Data type: Optional[String]
Specifies the default database name.
dsc_disabled
Data type: Optional[Boolean]
Specifies if the login is disabled. Default value is $false
.
dsc_ensure
Data type: Optional[Enum['Present', 'present', 'Absent', '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. 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.
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.
dsc_logintype
Data type: Optional[Enum['WindowsUser', 'windowsuser', 'WindowsGroup', 'windowsgroup', 'SqlLogin', 'sqllogin', 'Certificate', 'certificate', 'AsymmetricKey', 'asymmetrickey', 'ExternalUser', 'externaluser', 'ExternalGroup', '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
dsc_logincredential
dsc_name
dsc_psdscrunascredential
dsc_timeout
name
validation_mode
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]] }]]
dsc_timeout
Data type: Optional[Integer]
The maximum time in seconds to wait for the DSC resource to complete.
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 17.0.0
Properties
The following properties are available in the dsc_sqlmaxdop
type.
dsc_dynamicalloc
Data type: Optional[Boolean]
If set to $true
then max degree of parallelism will be dynamically configured. When this is set parameter is set to $true
, the parameter MaxDop must be set to $null
or not be configured.
dsc_ensure
Data type: Optional[Enum['Present', 'present', 'Absent', '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]] }]]
dsc_timeout
Data type: Optional[Integer]
The maximum time in seconds to wait for the DSC resource to complete.
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 17.0.0
Properties
The following properties are available in the dsc_sqlmemory
type.
dsc_dynamicalloc
Data type: Optional[Boolean]
If set to $true
then max memory will be dynamically configured. When this parameter is set to $true
, the parameter MaxMemory must be set to $null
or not be configured. Default value is $false
.
dsc_ensure
Data type: Optional[Enum['Present', 'present', 'Absent', '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.
[17.0.0] - 2024-09-30
Added
- SqlSetup
- Added new parameter ProductCoveredbySA which is introduced in SQL 2022.
Added
Connect-SqlDscDatabaseEngine
- Added integration test for the command.
Uninstall-SqlDscServer
- Added integration test for the command.
Changed
-
SqlScript
- BREAKING CHANGE: The parameter
Id
is now required to allow reuse of a script with different variables. Set this to a unique value. The information entered is never used to actually run the script. (issue #596). - Fix unit test to fully check Set-TargetResource using timeout.
- BREAKING CHANGE: The parameter
-
SqlScriptQuery
- BREAKING CHANGE: The parameter
Id
is now required to allow reuse of a script with different variables. Set this to a unique value. The information entered is never used to actually run the script. (issue #596). - Fix unit test to fully check Set-TargetResource using timeout.
- BREAKING CHANGE: The parameter
-
SqlServerDsc
- Replaced inline task
Package_Wiki_Content
with the one now available in the module DscResource.DocGenerator.
- Replaced inline task
-
Connect-SqlDscDatabaseEngine
- Update comment-based help with more examples.
-
SqlSetup
- The parameter
SecurityMode
now only (correctly) allows the valueSQL
(issue #1185).
- The parameter
Fixed
- SqlServerDsc
- Fix issue template.
Connect-SqlDscDatabaseEngine
- Comment-based help for parameter
LoginType
was corrected. - An integration test now runs to test the command.
- Comment-based help for parameter
- SqlAudit
- Fixed unit tests.
- SqlDatabaseMail
- Fix unit test, removing
Assert-VerifiableMock
that was left over from Pester 5 conversion.
- Fix unit test, removing
Dependencies
- puppetlabs/pwshlib (>= 1.2.0 < 2.0.0)