Jakub Krupa
Jakub Krupa

Reputation: 67

Returning unique User ID from Get-MailboxFolderPermission cmdlet

I'm currently trying to prepare some automation using Exchange PowerShell commandlets. I've faced some problem.

When running Get-MailboxFolderPermission cmdlet on Exchange server it's returning results, but 'User' field in resultset looks like DisplayName of the user. It's not unique and I need solution that returns unique user identifier (like SamAccountName or UserPrincipalName).

Following this post - https://serverfault.com/questions/503014/how-to-get-mailbox-folder-permissions-with-samaccountname-or-upn - I was able to use User.ADRecipient.UserPrincipalName property, but it looks that it is available only on Exchange 2013 instance, and can't be used on earlier Exchange versions.

I've also found some PowerShell function (http://pastebin.com/MQPLJ5pC) which is resolving DisplayName into unique user identifier.

It looks like it's possible to tie it all together, but I'm wondering if there is some simpler way achieving it.

I'm interested in solution that works on Exchange 2007, 2010 and 2013.

Any help is really appreciated.

Upvotes: 2

Views: 1551

Answers (1)

smwk
smwk

Reputation: 218

The User.ADRecipient.UserPrincipalName property works on Exchange 2010 also. The get-MailboxFolderPermission cmd does not exist for Exchange 2007 so you would need to look into EWS for something universal.

Upvotes: 2

Related Questions