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-MgUser-SelectId,DisplayName,Mail,UserPrincipalName,UsageLocation,UserType | where {$_.UsageLocation-eq$null-and$_.UserType-eq'Member'} 若要设置帐户的UsageLocation值,请运行此命令。 PowerShell $userUPN="<user sign-in name (UPN)>"$userLoc="<ISO 3166-1 alpha-2 country code>"Update-Mg...
To view the v1.0 release of this cmdlet, view Get-MgUserDirectReportCountAsUser Syntax PowerShell 复制 Get-MgBetaUserDirectReportCountAsUser -UserId <String> [-Filter <String>] [-Search <String>] -ConsistencyLevel <String> [-ResponseHeadersVariable <String>] [-Headers <IDicti...
To view the v1.0 release of this cmdlet, view Get-MgUserOnlineMeetingAttendanceReportAttendanceRecordCount Syntax PowerShell Copy Get-MgBetaUserOnlineMeetingAttendanceReportAttendanceRecordCount -OnlineMeetingId <String> -UserId <String> [-Filter <String>] [-Search <Stri...
Get-MgUser ` -Filter "UserPrincipalName eq '[email protected]'" The following example shows how to create a new user account, assign a license and then add the user to a security group with the MSOnline module and the Microsoft Graph equivalent: ...
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 ...
(ClientId, ClientKey));\n # if you get an error about PowerShell not being able to find this method with 2 parameters, it means there is another version of ADAL DLL already in the process space of your PowerShell environment.\n\n $authResult = $authContext.Acq...