Mr. Mike Gibson's Cisco Info
Useful commands and SQL.
Useful CISCO command line commands
Favorite commands that can't be done in Web GUI

show commands:

Show CUBE commands

run sql commands:

Show CUPS commands for UC information

Hide CUCM commands for phone ownership changes
Cisco CM - User leaving and new user (John Doe) replacing.
Change all standard BLFs to new name:
run sql update blfspeeddial set label='John Doe',labelascii='John Doe' where blfdestination='82345'
Newer CUCM versions hide labelascii, so using:
run sql update blfspeeddial set label='John Doe' where blfdestination='82345'
works fine, but will not replace previous existing labelascii

Change all Alerting Names associated with a DN:
run sql update numplan set alertingname='John Doe',alertingnameascii='John Doe' where dnorpattern = '82345'

Change all Display Names to new user:
run sql update devicenumplanmap set display='John Doe',displayascii='John Doe' where display = 'Mary Johnson'

Change all devices that belonged to old user to new user:
run sql select pkid,userid from enduser where userid = 'jldoe' or userid = 'mljohns'
run sql update device set fkenduser='(string output from new kpid)' where fkenduser='(string output from old kpid)'

Change the name of Remote Destination profiles and Jabber device profiles:
run sql update device set name='CSFjldoe' where name='CSFmljohns'
run sql update device set name='RDP_jldoe' where name='RDP_mljohns'

Update or Add external masking to a user's phone:
run sql update devicenumplanmap set e164mask='84300' where display = 'John Doe'

Cisco CM - User leaving and new user replacing -- linked BLFs only

Change all linked BLFs to new name:
run sql select pkid from numplan where dnorpattern = '82345'
run sql update blfspeeddial set label='John Doe',labelascii='John Doe' where fknumplan='(string output from kpid)'

Tip:
Remeber you can always embed a select within an update like this:
run sql update device set fkenduser = ( select pkid from enduser where userid = 'jldoe' ) where name = 'SEPA1B2A3B4A5B6'

Show CUCM commands for jabber information
Show CUCM commands for BLF phone information
Show CUCM commands for phone information
Show CDR commands for phone information

Show TABLE information