Skip to content

Instantly share code, notes, and snippets.

@jeffpatton1971
Created July 3, 2014 13:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeffpatton1971/d1756016a2d5ad27843f to your computer and use it in GitHub Desktop.
Save jeffpatton1971/d1756016a2d5ad27843f to your computer and use it in GitHub Desktop.
sqldsc
$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