The New-MgBookingBusiness cmdlet is used to create a new Microsoft Bookings business entity within Microsoft 365. Each Booking Business acts as a centralized location for managing appointments, services, customers, and staff—ideal for organizations providing professional or customer-facing services.
Administrators and service managers use this cmdlet to:
By leveraging Graph PowerShell, businesses can efficiently deploy and configure multiple booking entities without relying on manual setup through the Microsoft 365 admin center.
Before running this cmdlet, ensure you are connected to Microsoft Graph with the correct permissions:
Install-Module Microsoft.Graph -Scope CurrentUser
Connect-MgGraph -Scopes "Bookings.ReadWrite.All"
To create a new Booking Business, use the -BodyParameter parameter to pass a hashtable containing required fields such as display name, address, and contact information.
New-MgBookingBusiness -BodyParameter <IMicrosoftGraphBookingBusiness>
Creating a single business booking page is straightforward. The following example demonstrates how to create a new business booking page using the required properties:
$body = @{
DisplayName = "Contoso Health Clinic"
BusinessHours = @{
Day = "Monday"
StartTime = "08:00:00"
EndTime = "17:00:00"
}
Address = @{
Street = "123 Main St"
City = "Redmond"
State = "WA"
PostalCode = "98052"
CountryOrRegion = "US"
}
Phone = "+1 425-555-0100"
Email = "contact@contosohealthclinic.com"
WebSiteUrl = "https://contosohealthclinic.com"
}
New-MgBookingBusiness -BodyParameter $body
This example creates a new Booking Business named Contoso Health Clinic with its contact details and working hours configured.
To create multiple business booking pages, loop through an array of hashtables, each representing a separate business or branch.
$businesses = @(
@{
DisplayName = "Contoso Health Clinic"
BusinessHours = @{
Day = "Monday"
StartTime = "08:00:00"
EndTime = "17:00:00"
}
Address = @{
Street = "123 Main St"
City = "Redmond"
State = "WA"
PostalCode = "98052"
CountryOrRegion = "US"
}
Phone = "+1 425-555-0100"
Email = "contact@contosohealthclinic.com"
WebSiteUrl = "https://contosohealthclinic.com"
}
@{
DisplayName = "Contoso Dental Clinic"
BusinessHours = @{
Day = "Tuesday"
StartTime = "09:00:00"
EndTime = "18:00:00"
}
Address = @{
Street = "456 Second St"
City = "Bellevue"
State = "WA"
PostalCode = "98007"
CountryOrRegion = "US"
}
Phone = "+1 425-555-0200"
Email = "contact@contosodentalclinic.com"
WebSiteUrl = "https://contosodentalclinic.com"
}
)
foreach ($business in $businesses) {
New-MgBookingBusiness -BodyParameter $business
}
This script automates the creation of multiple Booking Businesses, reducing setup time for organizations with multiple service locations.
For larger organizations, you can bulk-create Booking Businesses using data from a CSV file.
CSV File Structure:
DisplayName,Day,StartTime,EndTime,Street,City,State,PostalCode,CountryOrRegion,Phone,Email,WebSiteUrl
Contoso Health Clinic,Monday,08:00:00,17:00:00,123 Main St,Redmond,WA,98052,US,+1 425-555-0100,contact@contosohealthclinic.com,https://contosohealthclinic.com
Contoso Dental Clinic,Tuesday,09:00:00,18:00:00,456 Second St,Bellevue,WA,98007,US,+1 425-555-0200,contact@contosodentalclinic.com,https://contosodentalclinic.com
Contoso Spa,Wednesday,10:00:00,19:00:00,789 Third St,Kirkland,WA,98033,US,+1 425-555-0300,contact@contosospaclub.com,https://contosospaclub.com
PowerShell Script:
$csv = Import-Csv -Path "C:\BookingBusinesses.csv"
foreach ($row in $csv) {
$body = @{
DisplayName = $row.DisplayName
BusinessHours = @{
Day = $row.Day
StartTime = $row.StartTime
EndTime = $row.EndTime
}
Address = @{
Street = $row.Street
City = $row.City
State = $row.State
PostalCode = $row.PostalCode
CountryOrRegion = $row.CountryOrRegion
}
Phone = $row.Phone
Email = $row.Email
WebSiteUrl = $row.WebSiteUrl
}
New-MgBookingBusiness -BodyParameter $body
}
This approach streamlines bulk Booking Business creation for enterprises managing multiple departments or regional offices.
| Key Point | Details |
|---|---|
| Cmdlet Name | New-MgBookingBusiness |
| Purpose | Creates a new Microsoft Bookings business entity within Microsoft 365 |
| Required Scope | Bookings.ReadWrite.All |
| Primary Parameter | BodyParameter |
| Automation Benefit | Enables mass creation and configuration of Booking Businesses |
| Use Case | Useful for organizations offering services across multiple branches or regions |
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