Created
March 21, 2016 23:58
-
-
Save bill-long/0e5f62a9cdc5f9a7fc8b to your computer and use it in GitHub Desktop.
Dump msExchMailboxSecurityDescriptor as SDDL format. Useful if you need to inspect the raw ACL.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
param($alias) | |
$searcher = [System.DirectoryServices.ActiveDirectory.Forest]::GetCurrentForest().FindGlobalCatalog().GetDirectorySearcher() | |
$searcher.Filter = "(mailnickname=$alias)" | |
$user = $searcher.FindOne() | |
$mbxSd = $user.Properties["msExchMailboxSecurityDescriptor"][0] | |
$sd = New-Object System.Security.AccessControl.RawSecurityDescriptor([byte[]]$mbxSd, 0) | |
$sd.GetSddlForm("All") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment