Entra / Microsoft 365 · Users & guests
Report white board info
How to use the Whiteboard Admin module to create a report of all whiteboards and their owners in a tenant. The original code.
Connect & set up
Run these once per session. All scopes are read-only unless the script makes changes.
Import-Module WhiteboardAdmin# Connect to the Microsoft GraphConnect-MgGraph -TenantId $TenantId -Scope "Directory.Read.All, User.Read.All"
Run it
The main script. Copy it, or download the .ps1 and run it from your console.
param([string] $TenantId = "")Import-Module WhiteboardAdmin# Connect to the Microsoft GraphConnect-MgGraph -TenantId $TenantId -Scope "Directory.Read.All, User.Read.All"try {$dateTime = (Get-Date).toString("dd-MM-yyyy")$fileName = "WhiteboardReport-" + $dateTime + ".csv"$outputView = "c:\temp\" + $fileName# The geography to look for board owners in. Accepted values are: Europe, Australia, or Worldwide (all boards not in australia or europe).$supportedGeographies = @("Europe", "Australia", "Worldwide")# Array to hold Whiteboard owners$WhiteboardOwners = [System.Collections.Generic.List[Object]]::new(); $i=0foreach ($geography in $supportedGeographies) {Write-Host "Getting Whiteboard owners for geography: $($geography)..."$GeographyOwners = Get-WhiteboardOwners -Geography $Geographyforeach ($UserId in $GeographyOwners.items) {$User = Get-MgUser -UserId $UserId$i++$ReportLine = [PSCustomObject][Ordered]@{DisplayName = $User.DisplayNameUPN = $User.UserPrincipalNameGeography = $GeographyUserId = $UserId}$WhiteboardOwners.Add($ReportLine)} # End ForEach OwnerWrite-Host "Total whiteboard owners found so far $($i)"} # EndForEach Geography# Array to hold Whiteboard details$Whiteboards = [System.Collections.Generic.List[Object]]::new()# Get whiteboards from the Microsoft Whiteboard service by ownersforeach ($Owner in $WhiteboardOwners) {Write-Host "Getting Whiteboards for owner: $($Owner.UPN) ..."$whiteboardInfo = Get-Whiteboard -UserId $Owner.UserIDforeach ($whiteboardInstance in $whiteboardInfo) {$ReportLine = [PSCustomObject][Ordered]@{User = $Owner.DisplayNameUPN = $Owner.UPNWhiteboardId = $whiteboardInstance.IdTitle = $whiteboardInstance.TitleIsShared = $whiteboardInstance.IsSharedCreated = Get-Date($whiteboardInstance.CreatedTime) -format gModified = Get-Date($whiteboardInstance.LastModifiedTime) -format gGeography = $Owner.GeographyUserId = $Owner.UserId}$Whiteboards.Add($ReportLine)} #End Foreach WhiteboardsWrite-Host "Found $($whiteboards.Count) Whiteboards owned by: $($Owner.UPN)"} # End Foreach Whiteboard ownersWrite-Host "Found $($whiteboards.Count) Whiteboards in the tenant."# Export the results to a CSV file and Out-GridView$Whiteboards | Export-CSV -Path $outputView -Force -NoTypeInformation$Whiteboards | Out-GridViewWrite-Host "Finished"}catch {Write-Host -f Red "Error:" $_.Exception.Message}
Parameters
ParameterDefaultNotes
-TenantId""Microsoft Entra tenant ID for app-only Graph authentication.Attribution
Author
Office365itpros