Skip to content

Getting Started

Ryan Ephgrave edited this page Jan 22, 2017 · 11 revisions

To use the cmdlets, you first need to authenticate with the command:

Get-GraphAuthenticationToken -TenantName 'MyTenant.OnMicrosoft.com' -Credential (Get-Credential)

This will set a global variable to store the authentication token. After that variable is set, you can start using the cmdlets! Try to get all users with Get-GraphUsers.

If you want to run a query that currently has no function created for it yet, you can use Invoke-GraphMethod. For instance, if you want to get a user's drive, you can use this query:

Invoke-GraphMethod -Query "users/USERID/drive"

The functions will return the JSON response object.

Clone this wiki locally