Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Exchange
2000.active.directory
2000.admin
2000.announcements
2000.app.conversion
2000.applications
2000.clients
2000.clustering
2000.connectivity
2000.development
2000.documentation
2000.general
2000.information.store
2000.interop
2000.kms
2000.misc
2000.protocols
2000.realtime.collabo.
2000.setup
2000.transport
2000.win2000
admin
application.conversion
applications
clients
clustering
connectivity
design
development
misc
mobility
setup
tools
  
 
date: 12 Mar 2007 09:14:48 -0700,    group: microsoft.public.exchange.development        back       


Audit mailbox rights msExchMailboxSecurityDescriptor   
I'm using the following to audit mailbox rights. However, this is per
user, I need to specify the dn for each account that I wish to export
the rights from. Does anybody know a method to get this to do all
accounts in my domain? Thanks


James Chong (MVP)
MCSE | M+, S+, MCTS, Security+
msexchangetips.blogspot.com



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


set objuser = getobject("LDAP://your-user-DN")
Set oSecurityDescriptor =
objuser.Get("msExchMailboxSecurityDescriptor")
Set dacl = oSecurityDescriptor.DiscretionaryAcl
Set ace = CreateObject("AccessControlEntry")
For Each ace In dacl
mystring = ace.Trustee


' ----ACE TYPE-----
If (ace.AceType = ADS_ACETYPE_ACCESS_ALLOWED) Then
 wscript.echo mystring & " is allowed:"
ElseIf (ace.AceType = ADS_ACETYPE_ACCESS_DENIED) Then
 wscript.echo mystring & " is denied:"
End If


' ----ACE MASK----
If (ace.AccessMask And RIGHT_DS_SEND_AS) Then
 wscript.echo mystring & " -send mail as"
End If


If (ace.AccessMask And RIGHT_DS_CHANGE) Then
 wscript.echo mystring & " -modify user attributes"
End If


If (ace.AccessMask And RIGHT_DS_DELETE) Then
 wscript.echo mystring & " -delete mailbox store"
End If


If (ace.AccessMask And RIGHT_DS_READ) Then
 wscript.echo mystring & " -read permissions"
End If
If (ace.AccessMask And RIGHT_DS_TAKE_OWNERSHIP) Then
 wscript.echo mystring & " -take ownership of this object"
End If
If (ace.AccessMask And RIGHT_DS_MAILBOX_OWNER) Then
 wscript.echo mystring & " -is mailbox owner of this object"
End If
If (ace.AccessMask And RIGHT_DS_PRIMARY_OWNER) Then
 wscript.echo mystring & " -is mailbox Primary owner of this object"
End If


Next
date: 12 Mar 2007 09:14:48 -0700   author:   jamestechman

RE: Audit mailbox rights msExchMailboxSecurityDescriptor   
Hi
have a look at this
http://msdn2.microsoft.com/en-us/library/aa746471.aspx

Henry

"jamestechman" wrote:

> I'm using the following to audit mailbox rights. However, this is per
> user, I need to specify the dn for each account that I wish to export
> the rights from. Does anybody know a method to get this to do all
> accounts in my domain? Thanks
> 
> 
> James Chong (MVP)
> MCSE | M+, S+, MCTS, Security+
> msexchangetips.blogspot.com
> 
> 
> 
> 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
> 
> 
> set objuser = getobject("LDAP://your-user-DN")
> Set oSecurityDescriptor =
> objuser.Get("msExchMailboxSecurityDescriptor")
> Set dacl = oSecurityDescriptor.DiscretionaryAcl
> Set ace = CreateObject("AccessControlEntry")
> For Each ace In dacl
> mystring = ace.Trustee
> 
> 
> ' ----ACE TYPE-----
> If (ace.AceType = ADS_ACETYPE_ACCESS_ALLOWED) Then
>  wscript.echo mystring & " is allowed:"
> ElseIf (ace.AceType = ADS_ACETYPE_ACCESS_DENIED) Then
>  wscript.echo mystring & " is denied:"
> End If
> 
> 
> ' ----ACE MASK----
> If (ace.AccessMask And RIGHT_DS_SEND_AS) Then
>  wscript.echo mystring & " -send mail as"
> End If
> 
> 
> If (ace.AccessMask And RIGHT_DS_CHANGE) Then
>  wscript.echo mystring & " -modify user attributes"
> End If
> 
> 
> If (ace.AccessMask And RIGHT_DS_DELETE) Then
>  wscript.echo mystring & " -delete mailbox store"
> End If
> 
> 
> If (ace.AccessMask And RIGHT_DS_READ) Then
>  wscript.echo mystring & " -read permissions"
> End If
> If (ace.AccessMask And RIGHT_DS_TAKE_OWNERSHIP) Then
>  wscript.echo mystring & " -take ownership of this object"
> End If
> If (ace.AccessMask And RIGHT_DS_MAILBOX_OWNER) Then
>  wscript.echo mystring & " -is mailbox owner of this object"
> End If
> If (ace.AccessMask And RIGHT_DS_PRIMARY_OWNER) Then
>  wscript.echo mystring & " -is mailbox Primary owner of this object"
> End If
> 
> 
> Next
> 
>
date: Tue, 13 Mar 2007 05:27:20 -0700   author:   Henry

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us