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

Neethu K A 1 Reputation point
2021-07-13T13:25:37+00:00

'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.

Microsoft Teams
Microsoft Teams
A Microsoft customizable chat-based workspace.
10,265 questions
Not Monitored
Not Monitored
Tag not monitored by Microsoft.
39,536 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,544 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Rich Matheisen 46,801 Reputation points
    2021-07-13T14:38:50.143+00:00

    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.

    1 person found this answer helpful.

  2. Neethu K A 1 Reputation point
    2021-07-16T04:19:49.953+00:00

    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.


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.