The below SQL Query can be used to pull the details of Owner-Id assigned to the phones.
- Device – This table contains device-level information like IP Phones and gateways.
- Enduser – This table contains information about all Enduser in CUCM.
SQL query to List the complete devices and the Owner status.
Devices with PKID menioted NULL are Anonymus devices.
run sql select name as devicename, fkenduser as enduserpkid from device where requireCERlocation = 'f' and tkclass =1
SQL Query to list the devices Configured Anonymous
run sql select name as devicename, fkenduser as enduserpkid from device where fkenduser IS NULL and tkclass =1
SQL Query to list the Owner ID assigned to the devices.
run sql select device.name as devicename, enduser.userid as ownerid from device INNER JOIN enduser on enduser.pkid = device.fkenduser and requireCERlocation = 'f' order by userid