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

[玩转系统] Get-MgUserCount - 获取所有用户的计数

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

Get-MgUserCount - 获取所有用户的计数


PowerShell 中的 Get-MgUserCount cmdlet 可获取 Microsoft Graph 中的用户总数。

要使用 Get-MgUserCount cmdlet,必须首先使用 Connect-MGraph cmdlet 连接到 Microsoft 365 租户。连接后,您可以使用 Get-MgUserCount cmdlet 获取所有资源的计数。

Connect-MgGraph -Scopes 'User.Read.All'

下面给出了获取 Azure AD 中用户总数的语法。

Get-MgUserCount
   [-Filter <String>]
   [-Search <String>]
   -ConsistencyLevel <String>
   [<CommonParameters>]

在本文中,我们将讨论如何在 PowerShell 中使用 Get-MgUserCount cmdlet 来获取资源的数量。

如何获取 Microsoft Graph 中的用户计数

若要获取 Microsoft Graph 中的用户计数,请使用以下命令。

Get-MgUserCount -ConsistencyLevel eventual    

该命令返回资源的数量。 -ConsistencyLevel 参数指示请求的一致性级别。

结论

希望上述有关如何在 PowerShell 中使用 Get-MgUserCount cmdlet 获取所有用户计数的文章对您有所帮助。

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

相关链接

获取 MgUser

获取 MgUserCreatedObject

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

取消回复欢迎 发表评论:

关灯