Microsoft365DSC icon indicating copy to clipboard operation
Microsoft365DSC copied to clipboard

Implement Microsoft365DSC resources for Microsoft Places (Buildings, Rooms, Workspaces, Desks, Maps)

Open Copilot opened this issue 8 months ago β€’ 0 comments

This PR implements comprehensive Microsoft365DSC resources for Microsoft Places management, enabling infrastructure-as-code configuration of workplace locations through PowerShell DSC.

Overview

Microsoft Places is a Microsoft 365 service for managing workplace locations including buildings, rooms, workspaces, and desk spaces. This implementation provides DSC resources to manage these entities following the established Microsoft365DSC patterns.

Resources Implemented

🏒 MSFT_MicrosoftPlaceBuilding

Manages physical buildings with properties like address, coordinates, and contact information.

MicrosoftPlaceBuilding 'MainBuilding'
{
    Identity         = 'building-001'
    DisplayName      = 'Main Office Building'
    Address          = '123 Main Street'
    City             = 'Seattle'
    State            = 'Washington'
    CountryOrRegion  = 'United States'
    PostalCode       = '98101'
    Phone            = '+1-555-0123'
    GeoCoordinates   = '47.6062,-122.3321'
    Ensure           = 'Present'
    ApplicationId    = $ApplicationId
    TenantId         = $TenantId
    CertificateThumbprint = $CertificateThumbprint
}

πŸͺ MSFT_MicrosoftPlaceRoom

Manages meeting rooms and private offices with detailed properties including capacity, equipment, and accessibility features.

MicrosoftPlaceRoom 'ConferenceRoom1'
{
    Identity              = 'room-001'
    DisplayName           = 'Conference Room A'
    Capacity              = 12
    BuildingId            = 'building-001'
    Floor                 = '2'
    IsWheelChairAccessible = $true
    MTREnabled            = $true
    Tags                  = @('Conference', 'Video', 'Whiteboard')
    Ensure                = 'Present'
    ApplicationId         = $ApplicationId
    TenantId              = $TenantId
    CertificateThumbprint = $CertificateThumbprint
}

🌐 MSFT_MicrosoftPlaceWorkspace

Manages open collaborative spaces and flexible work areas.

πŸͺ‘ MSFT_MicrosoftPlaceDesk

Manages individual workstations and hot desks.

πŸ—ΊοΈ MSFT_MicrosoftPlaceMap

Manages floor plans and spatial representations with map images and layout information.

Key Features

  • Complete CRUD Operations: Full Get/Set/Test/Export-TargetResource implementations
  • Microsoft Graph Integration: Uses Invoke-MgGraphRequest for Microsoft Places API calls
  • Comprehensive Authentication: Supports all Microsoft365DSC authentication patterns:
    • Credential-based authentication
    • Application ID + Secret
    • Certificate-based authentication
    • Managed Identity
    • Access Tokens
  • Robust Error Handling: Consistent error handling and verbose logging
  • Telemetry Integration: Built-in telemetry following Microsoft365DSC patterns
  • Export Functionality: ReverseDSC support for configuration extraction

Implementation Details

Architecture

  • Follows established Microsoft365DSC resource patterns from AADGroup and EXOPlace
  • Uses Microsoft Graph API endpoints: https://graph.microsoft.com/beta/places
  • Implements proper MOF schema files with DSC syntax
  • Includes comprehensive Pester unit tests with mocked Graph API calls

API Integration

# Example API call pattern used
$uri = "https://graph.microsoft.com/beta/places/$Identity"
$place = Invoke-MgGraphRequest -Uri $uri -Method GET

# With filtering for specific place types
$uri = "https://graph.microsoft.com/beta/places?`$filter=microsoft.graph.room/placeType eq 'Building'"

Permissions Required

  • Read: Place.Read.All
  • Write: Place.ReadWrite.All

Testing

Each resource includes comprehensive Pester tests covering:

  • Resource creation scenarios
  • Update operations
  • Removal operations
  • Error handling
  • ReverseDSC export functionality

All modules have been syntax-validated and import successfully.

Files Added

Total: 25 files (5 resources Γ— 5 files each)

For each resource:

  • .psm1 - PowerShell DSC implementation
  • .schema.mof - DSC schema definition
  • readme.md - Documentation with examples
  • settings.json - Permissions and metadata
  • .Tests.ps1 - Pester unit tests

Compatibility

  • Maintains backward compatibility with existing Microsoft365DSC resources
  • Follows established naming conventions (MSFT_MicrosoftPlace*)
  • Uses consistent parameter patterns and authentication methods
  • Integrates with existing telemetry and logging infrastructure

This implementation enables organizations to manage their Microsoft 365 workplace locations using infrastructure-as-code principles through PowerShell DSC.

Copilot avatar Jun 10 '25 15:06 Copilot