Re: Registry ACL
- From: "yeahh" <nospam@xxxxxxxx>
- Date: Sat, 19 Nov 2005 01:54:13 -0500
Get lost.
People own the key to all their environments.
"Jose Cintron" <l0rddarkf0rce@xxxxxxxxxxx> wrote in message
news:efZ3rLw6FHA.3544@xxxxxxxxxxxxxxxxxxxxxxx
> Hello all...
>
> Is there a way to obtain the ACL for a specific registry key? I'm have a
> script that does this for files
>
> === code to dump file/dir ACL ===
> Function DumpACL(fname)
> ' Get the target file's or folder's security settings.
> Set wmiSecuritySettings = wmiServices.Get
> ("Win32_LogicalFileSecuritySetting.Path='" & fname & "'")
>
> ' Step 3: Retrieve the file's or folder's Security Descriptor from the
> security settings.
> intRetVal =
> wmiSecuritySettings.GetSecurityDescriptor(wmiSecurityDescriptor)
>
> ' Get the SD's owner, which a Win32_Trustee instance represents.
> Set wmiOwner = wmiSecurityDescriptor.Owner
>
> If (Trim(UCase(wmiOwner.Domain)) = "BUILTIN") Then
> wmiOwner.Domain = "localhost"
> end if
>
> If (ToScreen) Then
> WScript.Echo fname & " (Owner: " & wmiOwner.Domain & "\" &
> wmiOwner.Name & ")"
> Else
> objTextFile.WriteLine(fname & " (Owner: " & wmiOwner.Domain &
"\"
> & wmiOwner.Name & ")")
> End if
>
> If CONTROL_FLAGS("SE_DACL_PRESENT") And _
> wmiSecurityDescriptor.ControlFlags Then
> arrDacl = wmiSecurityDescriptor.DACL
>
> For Each wmiAce In arrDacl
> Set wmiTrustee = wmiAce.Trustee
> If Not (Trim(UCase(wmiTrustee.Domain)) = "") Then
> wmiTrustee.Domain = wmiTrustee.Domain + "\"
> end if
>
> blnFirstValue = True
> For Each Key In ACCESS_MASK.Keys
> If ACCESS_MASK(Key) And wmiAce.AccessMask Then
> If blnFirstValue = True Then
> blnFirstValue = False
> permissions = " " + ACE_TYPE(wmiAce.AceType) + ": "+ Key
> Else
> permissions = permissions + ", " + Key
> End If
> End If
> Next
>
> If (ToScreen) Then
> WScript.Echo " " & wmiTrustee.Domain & wmiTrustee.Name &
> permissions
> Else
> objTextFile.WriteLine(" " & wmiTrustee.Domain &
> wmiTrustee.Name & permissions)
> End if
> Next
> End If
> End function
> === code to dump file/dir ACL ===
>
> but I have not found a way to do this for registry keys. Any help will be
> gratly appreciated
>
>
.
- Prev by Date: Re: Default Gateway is static - objNetAdapter.EnableDHCP()
- Next by Date: Re: ADs search string to get members of the group
- Previous by thread: Re: Registry permissions
- Next by thread: Re: Registry ACL
- Index(es):
Relevant Pages
|