Graph 浏览器是一个基于 Web 的工具,可用于通过 Microsoft Graph API 构建和测试请求。可在以下位置访问 Graph 浏览器:[https://developer.microsoft.com/graph/graph-explorer](https://developer.microsoft.com/graph/graph-explorer)

https://docs.microsoft.com/zh-cn/powershell/azure/active-directory/install-adv2?view=azureadps-2.0

以管理员权限启动powershell

安装Azure AD模块

  1. Install-Module AzureAD

安装 public preview release

  1. Install-module AzureADPreview -AllowClobber

登录Azure AD

  1. Connect-AzureAD

输入账号密码

查询指定数量的user

  1. Get-AzureADUser -Top 999

根据userPrincipalName查询

精确查询

  1. Get-AzureADUser -Filter "userPrincipalName eq 'vivian2@o365.hes20.eu'"
  2. //根据ProxyAddresses查询
  3. Get-AzureADUser -Filter "ProxyAddresses eq 'smtp:test0-alias3@o365.hes20.eu'"

前缀查询

  1. Get-AzureADUser -Filter "startswith(userPrincipalName,'vivian')"

查询user并获取所有属性

使用 gm -MemberType Properties 列出所有属性及属性描述

  1. Get-AzureADUser -Filter "mail eq 'test0@o365.hes20.eu'" |gm -MemberType Properties

image.png
使用 format-list (可以简写为fl) 列出所有属性和值

  1. Get-AzureADUser -Filter "mail eq 'test0@o365.hes20.eu'" | fl
  2. //或者
  3. Get-AzureADUser -Filter "mail eq 'test0@o365.hes20.eu'" | Format-List

image.png