简体   繁体   中英

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.

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 .

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:

在此处输入图片说明

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.

在此处输入图片说明 3. With the Azure Active Directory Connector still selected, select the action Run and select Export.
在此处输入图片说明 4. To re-enable the protection, run the PowerShell cmdlet:

Enable-ADSyncExportDeletionThreshold

. 在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM