OK here what what I am trying to achieve via dost\batch.
I have a list of remote machines.
I want to check firs to see if all the list of machines are online. Those that are not online I would like
to output their computer names to a .txt such as using a find with >>.
There are two possibilities going on here to keep in mind!
1. Remote computer is turned off
2. I dont have domain access to the remote computer, and it should return an access error
Those two stipulations above. How can I make a bat file detect them? Any nifty idea's one can think up?
My task is to release the IP address of all the computers in the list. Some of these machines I'm doing test on tell me I dont have access to release the IP's, but others do. By IT policy all computers should be turned on, and kept on, but you know how users turn off machines at the end of their shift.
This said.. I'm trying to OUTPUT to a .txt file those machines that are online, or I dont have access too!
I guess I'm asking is there a way I could script the dos window to "MARK" all of the contents within itself, and paste those contents into a .txt file? Then I could simply run a find command against "Access denied" string, and quickly locate computers that will need to have a tech manually visit.
Code: Select all
psexec \\RemoteComputerName ipconfig /release | clip>>c:\temp\test2.txt
psexec \\RemoteComputerName ipconfig /release | clip>>c:\temp\test2.txt
the clip and pipe method didnt work either lol. Im trying to get the results from the above command
saved into test2.txt. Then at the end of my batch file. I will use a find command to search for my string, the output what lines are found on a InvestigateLog.txt file in which are the machines that are offline\have no access to!
Any help is appreciated thank you!
-Cody Oebel