0 votes

I want to disable exchange mail account via script. This script will run in custom command.

I write a script like this.

"Disable-Mailbox -identity %mailNickname% -confirm:$false"

But i get an error message "The term disable-mailbox is not recognized as the name of a cmdlet ....."

I think that I must import a module that it is recognize this command.

Any one suggest something

Thanks in advanced.

by (40 points)

1 Answer

0 votes
by (215k points)

Hello Erkan,

Starting from Adaxes 2013.1, you can access Exchange functions with Adaxes ADSI API. To disable the Exchange mailbox of the user, on which the Custom Command is executed, you can use the following script:

$Context.TargetObject.DeleteMailbox()

Related questions

0 votes
1 answer

I'm in the process of creating a Web interface for requesting IT accounts. Upon submission, I want to run a Powershell script that will create an item in a Sharepoint task list.

asked May 14, 2021 by sandramnc (820 points)
0 votes
1 answer

Or is there another solution to solve this?

asked Sep 15 by boris (60 points)
0 votes
1 answer

We are currently working on automating the property patterns. So far we were able to add all the needed properties to a Property Pattern via PowerShell script apart from the ... 't quite match the "should be" screenshot. Any help would be much appriciated.

asked Apr 30, 2020 by MichaelM (60 points)
0 votes
1 answer

Currently, when I disable a user account in Adaxes, the group memberships of the user remain intact. I'd like to automate the removal of group memberships such as distribution ... a list of groups/DL that the user was previously in and removed from. Thanks!

asked Nov 3, 2021 by jayden.ang (20 points)
0 votes
0 answers

usually we have to set up users account with access to many share mailbox. However, the time consuption adding those emails one by one it is too much as we needs to sep up many users in one day and that task can take from 10 minutes to an hour.

asked Apr 29, 2021 by Sandovis (20 points)
2,807 questions
2,541 answers
6,615 comments
65,754 users