
Microsoft Entra Conditional Access Documentation with PowerShell
This PowerShell script documents your Microsoft Entra Conditional Access policies. The script exports all data as a csv file which can be pretty formatted as excel workbook. To ensure all policies can be retrieved and documented the script uses the Microsoft Graph Beta API endpoint.
Install this script from the PowerShell gallery (dependent Microsoft.Graph.Authentication module is automatically installed):
Install-Script -Name Invoke-ConditionalAccessDocumentation -Scope CurrentUserC:\Users\%USERNAME%\Documents\WindowsPowerShell\Scripts~/.local/share/powershell/scriptsConnect to Microsoft Graph
Connect-Graph -Scopes "Application.Read.All", "Group.Read.All", "Policy.Read.All", "RoleManagement.Read.Directory", "User.Read.All", "NetworkAccess.Read.All" -ContextScope ProcessConnect-Graph for subsequent usageConnect-MgGraph -AccessToken $((Get-Clipboard -Raw).Replace("Bearer ","").Replace("`n","") | ConvertTo-SecureString -AsPlainText -Force)Run script via PowerShell dot sourcing
.\Invoke-ConditionalAccessDocumentation.ps1(Optional) Pretty format the csv with excel & save it as excel workbook
