Get-MgBookingBusinessCustomer

What is Get-MgBookingBusinessCustomer?

The Get-MgBookingBusinessCustomer cmdlet retrieves customer details associated with a specific Microsoft Bookings business. It helps administrators access customer profiles, including display names, contact numbers, and email addresses stored within the Microsoft Bookings service.


Why Use Get-MgBookingBusinessCustomer?

This cmdlet is particularly useful for organizations that manage appointments through Microsoft Bookings. It allows administrators to:

  • View all customers associated with a particular booking business.
  • Export customer data for reporting, compliance, or analytics.
  • Automate retrieval of contact information for CRM or communication workflows.

It’s ideal for building automated scripts that keep customer records up-to-date across systems.


Prerequisites

Before using the cmdlet, install the Microsoft Graph module and connect with the proper permissions:

Install-Module Microsoft.Graph -Scope CurrentUser
Connect-MgGraph -Scopes "Bookings.Read.All"

How to Use Get-MgBookingBusinessCustomer?

You can use the cmdlet to retrieve all customers or specific customer records for a given Booking Business ID.

Get-MgBookingBusinessCustomer -BookingBusinessId <String>

Get-MgBookingBusinessCustomer Example

  • Example 1: Retrieve All Customers for a Specific Booking Business
  • This example retrieves all customers associated with the specified Booking Business ID. It is useful for generating a comprehensive customer list for reporting or analysis.

    $customers = Get-MgBookingBusinessCustomer -BookingBusinessId "Skyhigheducationservice@7xh7fj.onmicrosoft.com"
    
    foreach ($customer in $customers) {
        $id = $customer.Id
        $additionalProps = $customer.AdditionalProperties
    
        # Extract specific properties from AdditionalProperties
        $displayName = $additionalProps["displayName"]
        $emailAddress = $additionalProps["emailAddress"]
        $phone = $additionalProps["phone"]
    
        # Output the information
        [PSCustomObject]@{
            Id           = $id
            DisplayName  = $displayName
            EmailAddress = $emailAddress
            Phone        = $phone
        }
    }
    

    This script fetches each customer’s ID, display name, email address, and phone number for the given booking business.


Summary

Key Point Details
Cmdlet Name Get-MgBookingBusinessCustomer
Purpose Retrieves customer details linked to a Microsoft Bookings business
Required Scope Bookings.Read.All
Primary Parameter BookingBusinessId
Automation Benefit Enables automated reporting and customer data synchronization
Use Case Generating or exporting customer lists from Microsoft Bookings

Did You Know? Managing Microsoft 365 applications is even easier with automation. Try our Graph PowerShell scripts to automate tasks like generating reports, cleaning up inactive Teams, or assigning licenses efficiently.

Ready to get the most out of Microsoft 365 tools? Explore our free Microsoft 365 administration tools to simplify your administrative tasks and boost productivity.

© Your Site Name. All Rights Reserved. Design by HTML Codex