Fixed: When deleting an exchange user the operations failed with "Cannot delete
object when there are leaf objects Ensure activesync devices are removed before deleting or disabling a mailbox
This commit is contained in:
parent
12d0e687f1
commit
0ecd34363a
2 changed files with 54 additions and 0 deletions
|
@ -487,10 +487,13 @@ namespace WebsitePanel.Providers.HostedSolution
|
|||
|
||||
string addressbookPolicy = ObjToString(GetPSObjectProperty(result[0], "AddressBookPolicy"));
|
||||
|
||||
RemoveDevicesInternal(runSpace, id);
|
||||
|
||||
cmd = new Command("Disable-Mailbox");
|
||||
cmd.Parameters.Add("Identity", id);
|
||||
cmd.Parameters.Add("Confirm", false);
|
||||
ExecuteShellCommand(runSpace, cmd);
|
||||
|
||||
|
||||
if (addressbookPolicy == (upn + " AP"))
|
||||
{
|
||||
|
@ -552,6 +555,8 @@ namespace WebsitePanel.Providers.HostedSolution
|
|||
string upn = ObjToString(GetPSObjectProperty(result[0], "UserPrincipalName"));
|
||||
string addressbookPolicy = ObjToString(GetPSObjectProperty(result[0], "AddressBookPolicy"));
|
||||
|
||||
RemoveDevicesInternal(runSpace, accountName);
|
||||
|
||||
RemoveMailbox(runSpace, accountName);
|
||||
|
||||
if (addressbookPolicy == (upn + " AP"))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue