CRM decides which user account to use by finding the logged in user’s ObjectSID in the MSCRM database systemuserauthentication table.
You can get your ObjectSID out of Active Directory ( dsa.msc ) if you have a 32 bit server by registering a dll from the windows server 2003 resource toolkit ( http://download.microsoft.com/download/8/e/c/8ec3a7d8-05b4-440a-a71e-ca3ee25fe057/rktools.exe ) (I don't know how to make it work on 64 bit; docs say 64 bit is not supported) - install toolkit, copy acctinfo.dll to c:\windows\system32 (copy step may not be necessary), "regsvr32 acctinfo.dll". Then browse to user in AD ( start/run/dsa.msc ) and look at the 'additional account info' tab (doesn't show up when user is found using find, unfortunately).
Now that you have an ObjectSID, that can be found in the authinfo column of systemuserauthentication , which gives you a userid. You can use that userid to query systemuser and get a default organization id; You can use that organizationid and userid to query systemuserorganizations , which gives you a crmuserid. Finally this crmuserid guid is the systemuser id for your actual organization’s CRM database. Note that the two different systemuser tables are unrelated and use different guids; one is for the crm config db, and one is for your organization crm db.