Click an Ad

If you find this blog helpful, please support me by clicking an ad!

Monday, November 19, 2012

Purging deleted users from Public Folder ACLs (Delete NT User: Generic SIDs)

We are on Exchange 2010 and still have a ton of public folders (yes yes, we'd love them to die off, probably more than Microsoft, but what are you going to do?). We've been combing through all of our event logs, which had previously not bee done, and are resolving various error messages. One we ran across in our Exchange server's application log is:

Event ID: 2028
Transport Delivery MSExchange Public Store
The delivery of a message sent by public folder AFEFE2D3A4AAE242A27C26178911274C-000005387E74 has failed
To: Someuser

While investigating this, we found that a lot of our public folders had hanging SIDs, which are the "NT USER:S-1-5-93859384-1394871948 like entries you see on an ACL when that user has been deleted from Active Directory. 

Fixing all of these hanging SIDs from each public folder would be a nightmare if done manually (we have several hundred public folders). Powershell should be able to handle this! And did it ever. In one line:

get-publicfolder "\" -recurse -resultsize unlimited | get-publicfolderclientpermission | where {$_.user -like "NT User:S-1-*"} | % {remove-publicfolderclientpermission -identity $_.identity -user $_.user -access $_.accessrights -confirm:$true}

1 comment:

  1. Thanks for the cmdled!
    Saved me a lot of time

    ReplyDelete