Saturday, September 2, 2023

Get Teams User id using Microsoft Grapth API


Get Teams User id using Microsoft Grapth API

```sh
Install-Module Microsoft.Graph

# Import the required module
Import-Module Microsoft.Graph

# Connect to Microsoft Graph
Connect-MgGraph

# Get the user object for the specified user
$user = Get-MgUser -Filter "mail eq '[email protected]'"

# Output the user ID
$user.Id

```

No comments:

Post a Comment