Need Batch File/Script To Find Multiple Usernames Using Their Machine Names [on hold]











up vote
0
down vote

favorite
1












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.










share|improve this question







New contributor




ChargerStone is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











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















up vote
0
down vote

favorite
1












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.










share|improve this question







New contributor




ChargerStone is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











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













up vote
0
down vote

favorite
1









up vote
0
down vote

favorite
1






1





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.










share|improve this question







New contributor




ChargerStone is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











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






share|improve this question







New contributor




ChargerStone is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question







New contributor




ChargerStone is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question






New contributor




ChargerStone is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked Nov 14 at 15:59









ChargerStone

32




32




New contributor




ChargerStone is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





ChargerStone is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






ChargerStone is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




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


















  • 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










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






share|improve this answer



















  • 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


















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






share|improve this answer



















  • 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















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






share|improve this answer



















  • 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













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






share|improve this answer














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







share|improve this answer














share|improve this answer



share|improve this answer








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














  • 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



Popular posts from this blog

Plaza Victoria

In PowerPoint, is there a keyboard shortcut for bulleted / numbered list?

How to put 3 figures in Latex with 2 figures side by side and 1 below these side by side images but in...