question

HugoSnchezSnchez-9338 avatar image
0 Votes"
HugoSnchezSnchez-9338 asked JimmyYang-MSFT commented

When I use this command New-CsOnlinePSTNGateway, powershell send an error Get-CsOnlineSession : The remote server returned an error: (403) Forbidden

PS C:\Windows\system32> New-CsOnlinePSTNGateway -Fqdn essbc2.sip4teams.com -SipSignalingPort 5082 -Enabled $true
Get-CsOnlineSession : The remote server returned an error: (403) Forbidden.
At C:\Program Files\WindowsPowerShell\Modules\MicrosoftTeams\2.5.1\net472\SfBORemotePowershellModule.psm1:273 char:22
+ $remoteSession = & (Get-CsOnlineSessionCommand)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Get-CsOnlineSession], WebException
+ FullyQualifiedErrorId : WebException,Microsoft.Teams.ConfigApi.Cmdlets.GetCsOnlineSession


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.
At C:\Program Files\WindowsPowerShell\Modules\MicrosoftTeams\2.5.1\net472\SfBORemotePowershellModule.psm1:113 char:38
+ -Session $session `
+ ~~~~~~~~
+ CategoryInfo : InvalidData: (:) [Invoke-Command], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.PowerShell.Commands.InvokeCommandCommand

office-teams-windows-itprowindows-server-powershell
· 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 @HugoSnchezSnchez-9338

What is your version of Teams PowerShell?

To make sure if you have the admin right, it recommends you check if you set the user "Teams Administrator" role in https://portal.office.com/AdminPortal/Home#/users.

0 Votes 0 ·

Hi @JimmyYang-MSFT


PS C:\Windows\system32> $PSVersionTable.PSVersion

Major Minor Build Revision


5 1 14393 4583


My user is Admin Global and Teams Admin

Thanks

131115-admin.png


0 Votes 0 ·
admin.png (24.4 KiB)

1 Answer

LimitlessTechnology-2700 avatar image
0 Votes"
LimitlessTechnology-2700 answered JimmyYang-MSFT commented

Hello,

Thank you for your question.

I would like to suggest you below troubleshooting steps.

Run the powershell command in Normal powershell window instead of ISE.

Also ,Please have a look on below Microsoft article mentioning how to connect to different Microsoft services using poweshell.

https://docs.microsoft.com/en-us/microsoft-365/enterprise/connect-to-all-microsoft-365-services-in-a-single-windows-powershell-window?view=o365-worldwide


If the reply was helpful, please don’t forget to upvote or accept as answer.

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

@HugoSnchezSnchez-9338

Just checking in to see if above information was helpful. If you have any further updates on this issue, please feel free to post back.

I checked your PowerShell version and it seems no issue. Could you try to use another commands to see if it has the same question?

0 Votes 0 ·
JimmyYang-MSFT avatar image JimmyYang-MSFT JimmyYang-MSFT ·

@HugoSnchezSnchez-9338

It has been a while, how is everything going?
If you have any update about this issue, please feel free to post back.

0 Votes 0 ·