Hi @achal
It depends on whether you are creating the online meeting on behalf of the logged-in user or another user.
If you are creating a meeting on behalf of a logged-in user, you will be able to call the /me
API to get the logged-in user's information. However, this is only available in the context of delegation, you must grant the application the delegation permission, and then use the delegated authentication flow (auth code flow or ROPC flow) to obtain an access token.
If you are creating a meeting on behalf of another user, before doing so, you need to create an application access policy and assign the policy to the user to grant the application access to the user. Since this is an application-only context, the /me
endpoint cannot be called because no user login exists for that context, you can only call the /users/{user id}
endpoint to get other users' information.
Import-Module MicrosoftTeams
$userCredential = Get-Credential
Connect-MicrosoftTeams -Credential $userCredential
New-CsApplicationAccessPolicy -Identity Test-policy -AppIds "{app id}" -Description "description here"
Grant-CsApplicationAccessPolicy -PolicyName Test-policy -Identity "{user id}"
Note that whether you are creating an online meeting on behalf of a logged-in user or another user, the target user must be granted an O365 license.
Hope this helps.
If the reply is helpful, please click Accept Answer and kindly upvote it. If you have additional questions about this answer, please click Comment.