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

[玩转系统] 如何使用 PowerShell 在 Office 365 中获取许可用户

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

如何使用 PowerShell 在 Office 365 中获取许可用户


要获取 Office 365 中的所有许可用户,请在 PowerShell 中使用 Get-MsolUser cmdlet 检索所有用户的列表,并检查用户的 IsLicensed 属性是否相等为真。

Get-MsolUser -All | where {$_.isLicensed -eq $true}

在上面的 PowerShell 脚本中,Get-MsolUser cmdlet 使用 -All 参数检索 Azure AD 中的所有用户,并将它们通过管道传输到Where 条件。

Where 条件检查用户的 IsLicensed 属性是否等于 true 并返回 Azure AD 中的所有许可用户。

下面给出了上述 PowerShell 脚本的输出,其中列出了组织中的所有许可用户帐户。

[玩转系统] 如何使用 PowerShell 在 Office 365 中获取许可用户

要将 Office 365 中的所有许可用户导出到 CSV 文件,请运行以下命令。

Get-MsolUser -All | where {$_.isLicensed -eq $true} | Export-Csv -Path D:\licensed_users.csv -NoTypeInformation           

此命令将 Azure AD 中的所有许可用户导出到 csv 文件。

酷提示:如何使用 PowerShell 在 Microsoft Office 365 中获取分配给用户的许可证!

结论

希望上述有关如何使用 Get-MsolUser cmdlet 获取 Office 365 中所有许可用户的文章对您有所帮助。

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

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

取消回复欢迎 发表评论:

关灯