Forum Discussion
Fwaggle
Aug 11, 2022Copper Contributor
mgbookingbusiness command returns error when using graph bookings application scopes.
using microrsoft.graph.bookings pwsh module connected to azure ad app with application scopes: -bookings.appointment.readwrite.all -bookings.read.all tried to retrieve list of calendars and g...
robcaretta
Nov 03, 2023Copper Contributor
Same issue for me. I was able to make this work. The first part uses Delegated permissions, the second part uses Application permissions.
# Use Delegated Permissions ------------
Connect-MgGraph -UseDeviceAuthentication -Scope "Bookings.Read.All"
Select-MgProfile -Name v1.0
$bookingBusinessList = Get-MgBookingBusiness -All
Disconnect-MgGraph
# Use Applications Permissions ---------
Connect-MgGraph -TenantId $TenantID -ClientId $AppID -CertificateThumbprint $certThumb
Select-MgProfile -Name v1.0
foreach($bbl in $bookingBusinessList) {
$bbl.Id
$bookingBusiness = Get-MgBookingBusiness -BookingBusinessId $bbl.Id
$bookingBusiness | FL
}
Disconnect-MgGraph