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













put on hold as unclear what you're asking by Twisty Impersonator, Toto, bertieb, Canadian Luke, G-Man 2 days 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
    Nov 19 at 21:50















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













put on hold as unclear what you're asking by Twisty Impersonator, Toto, bertieb, Canadian Luke, G-Man 2 days 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
    Nov 19 at 21:50













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













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













share|improve this question











share|improve this question




share|improve this question










asked Nov 14 at 15:59









ChargerStone

32




32




put on hold as unclear what you're asking by Twisty Impersonator, Toto, bertieb, Canadian Luke, G-Man 2 days 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 2 days 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
    Nov 19 at 21:50


















  • 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
    Nov 19 at 21:50
















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
Nov 19 at 21:50




I'm voting to close this question as off-topic because we are not a script writing service
– Canadian Luke
Nov 19 at 21:50










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
    Nov 19 at 23:25


















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
    Nov 19 at 23:25















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
    Nov 19 at 23:25













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
    Nov 19 at 23:25














  • 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
    Nov 19 at 23:25








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
Nov 19 at 23:25




This was perfect! Thanks!
– ChargerStone
Nov 19 at 23:25



Popular posts from this blog

Сан-Квентин

Алькесар

Josef Freinademetz