Question:
I use the code found at http://support.microsoft.com/kb/306273
to add a windows user. The problem is i need to add the user to a group, but the gro
Looking up the account by SID is the best way to go. It's a bit contrived, but the way it works is this:
The Administrator account's SID always starts with S-1-5-21 and ends with -500. Everything else in-between is random (the domain's SID).
The Guest account's SID always starts with S-1-5-21 and ends with -501.
The Microsoft KB article describing this is available here.
To find these accounts, you'd have to enumerate all of the accounts on the local machine and find which SIDs start with and end with those numbers. Once they match, you've got the built-in accounts. Not the nicest way to do it, but it works.
There is also a group policy setting under Security Settings\Local Policies\Security Options called Accounts: Rename administrator account and Accounts: Rename guest account. I wasn't able to find where in the registry these settings are stored, but if you are able to find out and you look them up, you will most likely be able to get the "official" names of these two accounts.