User added as externalGuest instead of administrator

Pawel Jarosz 46 Reputation points
2022-03-30T12:05:38.777+00:00

Hi,

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?

188421-image.png

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

2 answers

Sort by: Most helpful
  1. Pawel Jarosz 46 Reputation points
    2022-03-30T23:55:14.16+00:00

    Ok, I figured that out - my application was missing Directory.Read.All permissions - this got me on the proper track: https://stackoverflow.com/questions/64679429/ms-graph-api-booking-business-adding-staff-members-with-administrator-role

    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 Bookings-UserName@bookings.domain.co.uk. 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 46 Reputation points
    2022-03-31T19:38:16.777+00:00

    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 https://learn.microsoft.com/en-us/answers/questions/791603/update-mgbookingbusiness-returns-an-34access-is-de.html?childToView=795923#answer-795923

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.