The New-MgBookingBusinessCustomer cmdlet allows administrators to create new customer profiles within a Microsoft Bookings business. This cmdlet is part of the Microsoft Graph PowerShell module and helps automate customer management by programmatically adding clients to a booking business.
Each customer record can include contact details, such as email, phone number, and address, making it easier for businesses to maintain organized customer information for scheduling, reminders, and personalized communications.
This cmdlet is useful when businesses need to:
Using this cmdlet ensures faster, accurate, and scalable customer management for Microsoft Bookings.
Before using this cmdlet, make sure you have:
Install-Module Microsoft.Graph -Scope CurrentUser
Connect-MgGraph -Scopes "Bookings.ReadWrite.All"
To create a new customer record in a specific booking business, use the following syntax:
New-MgBookingBusinessCustomer -BookingBusinessId <String> -BodyParameter <PSObject>
The -BodyParameter contains the customer’s details as a PowerShell hashtable, including fields like DisplayName, EmailAddress, Phone, and Address.
This example creates a single customer profile within a Microsoft Bookings business.
$customerDetails = @{
displayName = "John Doe"
emailAddress = "john.doe@example.com"
phone = "+1234567890"
address = @{
street = "123 Main St"
city = "Metropolis"
state = "NY"
postalCode = "10001"
countryOrRegion = "US"
}
}
New-MgBookingBusinessCustomer -BookingBusinessId "business-id" -BodyParameter $customerDetails
This command adds John Doe as a customer to the specified Booking Business.
The following script creates multiple customers by looping through an array of customer hashtables.
$customers = @(
@{
displayName = "Jane Smith"
emailAddress = "jane.smith@example.com"
phone = "+0987654321"
address = @{
street = "456 Broadway"
city = "Gotham"
state = "NY"
postalCode = "10002"
countryOrRegion = "US"
}
}
@{
displayName = "Bob Brown"
emailAddress = "bob.brown@example.com"
phone = "+1122334455"
address = @{
street = "789 Park Ave"
city = "Central City"
state = "CA"
postalCode = "90001"
countryOrRegion = "US"
}
}
)
foreach ($customer in $customers) {
New-MgBookingBusinessCustomer -BookingBusinessId "business-id" -BodyParameter $customer
}
This script helps bulk-add customer records for multiple individuals at once, which is ideal for onboarding batches of clients.
You can import customer data from a CSV file to create multiple customers efficiently.
CSV File Structure:
DisplayName,EmailAddress,Phone,Street,City,State,PostalCode,CountryOrRegion
John Doe,john.doe@example.com,+1234567890,123 Main St,Metropolis,NY,10001,US
Jane Smith,jane.smith@example.com,+0987654321,456 Broadway,Gotham,NY,10002,US
Bob Brown,bob.brown@example.com,+1122334455,789 Park Ave,Central City,CA,90001,US
PowerShell Script:
$csvData = Import-Csv -Path "C:\Path\To\Customers.csv"
foreach ($row in $csvData) {
$customerDetails = @{
displayName = $row.DisplayName
emailAddress = $row.EmailAddress
phone = $row.Phone
address = @{
street = $row.Street
city = $row.City
state = $row.State
postalCode = $row.PostalCode
countryOrRegion = $row.CountryOrRegion
}
}
New-MgBookingBusinessCustomer -BookingBusinessId "business-id" -BodyParameter $customerDetails
}
This example is particularly useful for migrating existing client data from CRM or external databases into Microsoft Bookings.
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.
| Key Point | Details |
|---|---|
| Cmdlet Name | New-MgBookingBusinessCustomer |
| Purpose | Creates a new customer profile in a Microsoft Bookings business |
| Required Scope | Bookings.ReadWrite.All |
| Primary Parameter | BookingBusinessId, BodyParameter |
| Automation Benefit | Simplifies and automates the addition of customers to Bookings |
| Use Case | Ideal for bulk importing and automated customer registration |
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