VBScript: read Exchange 2003 mailbox permissions

Some time ago I made a VBScript to read the Exchange mailbox permissions, as stored in the msExchMailboxSecurityDescriptor property of a user object. This time the script is more targeted towards reading which user account have full mailbox access, and exporting them to a CSV file:
strUserODN = wscript.arguments(0)
strOutput = wscript.arguments(1)
strDomainController = wscript.arguments(2)
Const RIGHT_DS_DELETE = &H10000
Const RIGHT_DS_READ = &H20000
Const RIGHT_DS_CHANGE = &H40000
Const RIGHT_DS_TAKE_OWNERSHIP = &H80000
Const RIGHT_DS_MAILBOX_OWNER = &H1
Const RIGHT_DS_SEND_AS = &H2
Const RIGHT_DS_PRIMARY_OWNER = &H4< Const ADS_ACETYPE_ACCESS_ALLOWED = &H0 Const ADS_ACETYPE_ACCESS_DENIED = &H1 set fso = CreateObject(“Scripting.FileSystemObject”) set csvOutput = fso.CreateTextFile(strOutput, true) Set objSdUtil = GetObject(“LDAP://” & strDomainController & “/” & strUserODN & “”)  Set objsd = objSdUtil.Get(“msExchMailboxSecurityDescriptor”) Set objDACL = objsd.DiscretionaryAcl For Each objACE in objDACL if (objACE.AccessMask and RIGHT_DS_MAILBOX_OWNER) then  if (objACE.AccessMask and RIGHT_DS_READ) then csvOutput.WriteLine objAce.Trustee end if end if Next

Geschreven door:

Arnout van der Vorst

Arnout van der Vorst is Identity Management Architect bij Tools4ever en al ruim 10 jaar in dienst. Arnout legt zich als Architect toe op het bedenken en ontwikkelen van nieuwe features, oplossingen en diensten van Tools4ever die aansluiten op de vraag uit de markt. Arnout studeerde Hogere Informatica aan de Hogeschool van Utrecht.
Terug