PSSession to Skype-Server

Ask your Windows PowerShell-related questions, including questions on cmdlet development!
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Locked
User avatar
bhnuser
Posts: 42
Joined: Fri Apr 06, 2018 7:35 am

PSSession to Skype-Server

Post by bhnuser » Fri Mar 22, 2019 7:17 am

Hello everybody,

i got some problems with a script from the internet. It works on my Skype for Business Server 2015 but if i create a PowerShell-Session to the Server it won't work. Which script i use is Get-fBNumbers.ps1 (can found on the internet).
My Problem is now, if i import the PowerShell-Session it doesn't import all cmdlets from the server (Skype for Business Server). There are missing cmdlets like Get-CSServerVersion or Get-CsUnassignedNumber.
Does anyone has a solution?

Here is my part to connect to the Skype Server:

Code: Select all

		
		$SkypeSession = New-PSSession -Credential $Credentials -ConnectionURI "https://$SkypeForBusinessServer/OcsPowershell" -AllowRedirection #-WarningAction SilentlyContinue
		if ($?)
		{
			Import-PSSession $SkypeSession

User avatar
jvierra
Posts: 13733
Joined: Tue May 22, 2007 9:57 am
Contact:

Re: PSSession to Skype-Server

Post by jvierra » Fri Mar 22, 2019 8:34 am

Those commands are not available for skype online.

The following will show you all available remote commands.

Code: Select all

$SkypeSession = New-PSSession -Credential $Credentials -ConnectionURI "https://$SkypeForBusinessServer/OcsPowershell" -AllowRedirection
Import-PSSession $SkypeSession

Get-Command Get-CS*

User avatar
bhnuser
Posts: 42
Joined: Fri Apr 06, 2018 7:35 am

Re: PSSession to Skype-Server

Post by bhnuser » Wed Apr 10, 2019 11:38 pm

I'm aware of how I can see the cmdlets. The problem was that on the Skype server the cmdlets are displayed to me but not in a PowerShell session on my local machine.
Now I have solved the problem. It was a mistake in the permission. I missed a higher privilege group to pull all the commands in the PowerShellSession.

Locked