Showing results for 
Search instead for 
Did you mean: 

Can CLI be used on CUCM to provide a DN for an entered MAC



  We have a Cisco CUCM deployment in our environment. I'm wondering if there might be a way to use CLI / PowerShell / Whatever to query our CUCM for whatever DN is associated for a provided MAC address. The idea here being this is easier to write into a script and way faster than using the CUCM's GUI. ANy thoughts (or a different way to accomplish the same thing) are appreciated

8 Replies 8


Nithin Eluvathingal
VIP Mentor VIP Mentor
VIP Mentor

if its just queries You can use SQL queries to pull the detail from CUCM DB using CLI. Queries can be made referring  the DB table CUCm publish for each version.

You can add modify Delete using AXL api as @b.winter mentioned. 

I use a python script which use SAOP to connect with CUCM and use AXL api to make changes on CUCM. 

Response Signature

Maren Mahoney
VIP Advocate VIP Advocate
VIP Advocate

There is, I'm sure, a SQL Query that can pull for all MACs and their associated DNs. It would be a simple matter to replace the "All MACs" part of the query for a specific MAC in a text editor and then use the MAC-specific version of the query on the CUCM CLI.

I am not savvy on writing such a SQL query. @Nithin Eluvathingal  - Can you help with that?


Very cool - thank you

I don't know anything about SQL myself, but I'll betcha our database team does

From CLi Run the below and it gives you all the MAC with extensions by the order of extensions.

run sql select as DeviceMAC, numplan.dnorpattern as Extension from device ,numplan , devicenumplanmap where devicenumplanmap.fkdevice =device.pkid and devicenumplanmap.fknumplan =nUMPLAN.pkid and tkclass =1 order by Numplan.dnorpattern



The below gives mac address extensions with CSS.



run sql select as DeviceMAC, numplan.dnorpattern as Extension, as CSS from device ,numplan , devicenumplanmap , callingsearchspace where devicenumplanmap.fkdevice =device.pkid and devicenumplanmap.fknumplan =nUMPLAN.pkid and numplan.fkcallingsearchspace_sharedlineappear= callingsearchspace.pkid and tkclass =1  order by

Response Signature

Thank you Nithin. We'll give this a shot later today / tomorrow!

Elliot Dierksen
VIP Engager VIP Engager
VIP Engager

It can be done via AXL, but you can also do it in the CLI like this.

admin:run sql select, device.description from numplan, devicenumplanmap, device where numplan.dnorpattern = '4321' and numplan.pkid = devicenumplanmap.fknumplan and devicenumplanmap.fkdevice = device.pkid
name                             description
================================ ================================
AALN/S0/         AALN/S0/

OKay cool - I'll look into this AXL thing. Thank you!

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Recognize Your Peers