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:
- # 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
}
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