0 votes

I have been testing different methods to do this with a powershell script, and it doesn't seem like the most reliable method with my limited PowerShell scripting capabilities. I was wondering if anyone has a script or a method to automate disabling an exchange mailbox as a custom task so we don't have to go to the user account > Exchange Tasks > Delete Mailbox (I'm aware that this does not automatically delete and is actually a disable mailbox task).

Ideally we would be able to just leverage that Exchange Tasks > Delete Mailbox task as a custom task for automated user deprovisioning.

Thanks!
Chris

by (270 points)

1 Answer

0 votes
by (272k points)
selected by
Best answer

Hello,

Use the following PowerShell script:

$Context.TargetObject.DeleteMailbox()
0

Thanks, that should be super useful and simple. However when running that against a user with a mailbox I get the following error.

""Closing remote server shell instance failed with the following error message : The page cannot be displayed because an internal server error has occurred. For more information, see the about_Remote_Troubleshooting Help topic."

Is this an exchange error or an ADAxes error?

0

Hello,

The error occurrs when trying to connect to your Exchange Server. What about other Exchange Tasks in the AD domain of the user: do they return the same error or not? What about viewing the user's Exchange Properties in Adaxes?

0

I was able to run the Delete Mailbox command from the Exchange Tasks menu of the user without error and I can view the Exchange Properties of users.

0

For further troubleshooting, provide the following details:

  1. What version of Exchange are you using?

  2. Did you add anything to the script or you used only the line we provided?

  3. Enable tracing of commands sent to Exchange Servers, execute the Delete Mailbox command from the Exchange Tasks menu, run the sript and then send the log file to our Support email (support@adaxes.com). For information on how to do that, see the following help article: http://www.adaxes.com/help/?HowDoI.Perf ... uests.html.

  4. Check user account specified during the domain registration. To do so:

    • Launch Adaxes Administration Console.
    • Expand Adaxes service node and then expand Active Directory node.
    • Right-click the domain and click Change Logon Information.
    • Check roles assigned for the user in Exchange. To do so, check the following article: http://msexchangeguru.com/2015/12/18/rbac-2016/.
  5. Send a copy of Adaxes Event Log to our Support email.

0

Hello,

Use the following PowerShell script:

$Context.TargetObject.DeleteMailbox()

Looks like this actually did end up working, I'm not sure what was going on in our environment, but this did the trick. After enabling logging and trying this again the script worked.

Thanks so much

Related questions

0 votes
1 answer

Hello - We are currently doing a trail of Adaxes and really like it so far. However the one issue we can't seem to figure out is how to set the Address Book Policy ... t seem to work. Is there something different we need to do since it's Hybrid? Thanks.

asked Aug 20, 2019 by SASi (50 points)
0 votes
1 answer

Last night I attempted to upgrade from 2012.01 to 2013.2. Other than losing my logs (fixed by a snapshot revert and backing up the logs) this process ... Is there any way to indicate the preferred method of communicating with particular Exchange environment?

asked Mar 20, 2014 by SomeUser (90 points)
0 votes
1 answer

Hello, I'm trying to create a daily scheduled task that runs that automatically disables users AD accounts who havent logged in to the domain in 45 days. At the same time ... inactivity period but it appears to only allow me to select weeks instead of days.

asked Apr 14, 2020 by sirslimjim (480 points)
0 votes
1 answer

Is it possible to disable then re-enable a Business Rule from a Scheduled Task? For example, when the Scheduled tasks starts, it disables a Business Rule, runs the Task(s), then re-enables the Business Rule when done.

asked May 11, 2016 by Kikaida (1.1k points)
0 votes
0 answers

I have a deprovision task that our desktop support staff uses to terminate a user and want to setup a scheduled task that goes through and looks for users who are past their ... to the current date it is still applied to ALL users in the organization. Why?

asked May 16, 2013 by trscott (80 points)
3,348 questions
3,049 answers
7,791 comments
545,056 users