简体   繁体   English

如何运行PowerShell cmdlet“ Disable-ADSyncExportDeletionThreshold”?

[英]How to run the PowerShell cmdlet “Disable-ADSyncExportDeletionThreshold”?

I want to delete Office 365 users from Active Directory PowerShell in Windows Server 2008 (x64) 我想从Windows Server 2008(x64)中的Active Directory PowerShell中删除Office 365用户

There is a treshold so you can't delete more than 500 users. 有一个阈值,因此您不能删除500个以上的用户。

Microsoft has a documentation to prevent accidetal deletes and it says "just run Disable-ADSyncExportDeletionThreshold" command and it's OK. Microsoft具有防止意外删除的文档,并且说“只需运行Disable-ADSyncExportDeletionThreshold”命令就可以了。

But I have a problem. 但是我有一个问题。 When I try to disable treshold, PowerShell says: 当我尝试禁用阈值时,PowerShell说:

    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. 我也尝试导入“ ADSync”,但模块无法加载。

Any solution? 有什么办法吗?

Thanks. 谢谢。

Disable-ADSyncExportDeletionThreshold is a commandlet for AAD Connect, you have to have AADConnect module installed and imported for it to work. Disable-ADSyncExportDeletionThreshold是AAD Connect的命令行开关,您必须安装并导入AADConnect模块才能正常工作。 Try Import-Module “C:\\Program Files\\Microsoft Azure AD Sync\\Bin\\ADSync\\ADSync.psd1” if its not there, install it. 如果不存在,请尝试Import-Module “C:\\Program Files\\Microsoft Azure AD Sync\\Bin\\ADSync\\ADSync.psd1”

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. 我建议您暂时禁用它,然后再启用它,因为默认情况下已启用它,以防止将大量删除导出到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: 要暂时禁用此保护并使这些删除通过,请运行PowerShell cmdlet:

Disable-ADSyncExportDeletionThreshold 禁用ADSyncExportDeletionThreshold

. 2. Provide an Azure AD Global Administrator account and password. 2.提供一个Azure AD Global管理员帐户和密码。

在此处输入图片说明 3. With the Azure Active Directory Connector still selected, select the action Run and select Export. 3.在仍然选择Azure Active Directory连接器的情况下,选择操作“运行”,然后选择“导出”。
在此处输入图片说明 4. To re-enable the protection, run the PowerShell cmdlet: 4.要重新启用保护,请运行PowerShell cmdlet:

Enable-ADSyncExportDeletionThreshold Enable-ADSyncExportDeletionThreshold

. 在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何以 SYSTEM 身份运行我的 PowerShell 模块 cmdlet? - How to run my PowerShell module cmdlet as SYSTEM? 如何使powershell cmdlet静音? - How to silence a powershell cmdlet? 如何在 Python 中运行 PowerShell cmdlet 以获取已连接 USB 设备的列表? - How to run a PowerShell cmdlet in Python to get a list of connected USB devices? 如何导入新的PowerShell cmdlet? - How to import a new powershell cmdlet? 使用各种参数运行Powershell Cmdlet - Run Powershell Cmdlet with various number of parameters 如何使PowerShell运行原始的Start-Process cmdlet而不是PSCX Start-Process cmdlet? - How can I make PowerShell run the original Start-Process cmdlet rather than the PSCX Start-Process cmdlet? 如何在 Inno Setup Run 部分中运行 Set-ProcessMitigation PowerShell cmdlet - How to run a Set-ProcessMitigation PowerShell cmdlet in Inno Setup Run section 如何在Powershell中的字符串中插入cmdlet - How to insert a cmdlet into a string in powershell Powershell cmdlet如何工作? - How does a Powershell cmdlet work? 如何在正常的PowerShell会话中(不在Visual Studio中)运行Nuget PowerShell cmdlet Install-Package? - How can I run Nuget PowerShell cmdlet Install-Package in normal PowerShell session (not inside Visual Studio)?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM