当前位置:网站首页 > 更多 > 玩电脑 > 正文

[玩转系统] 删除-MsolAdministrativeUnit - 删除 Office 365 中的管理单元

作者:精品下载站 日期:2024-12-14 06:25:30 浏览:13 分类:玩电脑

删除-MsolAdministrativeUnit - 删除 Office 365 中的管理单元


PowerShell 中的 Remove-MsolAdministrativeUnit cmdlet 可从 Microsoft Office 365 中删除管理单元。

下面给出了从 Azure Active Directory 中删除管理单元的语法。

Remove-MsolAdministrativeUnit
      -ObjectId <Guid>
      [-Force]
      [-TenantId <Guid>]
      [<CommonParameters>]

在本文中,我们将讨论如何在 PowerShell 中使用 Remove-MsolAdministrativeUnit cmdlet 从 Azure Active Directory 删除管理单元。

如何从 Office 365 中删除管理单元

若要从 Office 365 中删除管理单元,请在 PowerShell 中使用 Remove-MsolAdministrativeUnit cmdlet,并使用指定要删除的管理单元的唯一 ID 的 -ObjectId 参数。

# Get the Administrative Unit
$AdministrativeUnit = Get-MsolAdministrativeUnit -SearchString "East Coast"

# Delete an Administrative Unit
Remove-MsolAdministrativeUnit -ObjectId $AdministrativeUnit.ObjectId -Force

PowerShell 中的 Get-MsolAdministrativeUnit 命令获取与 -SearchString 参数指定的搜索字符串(在本例中为“East Coast”)匹配的管理单位,并存储该管理单位在 $AdministrativeUnit 变量中。

PowerShell 中的 Remove-MsolAdministrativeUnit 命令使用 -ObjectId 参数指定 $AdministrativeUnit 的对象 ID。此命令使用 -Force 参数,该参数不会提示确认并从 Office 365 中删除管理单位。

结论

我希望上述有关如何在 PowerShell 中使用 Remove-MsolAdministrativeUnit cmdlet 从 Office 365 中删除管理单元的文章对您有所帮助。

您可以在 ShellGeek 主页上找到有关 PowerShell Active Directory 命令和 PowerShell 基础知识的更多主题。

相关链接

获取 Msol 管理单位

新-Msol行政单位

设置-Msol管理单位

您需要 登录账户 后才能发表评论

取消回复欢迎 发表评论:

关灯