views:

1557

answers:

3

The bossman wants to know how to delete a user in Sharepoint. We've got him convinced that deleting a user is too difficult because of traces of that user through the system, so now he wants to be able to change the username to all Xs or somesuch. I've poked around the DB and found a couple of UserInfo tables, one in SharePoint_AdminContent_<guid> db and another in SharedServices. Is there a better way to change usernames? Am I on the wrong track?

Thanks.

+2  A: 

Please don't access the database directly as it's not supported ; you may even destroy integrity in the process.

If you really want to "remove" all trace of a user, I suggest looking to "stsadm -o migrateuser" to rename the user to a dummy XXX user created in your membership provider.

Edit: it's migrateuser and not renameuser, my mistake

http://technet.microsoft.com/en-us/library/cc262141.aspx

Nico
+1 http://blogs.msdn.com/mikefitz/archive/2005/04/01/404802.aspx
Alex Angas
stsadm -o renameuser:Missing operation name or the operation name is invalid.Perhaps this was removed with 2007?
Chloraphil
+1  A: 

There is "stsadm -o deleteuser". See this TechNet article. That command will delete a user from a site collection.

You can also find more options on Keith Richie's blog. That is from WSS 2.0 / SPS 2003 era but there is a lot of good information there.

Alex Angas
A: 

The reason you cannot remove users from SharePoint is because users are not stored in SharePoint. Users are stored in the respective membership provider: AD, aspnetsqlmembershipprovider, etc.

The process for removing a user from SharePoint's environment is to first go to your membership provider and delete the user there. After you have done this, you have a choice.

  1. You can leave the user's artifacts for legacy information. Ie, Joe Blow created a document and even though Joe Blow doesn't exist anymore (hit by bus) it's good to know that he created the document.
  2. Alternatively, you can run the stsadm -o deleteuser command Alex mentioned (once per site collection), which should disassociate that user from all their artifacts for that site collection. Any documents the user created will now be owned by the system administrator (I believe). An example of using this option is when the user account was misspelled and you want to remove all traces before creating the correct account.
Nathan DeWitt