windows net user command to work with network service

0

This might be a trivial question but I was wondering if it was possible to use the net user command in windows to give back useful information on the "NT Authority\Network Service" user. I have tried net user "NT Authority\Network Service" along with multiple variants of this but the command just spits out the usage info. The reason I am doing this is I have a batch script where a user enters in a user name and I check to see if that user is already on the computer using net user. If the user is present, nothing is done. If the user is not present, I create the user. I would like the user to be able to enter the network service user or the system user and still get the desired result. I thought I had gotten this to work before but cant seem to find how I did it.

user972276

Posted 2013-09-26T17:08:21.280

Reputation: 637

Answers

1

Net User won't show you those users, because they are not (regular) user accounts.

From MS:

The NetworkService account is a predefined local account used by the service control manager. This account is not recognized by the security subsystem, so you cannot specify its name in a call to the LookupAccountName function.

You can't use Net User to make an account named "NT Authority\Network Service" (or alike) anyway, so I'm not sure what your concern is. :)

Ƭᴇcʜιᴇ007

Posted 2013-09-26T17:08:21.280

Reputation: 103 763

Thanks! That answered my question. I am not exactly worried about net user creating the network service somehow, I am more concerned with my script giving a false reading in regards to it saying the user does not exist when it does. Since there is nothing I can do with regards to net user, I will just do something else. – user972276 – 2013-09-26T20:21:19.067