Need Batch File/Script To Find Multiple Usernames Using Their Machine Names [on hold]
up vote
0
down vote
favorite
I have a list of about 200 machine names. I need to get the UserName of the person on each of those machines.
I can do it individually using the following command. But I'm not looking to do this 200 times and then manually write the results in spreadsheet.
wmic.exe /node:"<MachineName>" ComputerSystem Get UserName
I've been searching for a script that will run through a list of about 200 machine names one by one, and document the result back into a spreadsheet or text document. The format isn't as important as just being able to get that info out of the CMD line and email a document to someone.
batch script username
New contributor
put on hold as unclear what you're asking by Twisty Impersonator, Toto, bertieb, Canadian Luke, G-Man 17 hours ago
Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
add a comment |
up vote
0
down vote
favorite
I have a list of about 200 machine names. I need to get the UserName of the person on each of those machines.
I can do it individually using the following command. But I'm not looking to do this 200 times and then manually write the results in spreadsheet.
wmic.exe /node:"<MachineName>" ComputerSystem Get UserName
I've been searching for a script that will run through a list of about 200 machine names one by one, and document the result back into a spreadsheet or text document. The format isn't as important as just being able to get that info out of the CMD line and email a document to someone.
batch script username
New contributor
put on hold as unclear what you're asking by Twisty Impersonator, Toto, bertieb, Canadian Luke, G-Man 17 hours ago
Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
get the UserName of the person on each of those machines... do you mean the username of the currently logged on user?
– Twisty Impersonator
Nov 14 at 17:01
I'm voting to close this question as off-topic because we are not a script writing service
– Canadian Luke
yesterday
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have a list of about 200 machine names. I need to get the UserName of the person on each of those machines.
I can do it individually using the following command. But I'm not looking to do this 200 times and then manually write the results in spreadsheet.
wmic.exe /node:"<MachineName>" ComputerSystem Get UserName
I've been searching for a script that will run through a list of about 200 machine names one by one, and document the result back into a spreadsheet or text document. The format isn't as important as just being able to get that info out of the CMD line and email a document to someone.
batch script username
New contributor
I have a list of about 200 machine names. I need to get the UserName of the person on each of those machines.
I can do it individually using the following command. But I'm not looking to do this 200 times and then manually write the results in spreadsheet.
wmic.exe /node:"<MachineName>" ComputerSystem Get UserName
I've been searching for a script that will run through a list of about 200 machine names one by one, and document the result back into a spreadsheet or text document. The format isn't as important as just being able to get that info out of the CMD line and email a document to someone.
batch script username
batch script username
New contributor
New contributor
New contributor
asked Nov 14 at 15:59
ChargerStone
32
32
New contributor
New contributor
put on hold as unclear what you're asking by Twisty Impersonator, Toto, bertieb, Canadian Luke, G-Man 17 hours ago
Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
put on hold as unclear what you're asking by Twisty Impersonator, Toto, bertieb, Canadian Luke, G-Man 17 hours ago
Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
get the UserName of the person on each of those machines... do you mean the username of the currently logged on user?
– Twisty Impersonator
Nov 14 at 17:01
I'm voting to close this question as off-topic because we are not a script writing service
– Canadian Luke
yesterday
add a comment |
get the UserName of the person on each of those machines... do you mean the username of the currently logged on user?
– Twisty Impersonator
Nov 14 at 17:01
I'm voting to close this question as off-topic because we are not a script writing service
– Canadian Luke
yesterday
get the UserName of the person on each of those machines... do you mean the username of the currently logged on user?
– Twisty Impersonator
Nov 14 at 17:01
get the UserName of the person on each of those machines... do you mean the username of the currently logged on user?
– Twisty Impersonator
Nov 14 at 17:01
I'm voting to close this question as off-topic because we are not a script writing service
– Canadian Luke
yesterday
I'm voting to close this question as off-topic because we are not a script writing service
– Canadian Luke
yesterday
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
accepted
If you put all the computers in a text file called comps.lst
this should work:
for /f %a in (comps.lst) do @wmic.exe /node:"%a" ComputerSystem Get UserName
3
<MachineName>
or%a
?
– pbies
Nov 14 at 16:15
1
It would work if I could substitute <MachineName> in the script with the text entry (the actual machine name) on each line.
– ChargerStone
Nov 14 at 16:24
Sorry. Fixed to replace with %a
– uSlackr
Nov 14 at 18:06
This was perfect! Thanks!
– ChargerStone
yesterday
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
accepted
If you put all the computers in a text file called comps.lst
this should work:
for /f %a in (comps.lst) do @wmic.exe /node:"%a" ComputerSystem Get UserName
3
<MachineName>
or%a
?
– pbies
Nov 14 at 16:15
1
It would work if I could substitute <MachineName> in the script with the text entry (the actual machine name) on each line.
– ChargerStone
Nov 14 at 16:24
Sorry. Fixed to replace with %a
– uSlackr
Nov 14 at 18:06
This was perfect! Thanks!
– ChargerStone
yesterday
add a comment |
up vote
0
down vote
accepted
If you put all the computers in a text file called comps.lst
this should work:
for /f %a in (comps.lst) do @wmic.exe /node:"%a" ComputerSystem Get UserName
3
<MachineName>
or%a
?
– pbies
Nov 14 at 16:15
1
It would work if I could substitute <MachineName> in the script with the text entry (the actual machine name) on each line.
– ChargerStone
Nov 14 at 16:24
Sorry. Fixed to replace with %a
– uSlackr
Nov 14 at 18:06
This was perfect! Thanks!
– ChargerStone
yesterday
add a comment |
up vote
0
down vote
accepted
up vote
0
down vote
accepted
If you put all the computers in a text file called comps.lst
this should work:
for /f %a in (comps.lst) do @wmic.exe /node:"%a" ComputerSystem Get UserName
If you put all the computers in a text file called comps.lst
this should work:
for /f %a in (comps.lst) do @wmic.exe /node:"%a" ComputerSystem Get UserName
edited Nov 14 at 18:06
answered Nov 14 at 16:09
uSlackr
8,3232445
8,3232445
3
<MachineName>
or%a
?
– pbies
Nov 14 at 16:15
1
It would work if I could substitute <MachineName> in the script with the text entry (the actual machine name) on each line.
– ChargerStone
Nov 14 at 16:24
Sorry. Fixed to replace with %a
– uSlackr
Nov 14 at 18:06
This was perfect! Thanks!
– ChargerStone
yesterday
add a comment |
3
<MachineName>
or%a
?
– pbies
Nov 14 at 16:15
1
It would work if I could substitute <MachineName> in the script with the text entry (the actual machine name) on each line.
– ChargerStone
Nov 14 at 16:24
Sorry. Fixed to replace with %a
– uSlackr
Nov 14 at 18:06
This was perfect! Thanks!
– ChargerStone
yesterday
3
3
<MachineName>
or %a
?– pbies
Nov 14 at 16:15
<MachineName>
or %a
?– pbies
Nov 14 at 16:15
1
1
It would work if I could substitute <MachineName> in the script with the text entry (the actual machine name) on each line.
– ChargerStone
Nov 14 at 16:24
It would work if I could substitute <MachineName> in the script with the text entry (the actual machine name) on each line.
– ChargerStone
Nov 14 at 16:24
Sorry. Fixed to replace with %a
– uSlackr
Nov 14 at 18:06
Sorry. Fixed to replace with %a
– uSlackr
Nov 14 at 18:06
This was perfect! Thanks!
– ChargerStone
yesterday
This was perfect! Thanks!
– ChargerStone
yesterday
add a comment |
get the UserName of the person on each of those machines... do you mean the username of the currently logged on user?
– Twisty Impersonator
Nov 14 at 17:01
I'm voting to close this question as off-topic because we are not a script writing service
– Canadian Luke
yesterday