To connect to the Microsoft Skype for Business servers both in house and in the cloud I use the following commands:
$credential=get-credential
“DOMAIN\USERNAME“
$session=
New-PSSession
-ConnectionUri
“https://FEPOOL/ocspowershell“
-Credential $credential
Import-PSSession
$session
The username needs to be a member of the Skype for business administrators group to be able to connect and execute the commands.
The connectionuri perameter can either be a local skype for business server or the tenant name of the MSOnline tenant.
Once connected, you can run the desired commands as normal. For example, once connected to the skype for business servers, you can execute commands such as get-csuser to find the users in the skype environment.