SQl Query to pull Device Owner

The below SQL Query can be used to pull the details of Owner-Id assigned to the phones.

Tables used. 

  • Device – This table contains device-level information like IP Phones and gateways.
  • Enduser – This table contains information about all Enduser in CUCM.

Sql Query.

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
Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s