Get-MgUser -All | Select DisplayName,Department,UsageLocation 此命令指示 PowerShell:(Get-MgUser) 获取用户帐户的所有信息,并将其发送到下一个命令 (|)。 仅显示用户帐户名称、部门和使用情况位置 (选择DisplayName、Department、UsageLocation)。若要查看特定用户帐户的所有属性,请使用 Select cmdlet 和通配符 ...
# Connect to Microsoft GraphConnect-Graph-ScopesUser.ReadBasic.All 查看所有帐户 若要显示具有用户 ID 和用户主体名称的用户帐户的完整列表,请运行以下命令: PowerShell Get-MgUser-All| Select DisplayName,Id,UserPrincipalName 应获取类似于以下内容的信息: ...
此PowerShell 命令的解释是:获取当前 Microsoft 365 订阅中的所有用户 (Get-MgUser) ,但仅显示每个用户的名称和位置 (选择 DisplayName、UsageLocation) 。 由于适用于 Microsoft 365 的 PowerShell 支持命令 shell 语言,因此可以进一步操作Get-MgUser命令获取的信息。 例如,你可能想要按位置对这些用户进行排序,将...
Connect-Graph-ScopesUser.Read.All, Organization.Read.All 若要查看特定用户帐户的许可证详细信息,请运行以下命令: PowerShell Get-MgUserLicenseDetail-UserId"<user sign-in name (UPN)>" 例如: PowerShell Get-MgUserLicenseDetail-UserId"belindan@litwareinc.com" ...
Get-MgUserMemberOf-UserId00aa00aa-bb11-cc22-dd33-44ee44ee44ee Id DisplayName Description GroupTypes AccessType -- --- --- --- ---5dc16449-3420-4ad5-9634-49cd04eceba0 demogroup demogroup {Unified} 返回的值是该用户所在组的列表。 也可通过 Select...
Get the number of the resource 备注 To view the v1.0 release of this cmdlet, view Get-MgUserDirectReportCountAsUser Syntax PowerShell 复制 Get-MgBetaUserDirectReportCountAsUser -UserId <String> [-Filter <String>] [-Search <String>] -ConsistencyLevel <String> [-ResponseHeadersVa...
$V1Users = Get-MgUser $BetaDriveActivity = Get-MgBetaDriveActivity Speed up your automations With the SDK now 58% smaller, you can choose the module which better suits your needs with the new Microsoft Graph PowerShell v2. The first option,Microsoft...
RoleTemplateId$roleTemplate$role=Get-MgDirectoryRole|Where-Object{$_.displayName-eq$roleName} }$userId= (Get-MgUser-Filter"userPrincipalName eq '$userUPN'").Id$newRoleMember=@{"@odata.id"="https://graph.microsoft.com/v1.0/users/$userId"}New-MgDirectoryRoleMemberByRef-DirectoryRoleId$role...
User.Read.All 权限范围启用前两个调用,Group.ReadWrite.All 范围启用其余调用。 这些权限需要管理员帐户。 有关如何确定所需的权限范围的详细信息,请参阅 使用Find-MgGraphCommand。 连接到 Microsoft Graph 若要连接到 Microsoft 365 组织,请使用示例权限范围运行以下命令: PowerShell 复制 Connect-MgGraph -Scope...
The MobilePhone parameter specifies the user's primary mobile phone number. Note: In Exchange Online, you can't use this parameter. Instead, use the MobilePhone parameter on the Update-MgUser cmdlet in Microsoft Graph PowerShell. Expand table Type: String Position: Named Default value: None ...