Windows Privileges - moved util code to it's own C# util (#48897)

* Windows Privileges - moved util code to it's own C# util

* Rename Enabler class to PrivilegeEnabler to remove ambiguity

* rename Utils to PrivilegeUtil

* fix missing util name changes
This commit is contained in:
Jordan Borean
2018-12-14 12:00:46 +10:00
committed by GitHub
parent 695feea541
commit 4019d4f6d1
9 changed files with 811 additions and 488 deletions

View File

@@ -61,7 +61,6 @@ Function SetPrivilegeTokens() {
# This also sets us up for setting the owner as a feature.
# See the following for details of each privilege
# https://msdn.microsoft.com/en-us/library/windows/desktop/bb530716(v=vs.85).aspx
Import-PrivilegeUtil
$privileges = @(
"SeRestorePrivilege", # Grants all write access control to any file, regardless of ACL.
"SeBackupPrivilege", # Grants all read access control to any file, regardless of ACL.

View File

@@ -295,7 +295,6 @@ if ($hive) {
Add-Type -TypeDefinition $registry_util
$env:TMP = $original_tmp
Import-PrivilegeUtil
try {
Set-AnsiblePrivilege -Name SeBackupPrivilege -Value $true
Set-AnsiblePrivilege -Name SeRestorePrivilege -Value $true