-
-
Save jeffpatton1971/d1756016a2d5ad27843f to your computer and use it in GitHub Desktop.
sqldsc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ConfigurationData = | |
@{ | |
AllNodes = | |
@( | |
@{ | |
NodeName = "it08082"; | |
ActionAccount = "DOMAIN\SqlDefaultAction_sa" | |
LowPrivGroup = "DOMAIN\SqlMPLowPriv" | |
Registry = "HKLM:\Software\Microsoft\Microsoft SQL Server\" | |
PSDscAllowPlainTextPassword = $true | |
} | |
); | |
} | |
Configuration SQLLowPrivRegistry | |
{ | |
param | |
( | |
[string[]] $ComputerName = "localhost" | |
) | |
Import-DscResource -Module PowerShellAccessControl | |
Node $ComputerName | |
{ | |
cAccessControlEntry TopLevelActionAccountPermissions | |
{ | |
Ensure = "Present" | |
Path = "HKLM:\Software\Microsoft\Microsoft SQL Server\" | |
ObjectType = "RegistryKey" | |
AceType = "AccessAllowed" | |
AccessMask = ([System.Security.AccessControl.RegistryRights]::ReadKey) | |
Principal = "DOMAIN\SqlDefaultAction_sa" | |
} | |
} | |
} | |
SQLLowPrivRegistry -ConfigurationData $ConfigurationData | |
Start-DscConfiguration -Path .\SQLLowPrivRegistry -Wait -Verbose | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment