user3347175
user3347175

Reputation:

How to run the PowerShell cmdlet "Disable-ADSyncExportDeletionThreshold"?

I want to delete Office 365 users from Active Directory PowerShell in Windows Server 2008 (x64)

There is a treshold so you can't delete more than 500 users.

Microsoft has a documentation to prevent accidetal deletes and it says "just run Disable-ADSyncExportDeletionThreshold" command and it's OK.

But I have a problem. When I try to disable treshold, PowerShell says:

    The term 'Disable-ADSyncExportDeletionThreshold' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try aga
in.
At line:1 char:38
+ Disable-ADSyncExportDeletionThreshold <<<<
    + CategoryInfo          : ObjectNotFound: (Disable-ADSyncExportDeletionThreshold:String) [], CommandNotFoundExcept
   ion
    + FullyQualifiedErrorId : CommandNotFoundException

Also I tried to import "ADSync" but module couldn't loaded.

Any solution?

Thanks.

Upvotes: 0

Views: 8090

Answers (2)

Bifeng Dong - MSFT
Bifeng Dong - MSFT

Reputation: 408

Above answer is great.

I would suggest that you disable it temporarily and enable it afterwards as it's enabled by default to prevent lots of deletions to be exported to Azure AD. This helps to prevent from deleting accidentally.

Import module first:

enter image description here

If all the deletes are desired, then do the following:

  1. To temporarily disable this protection and let those deletes go through, run the PowerShell cmdlet:

Disable-ADSyncExportDeletionThreshold

. 2. Provide an Azure AD Global Administrator account and password.

enter image description here 3. With the Azure Active Directory Connector still selected, select the action Run and select Export.
enter image description here 4. To re-enable the protection, run the PowerShell cmdlet:

Enable-ADSyncExportDeletionThreshold

. enter image description here

Upvotes: 0

4c74356b41
4c74356b41

Reputation: 72181

Disable-ADSyncExportDeletionThreshold is a commandlet for AAD Connect, you have to have AADConnect module installed and imported for it to work. Try Import-Module “C:\Program Files\Microsoft Azure AD Sync\Bin\ADSync\ADSync.psd1” if its not there, install it.

Also, take a look here.

Upvotes: 1

Related Questions