-
-
Save ykfq/9a0f45ceba2ef2f9f23af99bc0cf50e2 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