Reputation:
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
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:
If all the deletes are desired, then do the following:
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
Upvotes: 0
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