
Microsoft Graph API is a RESTful web API that provides a unified endpoint for accessing a wide range of data and services across Microsoft’s cloud ecosystem, including Microsoft 365, Office 365, OneDrive, Teams, Outlook, SharePoint, and more. It enables developers to interact with user data, manage documents, emails, calendars, chats, tasks, and organizational resources from different Microsoft cloud services, all through a single API.
Key Features
Unified Endpoint: Allows access to multiple Microsoft cloud services through one API endpoint.
Rich Data Access: Enables reading and writing of emails, managing calendars, contacts, files, tasks, and groups, plus analytics, security, and device management.
User & Organization Integration: Connects user data, collaboration tools, and business processes, making it ideal for applications that need to work across Microsoft's platforms.
Common Use Cases
Reading and sending emails
Managing calendars and scheduling
Accessing OneDrive and SharePoint files
Handling Teams chats and meetings
Automating workflows within Microsoft 365 apps
Explore how to use Graph Explorer to call Microsoft Graph API endpoints, understand methods like GET, POST, PUT, PATCH, and DELETE, and inspect tokens, sample tenants, and user data.
Create a new app registration in your Azure tenant to access the Graph API. Store the client ID and tenant ID, assign an owner, and plan for secrets.
Create a client secret for your Azure app by adding a secret or certificate, copying the secret value securely, and assigning permissions for access via PowerShell.
Learn to set Microsoft Graph API permissions, choose between delegated and application types, grant admin consent, and prepare your app to access tenant users with user.read.all.
Understand how access tokens work with bearer authentication, then generate and secure a Microsoft Graph v1.0/me token using PowerShell, noting expiration, permissions, and token as a credential.
Identify two token types in Microsoft Graph API: app only access tokens and delegated tokens; generate them using an application with ID, tenant ID, secret, and admin permissions.
Generate an app-only access token for Microsoft Graph API with PowerShell by configuring client ID, tenant ID, and client secret, posting to the token endpoint, and retrieving the bearer token.
Create a get token function in PowerShell to renew and return the Microsoft Graph API access token using client id, tenant id, and client secret to build URL and body.
Decode the JWT access token on jwt.io to view header, payload, and signature, and verify the app display name and permissions like user.read.all.
Learn how to generate a delegated access token for Microsoft Graph using PowerShell, including obtaining an authorization code, exchanging it for an access token, and validating token scopes like user.read.
Learn how to renew a delegated access token using a refresh token in Microsoft Graph API with PowerShell, generating a new access token and a new refresh token automatically.
Create a PowerShell function to renew an access token from a refresh token, reading the refresh token from a file and updating it after renewal for automation.
Generate a delegated access token using resource owner password credentials (ROPC) by sending username, password, client id, secret, and scope to the token endpoint, enabling long-term automation.
Automate token renewal for Microsoft Graph API in PowerShell to keep tokens active during long-running tasks. Use a stopwatch to renew at set intervals and restart the timer after renewal.
Use an app access token to list tenant users via the Microsoft Graph API v1.0 in PowerShell, with user.read.all permission, calling /users and printing each user's principle name.
Learn to paginate long user lists in the Microsoft Graph API using PowerShell by following next links, handling skip tokens, and exporting all results to CSV.
Leverage the delta endpoint to fetch only newly created, updated, or deleted users since the last token. Use next and delta links to retrieve changes without full tenant reads.
Learn to retrieve a specific user from Microsoft Graph with PowerShell using delegated or application permissions, by user principal name or object ID (also via /me for the signed-in user).
Update a user via patch with a bearer token and application/json to change properties like job title, targeting the user by id or principal name, then verify with get call.
Delete a user in Microsoft Graph using an application token or delegated permission. Call the delete method on user/{id} with a bearer token, no request body, and read write all.
Create users with the Microsoft Graph API using PowerShell, including single and bulk (csv) creation. Post a JSON body with accountEnabled, displayName, userPrincipalName, and passwordProfile using a bearer token.
Learn to bulk create Microsoft Graph users with PowerShell using a CSV file, defining enabled status, display name, mailNickname, and userPrincipalName, then loop through the file to submit requests.
Explore certificate-based authentication for Graph API security, comparing self-signed certificates with client secrets, and learn how public-private keys and PowerShell enable secure app-only tokens in Azure Active Directory.
Learn to create and inspect a self-signed certificate in PowerShell, using New-SelfSignedCertificate with a CN subject in the local machine store, 12-month validity, and exportable keys for Azure service principals.
Export the certificate's public key to a designated cert folder using the thumbprint and subject name to create graph api test.acr for use with the Graph API.
Upload a public key certificate to Azure, then generate an access token using MSAL with a client certificate, highlighting that private keys stay secure and certificates unlock token access.
List all groups in your organization using the Microsoft Graph API with PowerShell, excluding dynamic distribution groups, and learn to fetch groups with get /groups and bearer token authentication.
Update a Microsoft Graph group with PowerShell by applying a patch to change the description, using the group ID and a proper request body.
Delete a Microsoft Graph group with PowerShell using application permissions, sending an HTTP delete request to group/id with an authorization header and no body, returning no content.
List group members and owners in microsoft graph using PowerShell by sending HTTP get requests to /groups/{id}/members and /groups/{id}/owners, and display user principal names.
Add members and owners to a group using the Microsoft Graph API with PowerShell. Utilize post and patch endpoints, manage references and object IDs, and handle delegated versus app permissions.
Learn to remove a group member or owner with PowerShell and Microsoft Graph API, and why the reference parameter and permissions matter to prevent unintended deletions.
Learn how licensing works in a Microsoft environment, including direct vs inherited licenses, group-based assignments, and using the Graph API to assign licenses.
Learn to query your tenant's license subscriptions via the subscribed SKU API using PowerShell, extract skew part numbers, prepaid units, and usage, and export results to a CSV.
Monitor license lifecycles by querying the directory subscription endpoint with PowerShell to track creation dates, trial status, next life cycle dates, and renewals, and export results to Excel.
Learn how to assign and remove licenses to users using Microsoft Graph API with PowerShell, including crafting the add and remove license payloads, SKU IDs, and endpoint usage.
Explore how to assign and remove licenses to groups using Microsoft Graph API with PowerShell, covering group-based licensing, group IDs, object IDs, and license inheritance to group members.
Learn how to reprocess license assignments in Microsoft Graph API using PowerShell to restart user licenses via a POST endpoint with a user ID and no request body.
Identify license assignment issues with Microsoft Graph by inspecting license assignment states for users and groups, distinguishing direct from inherited licenses and noting errors like count violations and dependency violations.
Explore automating license management with Graph API and PowerShell, deploying code via GitHub to an Azure Function, and sending daily Teams notifications to admins with license status.
List all teams, their channels, and members in your organization using Microsoft Graph API with PowerShell. Also fetch a specific team's details, along with its channels and members.
Use PowerShell to create teams and channels with the Microsoft Graph API, posting to /teams, supplying a teams body, and configuring standard and private channel membership with owners and members.
Delete teams and channels with Microsoft Graph API using PowerShell: remove a channel by its ID, then delete the group to archive the team.
Learn to create a 1-to-1 chat between users with the Microsoft Graph API using delegated tokens in PowerShell, then send a message via the chat messages endpoint.
Create and manage a group chat with a topic using Microsoft Graph API and PowerShell. Add members, set a topic, and send messages in group chats.
Send messages to a Teams channel and reply to a channel message using PowerShell and the Graph API. Learn to use team and channel IDs and construct the message URL.
Learn to extract Microsoft Graph usage reports from the admin portal, including email activity and site usage, with 7, 30, 90, or 180 day ranges and permissions such as reports.read.all.
Use Graph API with PowerShell to extract M365 usage reports, retrieving SharePoint site usage details by period or a specific date, and export as CSV.
List calendars and calendar groups using the Microsoft Graph API with PowerShell, detailing application and delegated permissions, querying /me/calendars and calendar groups, and moving calendars between groups.
Learn to create calendar groups with Graph API via a post request, supply a JSON body, set content-type, and verify by moving calendars into the new group.
Create a new calendar via Microsoft Graph API with PowerShell by posting a calendar name, then update its details with a patch using the calendar ID.
Learn how to delete a calendar with the Microsoft Graph API using PowerShell, including deleting calendar groups and calendars by ID, handling token expiration, and the risks of permanent delete.
List events from a user calendar and use calendar view with start and end dates to retrieve single-instance and recurring meetings in Microsoft Graph API via PowerShell.
Learn to create calendar events with the Microsoft Graph API using PowerShell, handling offline and online meetings through posted event bodies with start, end, time zone, location, and attendees.
Learn how to update and delete meetings in Microsoft Graph API using PowerShell, including using meeting and user IDs, patch requests to switch from offline to online, and bulk delete.
Learn to retrieve free/busy status and find suitable meeting times with Microsoft Graph API by querying calendar view and get schedule, using start and end times, interval, and attendees.
List drives and sites in SharePoint and OneDrive using Microsoft Graph API, retrieving user, group, and site drives via PowerShell under application or delegated permissions.
Learn how to retrieve a SharePoint site ID using the Microsoft Graph API with PowerShell, including locating the site ID via the API path and accessing drives.
Learn to fetch drive children in SharePoint and OneDrive using PowerShell, explore root and folder hierarchies, read item metadata like IDs, paths, sizes, and parent relationships.
Learn how to create a folder inside a drive using Microsoft Graph API with a post request, supplying a folder body and handling conflicts by renaming with a digit.
Explore how to list and add permissions for drive items using Microsoft Graph API with PowerShell, and create shareable links for files and folders within an organization.
Unlock the full potential of Microsoft Graph API and take your automation skills to the next level with this comprehensive online course. In "Complete Guide to Microsoft Graph API using PowerShell", you'll learn the ins and outs of Microsoft Graph API and how to harness its power using PowerShell.
You'll gain a deep understanding of Microsoft Graph API and its capabilities, including:
- Understanding the Microsoft Graph API architecture and endpoints
- Using PowerShell to authenticate and authorize with Microsoft Graph API
- Retrieving and manipulating data using Microsoft Graph API and PowerShell
- Integrating Microsoft Graph API with other Microsoft services, such as Azure, Office 365
- Implementing security, compliance, and best practices when working with Microsoft Graph API and PowerShell
What You'll Learn:
- Microsoft Graph API fundamentals and architecture
- PowerShell basics and advanced techniques for working with Microsoft Graph API
- Data retrieval and manipulation using Microsoft Graph API and PowerShell
- Integration with other Microsoft services and tools
- Security, compliance, and best practices for working with Microsoft Graph API and PowerShell
Who Should Take This Course:
- IT professionals and administrators looking to automate tasks and workflows using Microsoft Graph API and PowerShell
- Developers and programmers interested in integrating Microsoft Graph API with their applications and services
- Anyone looking to gain a deeper understanding of Microsoft Graph API and its capabilities