Remove-MgBookingBusiness

What is Remove-MgBookingBusiness?

The Remove-MgBookingBusiness cmdlet is used to delete a Microsoft Bookings business entity from a Microsoft 365 tenant. When a business is no longer needed—such as a closed department or retired service—this cmdlet permanently removes its associated booking data from the tenant.


Why Use Remove-MgBookingBusiness?

Administrators use this cmdlet to:

  • Clean up inactive or duplicate Booking Businesses.
  • Automate offboarding for departments or branches that no longer require Bookings.
  • Maintain a structured and updated Bookings environment.
  • Integrate removal operations into larger automation workflows, such as periodic audits or lifecycle management scripts.

By using this cmdlet, you can efficiently maintain tenant hygiene without manually navigating through the Microsoft 365 admin or Bookings interface.


Prerequisites

Before executing this cmdlet, ensure that:

  • You have installed the Microsoft Graph PowerShell module.
  • You are connected to Microsoft Graph with the Bookings.ReadWrite.All permission scope.
Install-Module Microsoft.Graph -Scope CurrentUser
Connect-MgGraph -Scopes "Bookings.ReadWrite.All"
                                        

How to Remove-MgBookingBusiness?

To remove a Booking Business, use the -BookingBusinessId parameter to specify the unique ID (usually the business email address) of the Booking Business you want to delete.

Remove-MgBookingBusiness -BookingBusinessId <String>


Remove-MgBookingBusiness Examples

Example 1: Removing a Single Booking Business

To remove a single Booking Business, provide the BookingBusinessId as shown below.

Remove-MgBookingBusiness -BookingBusinessId "ContosoENTClinic@7xh7fj.onmicrosoft.com"

This command permanently deletes the Contoso ENT Clinic Booking Business from Microsoft 365.

Example 2: Removing Multiple Booking Businesses

You can remove multiple Booking Businesses by iterating through an array of IDs.

$businessIds = @("ContosoDentalClinic@7xh7fj.onmicrosoft.com", "ContosoOrthoClinic@7xh7fj.onmicrosoft.com")
foreach ($id in $businessIds) {
    Remove-MgBookingBusiness -BookingBusinessId $id
}

This approach is useful for bulk cleanup tasks, ensuring that all outdated or unused booking pages are deleted in one run.

Example 3: Bulk Removal Using CSV

For large organizations, removing multiple Booking Businesses using a CSV file is the most efficient method.

CSV File Format:

BookingBusinessId
ContosoDentalClinic@7xh7fj.onmicrosoft.com
ContosoENTClinic@7xh7fj.onmicrosoft.com
ContosoOrthoClinic@7xh7fj.onmicrosoft.com
                                        

PowerShell Script:

$csvFile = "C:\path\to\bookingbusinesses.csv"
$businesses = Import-Csv -Path $csvFile
foreach ($business in $businesses) {
    Remove-MgBookingBusiness -BookingBusinessId $business.BookingBusinessId
}
                                        

This script imports the list of BookingBusinessId values from a CSV file and deletes each Booking Business in a loop.

It’s particularly beneficial for scheduled maintenance tasks or tenant-wide cleanups.

This approach streamlines bulk Booking Business creation for enterprises managing multiple departments or regional offices.


Summary

Key Point Details
Cmdlet Name Remove-MgBookingBusiness
Purpose Deletes a Microsoft Bookings business entity from Microsoft 365
Required Scope Bookings.ReadWrite.All
Primary Parameter BookingBusinessId
Automation Benefit Enables automated cleanup of unused or outdated Booking Businesses
Use Case Tenant maintenance, offboarding, or batch deletion of Bookings data

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