User added as externalGuest instead of administrator

Pawel Jarosz 41 Reputation points


I got an automation user with Office E3 license assigned, however when adding it with the New-MgBookingBusinessStaffMember istead of adding the user as "administrator", the account is being added as "extenalGuest" - anyone has any idea why this is happeninig?


Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
9,101 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Pawel Jarosz 41 Reputation points

    Ok, I figured that out - my application was missing Directory.Read.All permissions - this got me on the proper track:

    I just do not know how it was able to read my and my colleagues emailadresses, but not the service account, anyway, all of that is not important, as the setting up the business information does not work. When adding administrator I got an error:

    New-MgBookingBusinessStaffMember : An internal server error occurred. The operation failed., You don't have adequate permissions to make changes to mailbox Sid: S-1-5-21-3422892061-1135323251-2670905592-11348201 AccessDetails: MbxAccessAllow, 
    At line:1 char:1
    + New-MgBookingBusinessStaffMember -BookingBusinessId "Bookings-UserNa ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : InvalidOperation: ({ BookingBusine...ngStaffMember }:<>f__AnonymousType15`2) [New-MgBookingBu..._CreateExpanded], RestException`1
        + FullyQualifiedErrorId : ErrorInternalServerError,Microsoft.Graph.PowerShell.Cmdlets.NewMgBookingBusinessStaffMember_CreateExpanded

    The weird thing is - the admininistrator acctually finally appears in the list, the problem is - I still cannot set the settings. But listen to this stuff - if I go to GUI, open that particular admin card, and - changing nothing - click "Save" - it all works in MsGraph. No need to reload token, nothing, works instantly, like 1 nanosecond after I click "Save" - I can change the Booking settings using MsGraph. Well.. seems it is a bit not stable so won't use it anyway I guess.

    0 comments No comments

  2. Pawel Jarosz 41 Reputation points

    All works good now - I was experiencing the issue since I was creating booking resources with Exchange PowerShell (New-SchedulingMailbox) with service account who had no booking license and was just Exchange Administrator instead of creating it leveraging MS Graph API Booking PowerShell module by an account with a Booking license.

    Today I've created a booking using the GraphAPI PS module - all works well, details in here

    0 comments No comments