Month: January 2025

How to Create a Conditional Access Policy for Windows 365 using the Microsoft Graph API

Prerequisites Register an Azure AD App and assign the Policy.ReadWrite.ConditionalAccess permission. Install dependencies: pip install msal requests Replace placeholder values (TENANT_ID, CLIENT_ID, CLIENT_SECRET) with your Azure AD credentials. Here is the code: import requests import json from msal import ConfidentialClientApplication # Azure AD Credentials – Replace with your actual values TENANT_ID = “your_tenant_id” CLIENT_ID =