Skip to content

Instantly share code, notes, and snippets.

@Kaidja
Created July 6, 2021 18: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 Kaidja/8870599fdaff69132ac54f056b069a23 to your computer and use it in GitHub Desktop.
Save Kaidja/8870599fdaff69132ac54f056b069a23 to your computer and use it in GitHub Desktop.
Configuration DENYSYSTEMACCOUNTPERMISSIONS
{
Import-DscResource –ModuleName 'AccessControlDSC' -ModuleVersion 1.4.1
Node ConfigurePrintSpoolerFolderPermissions {
NTFSAccessEntry SpoolDriversFolder
{
AccessControlList = @(
NTFSAccessControlList
{
Principal = "System"
ForcePrincipal = $true
AccessControlEntry = @(
NTFSAccessControlEntry
{
AccessControlType = 'Deny'
FileSystemRights = 'Modify'
Inheritance = 'This folder and files'
Ensure = 'Present'
}
)
}
)
Path = "C:\Windows\System32\spool\drivers"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment