Created
November 19, 2025 21:08
-
-
Save SweetAsNZ/044bbc0b857ced346051754a19037550 to your computer and use it in GitHub Desktop.
nable Building Parameter in Microsoft Places
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function Set-MSPlacesBuildings{ | |
| <# | |
| .SYNOPISIS | |
| Enable Building Parameter in MS Places | |
| .DESCRIPTION | |
| This script connects to Microsoft Graph and enables the Building parameter at the tenant level for Microsoft Places | |
| .EXAMPLES | |
| Set-MSPlacesBuildings | |
| #>[CmdletBinding()] | |
| param () | |
| # Import the MS Graph module if not already imported | |
| if (-not (Get-Module -Name Microsoft.Graph -ListAvailable)) { | |
| Install-Module -Name Microsoft.Graph -Scope CurrentUser -Force | |
| } | |
| Import-Module Microsoft.Graph | |
| # Connect to Microsoft Graph | |
| Connect-MgGraph -Scopes "Places.ReadWrite.All" | |
| # Set Building at Tenant Level | |
| try { | |
| Set-PlacesSettings -EnableBuilding 'Default:true' | |
| Write-Output "Building parameter enabled at tenant level." | |
| } catch { | |
| Write-Error "Failed to update building: $_" | |
| } | |
| # Disconnect from Microsoft Graph | |
| #Disconnect-MgGraph | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment