* It is always better to try and restore the user via the web UI and see what was causing the error to begin with.
See if the user is associated with any pickupgroup or anyother
Always the user needs to be deleted from any group before it can be deleted. This can be accomplished by editing the user, selecting CM Endpoint Profile, and then clicking on the blue Editor icon .
Then, select the Group Membership and remove any groups that are assigned.
Below are the commands to delete it from SMGR database
select loginname, defaultcommprofilesetid from csuser where loginname in ('6***@pbx.xxx.com');
select * from cscommprofile where cscommprofilesetid in ('9xx');
select * from ipt_cm;
select count(*) from ipt_station where stationuser='6xxx@pbx.xxx.com';
delete from cmcommprofile where id='1xxx';
delete from cmcommprofile where id='1xxx';
select * from cscommprofile where id not in ( select id from cmcommprofile ) and commprofiletype = 'CM' ;
delete from cscommprofile where id not in ( select id from cmcommprofile ) and commprofiletype = 'CM' ;