Cisco Phone Directory Lookup
Click here to view and download the files.
Function: This script queries the Cisco Phone Directory - supplementing or replacing the directory lookup on the VOIP phone.
Requirements: The zip file needs to be extracted to C:\Scripts\Cisco (or the shortcut modified to reflect the actual location).
The "Phone Directory" shortcut can be dragged to the desktop or other location.
Input is not case-sensitive.
Usage: Double-Click the "Phone Directory" shortcut. The script will then run and prompt for search parameters (First Name, Last Name, Number).
The query can be performed based on any part of the names or number (i.e. you can search for "Chris" and it will find Chris, Christopher, Christine, etc.
Output: The script will return the results based on the search parameters.
$baseurl = "https://<Cisco Call Manager hostname>:8443/ccmcip/xmldirectorylist.jsp?"
$first = Read-Host "First Name "
$last = Read-Host "Last Name "
$num = Read-Host "Number "
$url = $baseurl + "f=$first&l=$last&n=$num"
[xml]$entry = Invoke-WebRequest $url
$entry.CiscoIPPhoneDirectory.DirectoryEntry | FT -Auto
} Until ($false)
This script is a very simple one. It first defines the base url for the query jsp location on the Call Manager, and then prompts for the search parameters. The script then does a web request to the url with the search parameters and returns the results. This functionality is wrapped in a Do-Loop so that multiple queries can be run without having to relaunch the script. When the user is finished querying the directory, the window can simply be closed.