Okay, I have a workstation that's pretty fresh and has been added to the domain and restarted to be added to the domain.
Before restarting, I added a value to the registry key "HKLM SOFTWARE Microsoft Windows CurrentVersion RunOnce" to run a batch file that runs the following command:
net localgroup Administrators domainsomeguy /add
But! I do not know which user is executing this command. It appears that the user must be authenticated to the domain to add this user to the local Administrators group.
Now I could execute the command like this and write it to a file to find out what's going on:
net localgroup Administrators domainsomeguy /add > C:soDidThatWork.txt
echo %errorlevel% >> C:soDidThatWork.txt
and if it worked, I would probably get one
0 in the content of the file.
If not, I would probably get something else … maybe an error message and a random number of
public int main(),
It would appear that I have to specify a type of domain credentials to add a domain user to a local Administrators group.