-
Notifications
You must be signed in to change notification settings - Fork 2
Getting Started
Basics Powershell-UCSAPI ("UCS Toolkit") is a Powershell module to allow scripts to be written to manage Polycom phones and devices.
The module provides ways to interact with most known capabilities on the phone. These are too numerous to list, but common uses include: Phone Restart Sign-In Device Info Installation Installation works in the same way as most custom PowerShell modules: Download the module - On GitHub, use the "Clone or Download" link, then choose "Download ZIP." Extract the ZIP file. Copy the "UCS" folder to one of your PowerShell module directories. By default, these are: System-Wide: C:\Windows\System32\WindowsPowershell\v1.0\Modules This User: %UserProfile%\Documents\WindowsPowerShell\Modules Configuration Because the module is generically written, you must configure it with default credentials to sign into the phones. Each API in the module has its own credential configuration, and as a user you can choose to set these credentials at runtime or to have the system save them on your behalf. On an administrator workstation, I'd recommend enabling credential/configuration storage. For scripts, I'd recommend setting the configuration at runtime. These instructions are for setting up on a workstation. NOTE: These instructions need to be validated. Please test them out and remove this notice if it's working correctly. Open Powershell. Enable saving configuration and credentials in the module configuration: Enable-UcsConfigCredentialStorage Enable-UcsConfigStorage Enable-UcsProvConfigStorage For the remainder of the configuration, you'll need to know which APIs you will be configuring. These are currently supported: REST Web Push Poll Provisioning SIP For each API you would like you use (except SIP), you'll need to configure credentials to use. REST and Web use the same credentials, and Push and Poll work the same way. For our environment, run: $PhoneCredential = Get-Credential "Polycom" #When prompted, provide the phone admin PIN as the password. $PushCredential = Get-Credential "UCSToolkit" #When prompted, provide the password you'd like to use. Your provisioning server must set this password. New-UcsConfigCredential -API REST -Credential $PhoneCredential -DisplayName "REST Credential" -Priority 1 -Enabled $true -Identity "" New-UcsConfigCredential -API Web -Credential $PhoneCredential -DisplayName "Web Credential" -Priority 1 -Enabled $true -Identity "" New-UcsConfigCredential -API Push -Credential $PushCredential -DisplayName "Push Credential" -Priority 1 -Enabled $true -Identity "" New-UcsConfigCredential -API Poll -Credential $PushCredential -DisplayName "Poll Credential" -Priority 1 -Enabled $true -Identity "" If you'd like to enable access to provisioning data, including call logs, run these commands: New-UcsProvConfigServer -ProvServerAddress "\path\to\file\share" -ProvServerType FileSystem -Priority 1 Finding Phones Prerequisite: You must have the DHCP Powershell Module (from the Remote Server Administration Tools) installed on your system.
In many cases, you'll need to retrieve a list of all phones to be able to take an action. Common examples include break/fix ("here's a phone MAC address, I'm having this problem with it"), or simply rebooting a wide subset of phones. The Find-UcsPhoneByDHCP cmdlet retrieves phone info from all DHCP servers in an AD environment. You must have read-level access on the DHCP server to read DHCP leases. It's also designed to read only from the AD Domain your computer is joined to.
To get a list of phones by IP and MAC address: $Phones = Find-UcsPhoneByDHCP
To get a list of phones in a particular IP range: $Inglewood = Find-UcsPhoneByDHCP | ? IPv4Address -like "192.168.2.*"
The phones returned by this cmdlet are all phones known to DHCP by MAC address prefix. Phones that are not online may also be included here. Other Common Tasks Prerequisite: Follow the steps in "Finding Phones" to create a $Phones variable.
Once you've got a list of phones, you may want to take an action on one or more of them. Here are some common tasks and how to complete them:
Get a list of all online phones and their current basic info. You may want to put these into a variable, as there can be quite a few: $Phones | Get-UcsPhoneInfo
Restart all phones with a particular IP address range: $Phones | ? Ipv4address -like "192.168.1.*" | restart-ucsphone -Confirm:$false #This will restart all phones returned by the filter without further questions. Make sure you've got the right group before pressing "enter."
Sign a user into a specific phone by MAC address: $Phones | ? MacAddress -like "*1b3d5f" | Register-UcsWebLyncUser -Extension 54321 -Pin 1234