question

NeethuKA-8957 avatar image
0 Votes"
NeethuKA-8957 asked JimmyYang-MSFT commented

Get-CsOnlineSession : The remote server returned an error: (404) Not Found.

'New-CsApplicationAccessPolicy -Identity Test-policy -AppIds "xxxxxxxxxxxxxxxx" -Description "description here"'

While running this command getting an error like this.

Get-CsOnlineSession: The remote server returned an error: (404) Not Found.

Invoke-Command: 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.

 + FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.PowerShell.Commands.InvokeCommandCommand.

Why this is happening? We are using Windows PowerShell version 5.1.14393.4467. And imported the latest MicrosoftTeams Powershell Module.


I have followed all the steps in the documentation. Also, the firewall and antivirus are off. But still having the same issue.

office-teams-windows-itprowindows-server-powershellnot-supported-azure
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @NeethuKA-8957

What is your version of Teams PowerShell? The latest version is 2.4.0 preview.
Could you please confirm that you have permissions to create application access policy?

0 Votes 0 ·

The Powershell version is the latest. And how do I know if have permission to create an application access policy?

0 Votes 0 ·
RichMatheisen-8856 avatar image
0 Votes"
RichMatheisen-8856 answered NeethuKA-8957 commented

Are you running this from the PowerShell ISE? If so, try it from a PowerShell session.

There are a number of posts that report the same problem, but I haven't found any that offer a verified reason for it.

· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I tried both PowerShell ISE and Normal Windows Powershell. Also tried the Powershell Session. Still there is no change.

0 Votes 0 ·

Is the account that runs the script assigned the necessary role/permission to accomplish this?

0 Votes 0 ·

Yes. It is the admin account with all permissions.

0 Votes 0 ·
NeethuKA-8957 avatar image
0 Votes"
NeethuKA-8957 answered JimmyYang-MSFT commented

It got fixed. We need to set the user "Teams Administrator" role in https://portal.office.com/AdminPortal/Home#/users And it will take up to 24 hours to work.

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@NeethuKA-8957

Glad to see it can be fixed. If you have any new update on this issue, please feel free to contact with us!

0 Votes 0 ·