Skype for Business with PowerShell
There are many common daily tasks a Skype for Business Administrator will need to complete in their daily management of Office 365 Skype for business; one such task is that of managing user accounts. You want to see what users have been enabled for Skype for Business.
You will want to sign-in to Skype for Business PowerShell to run these commands
Connecting to Skype for Business Online by using Windows PowerShell
After you have installed the prerequisite software, you are ready to begin using Windows PowerShell to manage Skype for Business Online. To do that, you begin by opening a standard instance of Windows PowerShell. You don’t need to open a special instance of Windows PowerShell (similar to, say, the Lync Server Management Shell), nor do you need to open a Control Panel app or any other special type of application. This is because Skype for Business Online management is performed by using a remote session of Windows PowerShell.
In turn, this means that:
- You use a regular session of Windows PowerShell to connect to Skype for Business Online. When connecting remotely, you work on your local computer and you use your local copy of Windows PowerShell, but you manage objects found on a remote system (that is, Skype for Business Online).
- All the cmdlets, scripts, and other items needed to manage Skype for Business Online are downloaded to your computer. These items are kept in memory and are available only in the remote session established with Skype for Business Online. This is important to keep in mind. When you make a remote connection to Skype for Business Online, the Skype for Business Online cmdlets—such as Get-CsTenant—will be copied, in memory, to your computer. In your remote session, you’ll be able to run these cmdlets. However, these cmdlets are available only in that remote session. For example, you might start a second session of Windows PowerShell, but without connecting to Skype for Business Online in this session. If you try to run the Get-CsTenant cmdlet from within that session, you’ll receive the following error message:
Get-CsTenant : The term 'Get-CsTenant' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
User Account Management:
Return information about all your Skype for Business Online users
Get-CsOnlineUser - To return information about all your users who have been enabled for Skype for Business Online
(this can be a very long report)
Get-CsOnlineUser -ResultSize 1 - To return information for a single, randomly-selected user
(for example, to use this account for test purposes), call the Get-CsOnlineUser cmdlet and set the ResultSize parameter to 1:
Lets say you want to get the results for many users, in our case we'll say 6 users. You can run the following command. Get-CsOnlineUser -ResultSize 6 - Run this command to get the results back for 6 users