Reputation: 2166
I am trying to use the Microsoft Graph API to create OnlineMeetings here https://learn.microsoft.com/en-us/graph/api/application-post-onlinemeetings?view=graph-rest-1.0&tabs=http
But when configuring application access policy as instructed here:
https://learn.microsoft.com/en-us/graph/cloud-communication-online-meeting-application-access-policy
We got a 404 error:
New-CsApplicationAccessPolicy -Identity OnlineMeetings-Link -AppIds "xxx-xxx-xxx" -Description "xxxx Local"
Get-CsOnlineSession: /Users/xxx/.local/share/powershell/Modules/MicrosoftTeams/2.3.1/netcoreapp3.1/SfBORemotePowershellModule.psm1:63
Line |
63 | $remoteSession = & (Get-CsOnlineSessionCommand)
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| The remote server returned an error: (404) Not Found.
Invoke-Command: /Users/xxx/.local/share/powershell/Modules/MicrosoftTeams/2.3.1/netcoreapp3.1/SfBORemotePowershellModule.psm1:22959
Line |
22959 | … -Session (Get-PSImplicitRemotingSession -CommandName 'New-CsApplic …
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Cannot validate argument on parameter 'Session'. The argument
| is null or empty. Provide an argument that is not null or
| empty, and then try the command again.
I am an admin of the work/school account, and I have done all setup prerequisites:
https://learn.microsoft.com/en-us/microsoftteams/teams-powershell-install https://learn.microsoft.com/en-us/microsoft-365/enterprise/manage-skype-for-business-online-with-microsoft-365-powershell?view=o365-worldwide
I have all admin permissions to perform PowerShell cmdlet:
Environment:
PowerShell version: 7.1.3, installed with homebrew
MicrosoftTeams module version: 2.3.1
OS: Mac Mojave 10.14.6
I have no firewall, VPN/proxy enabled. The same issue happens when I tried it in the default PowerShell of Windows 10 VM on VirtualBox.
What should I do to get around this issue?
Upvotes: 8
Views: 2019
Reputation: 11411
Upgrade the microsoft teams powershell module to 2.4.0 which is the latest version.
Connect-MicrosoftTeams #Enter global Administrator account credential and make sure that you see Admin account details in connection output.
Now execute the New-CsApplicationAccessPolicy
New-CsApplicationAccessPolicy -Identity OnlineMeetings-Link -AppIds "applicationID" -Description "description here".
To create a online meeting on behalf of a user in Microsoft Teams using Graph API there are two possiblities :
Create an event in teams by doing a Post https://graph.microsoft.com/v1.0/me/events and add properties "isOnlineMeeting":True
and "onlineMeetingProvider":"teamsForBusiness"
in the Body of the request.
Sample:
POST https://graph.microsoft.com/v1.0/me/events
Prefer: outlook.timezone="Pacific Standard Time"
Content-type: application/json
{
"subject": "Meeting for New Member",
"body": {
"contentType": "HTML",
"content": "Hello Team"
},
"start": {
"dateTime": "2021-07-09T15:00:00",
"timeZone": "Pacific Standard Time"
},
"end": {
"dateTime": "2021-07-09T15:00:00",
"timeZone": "Pacific Standard Time"
},
"location":{
"displayName":"Virtual"
},
"attendees": [
{
"emailAddress": {
"address":"[email protected]",
"name": "User"
},
"type": "required"
}
],
"allowNewTimeProposals": true,
"isOnlineMeeting": true,
"onlineMeetingProvider": "teamsForBusiness"
}
If you use the above method then you can invite other users and the meeting appears in the calendar of the organizer.
Reference:
Create Event - Microsoft Graph v1.0 | Microsoft Docs
Create Online Meeting
You can directly create meeting by doing a post to POST https://graph.microsoft.com/v1.0/me/onlineMeetings
In the above method no invitations are sent and the meeting does not appear in the calendar of the organizer. You would need alternative means to distribute the dial-in link, etc.
Sample:
POST https://graph.microsoft.com/v1.0/me/onlineMeetings
Content-Type: application/json
{
"startDateTime":"2021-07-09T14:30:34.2444915-05:30",
"endDateTime":"2021-07-09T15:00:34.2464912-05:30",
"subject":"User Token Meeting"
}
Reference:
Create onlineMeeting - Microsoft Graph v1.0 | Microsoft Docs
Upvotes: 2
Reputation: 792
Looking at the error, the following could be the reasons
Request you to please check again and see if it works.
Upvotes: 1