Hello,
We have an issue after upgrade Exchange 2013 RTM to Exchange 2013 SP1 or CU6(15.00.0995.017).
1. Run the cmdlet “get-mailboxpermission | select”. It successfully returns valid values.
2. And then we run the following code to check whether a group has “FullAccess” of a mailbox.
But the “MailboxRights” cannot be accessed.
===========cut===========================
//check "The group" has "FullAccess" of a mailbox
public bool CheckPermissionOfMailbox(string sMbxName, string sGroupName)
{
bool bRet = false;
string strAccessRights = "";
try
{
string strCommand = "Get-MailboxPermission -Identity \"" + sMbxName +"\" -user \"" + sGroupName + "\" | select AccessRights";
ICollection<PSObject> mshObjCollection = CmdletWrapper.Invoke(strCommand);
foreach (PSObject obj in mshObjCollection)
{
foreach (Object foo in (Microsoft.Exchange.Management.RecipientTasks.MailboxRights[])obj.Properties["AccessRights"].Value)
{
strAccessRights = foo.ToString();
if (strAccessRights.Contains("FullAccess"))
{
bRet = true;
break;
}
}
}
catch (Exception e)
{
// Error handling
}
}
return bRet;
}
===========cut===========================
This code can run successfully in Exchange 2013 RTM, but fails in Exchange 2013SP1 and CU6.
Please help to check this issue and whether you will fix it in CU6.
Thanks.
We have an issue after upgrade Exchange 2013 RTM to Exchange 2013 SP1 or CU6(15.00.0995.017).
1. Run the cmdlet “get-mailboxpermission | select”. It successfully returns valid values.
2. And then we run the following code to check whether a group has “FullAccess” of a mailbox.
But the “MailboxRights” cannot be accessed.
===========cut===========================
//check "The group" has "FullAccess" of a mailbox
public bool CheckPermissionOfMailbox(string sMbxName, string sGroupName)
{
bool bRet = false;
string strAccessRights = "";
try
{
string strCommand = "Get-MailboxPermission -Identity \"" + sMbxName +"\" -user \"" + sGroupName + "\" | select AccessRights";
ICollection<PSObject> mshObjCollection = CmdletWrapper.Invoke(strCommand);
foreach (PSObject obj in mshObjCollection)
{
foreach (Object foo in (Microsoft.Exchange.Management.RecipientTasks.MailboxRights[])obj.Properties["AccessRights"].Value)
{
strAccessRights = foo.ToString();
if (strAccessRights.Contains("FullAccess"))
{
bRet = true;
break;
}
}
}
catch (Exception e)
{
// Error handling
}
}
return bRet;
}
===========cut===========================
This code can run successfully in Exchange 2013 RTM, but fails in Exchange 2013SP1 and CU6.
Please help to check this issue and whether you will fix it in CU6.
Thanks.