Delete all contacts & contact groups from a Lync-2010 User

To delete all contacts & contacts groups from particular lync user, first we have to find out the internal ID of the lync user.
Through “rtc” SQL server database of lync, we can easily find it from “Resource” table.
Eg: Lync user Sign-In Address : bashar@sample.com
Open a new query window from the SQL server management studio and execute the following query

select ResourceId from Resource where UserAtHost=’bashar@sample.com’

You can see the internal ID of the user as query result. Eg:’395’

To delete all the contacts of the user with id 395, execute the below query:

delete FROM [rtc].[dbo].Contact where OwnerId=395

To delete all the contact group association of the user with id 395, execute the below query:

delete  FROM [rtc].[dbo].[ContactGroupAssoc]  where OwnerId=395

To delete all the contact groups of the user with id 395, execute the below query:

delete  FROM [rtc].[dbo].ContactGroup  where OwnerId=395

Related posts

Moving all Arbitration mailboxes to new database

by Jimmy
6 years ago

Recover Mail Boxes From non-reparable exchange edb databases

by Jimmy
6 years ago

Account Pictures from Active Directory (UserTile8 for Windows 8/8.1), Trouble shooting points

by Jimmy
11 years ago
Exit mobile version