listperms.vbs

来自「Apress - Managing Enterprise Systems Wit」· VBS 代码 · 共 21 行

VBS
21
字号
'listperms.vbs
'lists all permissions for a specified Active Directory object
Dim objSecurity, objArgs
Dim objContainer, objDACL , objACE 
If Wscript.Arguments.Count <> 1 Then
  Wscript.Echo "Usage: listperms ADPath"
End If

 Set objACE = CreateObject("AccessControlEntry")
 'get a reference to users container
 Set objContainer = GetObject(Wscript.Arguments (0)) 
  Set objSecurity = objContainer.Get("ntSecurityDescriptor")
Set objDACL = objSecurity.DiscretionaryAcl

 For Each objACE In objDACL
   Wscript.Echo objACE.Trustee & ", " & objACE.AceFlags & _ 
     ", " & objACE.AceType & ", " & objACE.Flags & ", " & _ 
     objACE.AccessMask  & ", " & objACE.ObjectType & ", " & _
     objACE.InheritedObjectType 
 Next

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?