Exchange calendar p...
 
Notifications
Clear all

Exchange calendar permissions - wrong resolving

2 Posts
2 Users
0 Reactions
1,385 Views
Posts: 13
Topic starter
(@jacolex)
Eminent Member
Joined: 8 years ago

Hello

There is a bug with resolving user permisisons to calendar and contacts folders. the problem is that Get-MailboxFolderPermission gets user display names, which can be duplicated. When this case is occuring, the added user permission is not showing in user Permissions Panel. This is problem with Exchange cmdlet, which should return for example alias. I found some solution:

http://pastebin.com/MQPLJ5pC

 

  • # We need to resolve the DisplayName into UserPrincipalName for each entry

 
                # So iterate over each of the entries
                foreach ($ace in $ACL)
                {
                        $UserObject = $null
                        [string] $upn = ""
                        # Find all users that match this displayname
                        [array] $MatchUsers = get-user $ace.user.displayname
                        if ($MatchUsers.count -eq 1)
                        {
                                # Okay no worries!
                                $UserObject = $MatchUsers[0]
                                $upn = $UserObject.UserPrincipalName
                        } else {
                                foreach ($userobj in $MatchUsers) {
                                        # Do a lookup for each to check
                                        $lookup = $identity |
                                                get-mailboxfolderpermission -user $userobj.userPrincipalName -EA SilentlyContinue
                                        if ($lookup -ne $null -and $lookup.AccessRights[0] -eq $ace.AccessRights[0]) {
                                                $UserObject = $userobj
                                                $upn = $UserObject.UserPrincipalName
                                        }
                                }
                        }

                        if ($upn -eq "" -or $userObject -eq $null) {
                                Write-Warning ("Could not find a match for: " + $ace.user.displayname)
                                continue
                        }

1 Reply
Posts: 1457
Admin
(@trobinson)
Noble Member
Joined: 9 years ago

Hello,

 

Thats a great point and thankyou for a solution. I have sent this information over to a developer for them to check and make the changes.

 

Kind Regards,

 

Trevor Robinson

Reply
Share: