bfuchs
asked on
List PC Names and browser versions.
Hi Experts,
I am looking for a program that will list all PC names, browser names and versions within the network.
Would prefer it to be done either as a DOS command, batch file or VBA.
Thanks
I am looking for a program that will list all PC names, browser names and versions within the network.
Would prefer it to be done either as a DOS command, batch file or VBA.
Thanks
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi Brian,
Tried in both DOS and PS command prompt and getting attached error.
In addition I would need this to run against every PC on the network, how can it be done automatically?
And how can I add checking for other browsers as well?
Thanks,
Ben
Untitled.png
Tried in both DOS and PS command prompt and getting attached error.
In addition I would need this to run against every PC on the network, how can it be done automatically?
And how can I add checking for other browsers as well?
Thanks,
Ben
Untitled.png
Hi Ben,
psexec is used to run commands on other systems. <\\pcname> is a variable where you substitute the name of the PC. So basically, you need to create a batch file with one line for each PC (or a loop, depending on how comfortable you are with the programming scripts).
You can find more information here: https://docs.microsoft.com/en-us/sysinternals/downloads/psexec
psexec is used to run commands on other systems. <\\pcname> is a variable where you substitute the name of the PC. So basically, you need to create a batch file with one line for each PC (or a loop, depending on how comfortable you are with the programming scripts).
You can find more information here: https://docs.microsoft.com/en-us/sysinternals/downloads/psexec
ASKER
Hi Brian,
Actually I found (after you had pointed me to the right direction...) the below doing exactly what I'm looking for.
https://stackoverflow.com/questions/3553984/how-do-i-detect-which-version-of-internet-explorer-is-installed
The only problem I have is with the following...
As if I have to manually go around and change things on all users PC's, then I minus well just check the version w/o the programming...
Any workaround?
Thanks,
Ben
Actually I found (after you had pointed me to the right direction...) the below doing exactly what I'm looking for.
https://stackoverflow.com/questions/3553984/how-do-i-detect-which-version-of-internet-explorer-is-installed
@Echo off
Cls
MD C:\SYSADMIT > NUL
Echo. > c:\SYSADMIT\Resultados.txt
SET ListaEquipos=C:\SYSADMIT\ListaEquipos.txt
For /F "Tokens=*" %%z In (%ListaEquipos%) Do (
echo %%z >> c:\SYSADMIT\Resultados.txt
reg query "\\%%z\hklm\Software\Microsoft\Internet Explorer" /v svcVersion >> c:\SYSADMIT\Resultados.txt
)
The only problem I have is with the following...
It is also necessary to check RemoteRegistry service enabled on the target computers.
As if I have to manually go around and change things on all users PC's, then I minus well just check the version w/o the programming...
Any workaround?
Thanks,
Ben
Ah, but you can do that remotely as well! Services can be set via policy. Or just include it in your script: "net start remoteregistry"
ASKER
Hi Brian,
Looks like we're almost done...
I found the following
Can you tell me how to do it within the above script?
also would need to stop the service after running the reg query.
Thanks,
Ben
Looks like we're almost done...
I found the following
sc \\computername start remoteregistry
Can you tell me how to do it within the above script?
also would need to stop the service after running the reg query.
Thanks,
Ben
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you!
ASKER
Hi Brian,
Tested the following, and only showed pc names without any info.
What am I doing wrong?
Thanks,
Ben
Tested the following, and only showed pc names without any info.
@Echo off
Cls
MD C:\SYSADMIT > NUL
Echo. > c:\SYSADMIT\Resultados.txt
SET ListaEquipos=F:\conversion\temp\Listpcnames.txt
For /F "Tokens=*" %%z In (%ListaEquipos%) Do (
echo %%z >> c:\SYSADMIT\Resultados.txt
sc \\%ListaEquipos% start remoteregistry
reg query "\\%%z\hklm\Software\Microsoft\Internet Explorer" /v svcVersion >> c:\SYSADMIT\Resultados.txt
sc \\%ListaEquipos% stop remoteregistry
)
What am I doing wrong?
Thanks,
Ben
ASKER
Hi Brian,
Any idea?
Thanks,
Ben
Any idea?
Thanks,
Ben
sc start does'nt wait for a service to be started or stopped, so I assume it returns too fast to perform the reg query....
You need a loop
You need a loop
:
sc \\%ListaEquipos% start remoteregistry
:WaitLoop
sc query remoteregistry| find "STARTED"
if errorlevel 1 (
timeout 1
goto WaitLoop
)
reg query "\\%%z\hklm\Software\Microsoft\Internet Explorer" /v svcVersion >> c:\SYSADMIT\Resultados.txt
:
Same for stop if you want. Doen't really matter, will stop anyway...
ASKER
Hi Michael,
Tried the following but didn't work,
Guess I'm missing how to combine what you posted with the original script.
Thanks,
Ben
Tried the following but didn't work,
@Echo off
Cls
MD C:\SYSADMIT > NUL
Echo. > c:\SYSADMIT\Resultados.txt
SET ListaEquipos=F:\conversion\temp\Listpcnames.txt
For /F "Tokens=*" %%z In (%ListaEquipos%) Do (
echo %%z >> c:\SYSADMIT\Resultados.txt
:
sc \\%ListaEquipos% start remoteregistry
:WaitLoop
sc query remoteregistry| find "STARTED"
if errorlevel 1 (
timeout 1
goto WaitLoop
)
reg query "\\%%z\hklm\Software\Microsoft\Internet Explorer" /v svcVersion >> c:\SYSADMIT\Resultados.txt
:
)
Guess I'm missing how to combine what you posted with the original script.
Thanks,
Ben
My fault. New version:
Didn't really check. If there are any error messgaes just drop them here.
@Echo off
Cls
MD C:\SYSADMIT > NUL
Echo. > c:\SYSADMIT\Resultados.txt
SET ListaEquipos=F:\conversion\temp\Listpcnames.txt
For /F "Tokens=*" %%z In (%ListaEquipos%) Do (
echo %%z >> c:\SYSADMIT\Resultados.txt
sc \\%%z start remoteregistry
:WaitLoop
sc \\%%z query remoteregistry| find "STARTED"
if errorlevel 1 (
timeout 1
goto WaitLoop
)
reg query "\\%%z\hklm\Software\Microsoft\Internet Explorer" /v svcVersion >> c:\SYSADMIT\Resultados.txt
)
Didn't really check. If there are any error messgaes just drop them here.
ASKER
Can you test it manually using
sc \\server start remoteregistry
sc \\server start remoteregistry
ASKER
ASKER
Hi Michael,
Perhaps we should skip those with error messages for now, so at least those who are working should get recorded in file.
Thanks,
Ben
Perhaps we should skip those with error messages for now, so at least those who are working should get recorded in file.
Thanks,
Ben
Hm, can you start the service locally on a system that throws error 1058?
Is it disabled?
Is it disabled?
ASKER
Hi,
At the moment I don't need a complete list, just want find some computers using an old version and test it something from there.
How can we get this done ASAP.
Thanks,
Ben
At the moment I don't need a complete list, just want find some computers using an old version and test it something from there.
How can we get this done ASAP.
Thanks,
Ben
@Echo off
Cls
MD C:\SYSADMIT > NUL
Echo. > c:\SYSADMIT\Resultados.txt
SET ListaEquipos=F:\conversion\temp\Listpcnames.txt
For /F "Tokens=*" %%z In (%ListaEquipos%) Do (
echo %%z >> c:\SYSADMIT\Resultados.txt
sc \\%%z start remoteregistry
SET COUNT=0
:WaitLoop
sc \\%%z query remoteregistry| find "STARTED"
if errorlevel 1 (
timeout 1
SET /A COUNT+=1
if %COUNT% LEQ 10 goto :WaitLoop
)
if %COUNT% LEQ 10 reg query "\\%%z\hklm\Software\Microsoft\Internet Explorer" /v svcVersion >> c:\SYSADMIT\Resultados.txt
if %COUNT% GTR 10 Registry not accessible %%z >> c:\SYSADMIT\Resultados.txt
)
ASKER
hi,
Again results file is blank.
Thanks,
Ben
Again results file is blank.
Thanks,
Ben
Blank? At least the 1st computer name should be written in it at line 12
remove the @echo off and rerun. Post the result
ASKER
Same thing.
Thanks,
Ben
Thanks,
Ben
I mean please post the screen content
ASKER
Would like to see what the batch writes to screen. If it scrolls to fast put a
pause
Before line 25
pause
Before line 25
ASKER
hi,
Nothing gets displayed it opens and closes immediately.
Is this working at your end?
Thanks,
Ben
Untitled.png
Nothing gets displayed it opens and closes immediately.
Is this working at your end?
Thanks,
Ben
Untitled.png
Sorry, didn't think about how strange a batch can react when nesting brackets...
Try this version please, it works on my end
Try this version please, it works on my end
@Echo off
Cls
MD C:\SYSADMIT > NUL
Echo. > c:\SYSADMIT\Resultados.txt
SET ListaEquipos=F:\conversion\temp\Listpcnames.txt
For /F %%z In (%ListaEquipos%) Do (
echo %%z >> c:\SYSADMIT\Resultados.txt
SET COUNT=0
Call :WaitLoop
if %COUNT% LEQ 10 reg query "\\%%z\hklm\Software\Microsoft\Internet Explorer" /v svcVersion >> c:\SYSADMIT\Resultados.txt
if %COUNT% GTR 10 Registry not accessible %%z >> c:\SYSADMIT\Resultados.txt
)
goto :EOF
:WaitLoop
sc \\%%z query remoteregistry| find "STARTED"
if errorlevel 1 (
timeout 1
SET /A COUNT+=1
if %COUNT% LEQ 10 goto :WaitLoop
)
goto :EOF
ASKER
Still nothing, even tried adding few pauses as following, did not got to see anything.
Thanks,
Ben
@Echo off
Cls
MD C:\SYSADMIT > NUL
Echo. > c:\SYSADMIT\Resultados.txt
SET ListaEquipos=F:\conversion\temp\Listpcnames.txt
For /F %%z In (%ListaEquipos%) Do (
echo %%z >> c:\SYSADMIT\Resultados.txt
SET COUNT=0
Call :WaitLoop
if %COUNT% LEQ 10 reg query "\\%%z\hklm\Software\Microsoft\Internet Explorer" /v svcVersion >> c:\SYSADMIT\Resultados.txt
if %COUNT% GTR 10 Registry not accessible %%z >> c:\SYSADMIT\Resultados.txt
)
goto :EOF
pause
:WaitLoop
sc \\%%z query remoteregistry| find "STARTED"
pause
if errorlevel 1 (
timeout 1
SET /A COUNT+=1
if %COUNT% LEQ 10 goto :WaitLoop
pause
)
goto :EOF
pause
Thanks,
Ben
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi Michael,
Great, this is finally working.
Now can you add those other browsers into this script, so I can finalize the other thread as well.
Thanks,
Ben
Great, this is finally working.
Now can you add those other browsers into this script, so I can finalize the other thread as well.
Thanks,
Ben
ASKER
BTW, running this script logged in as admin against all computers on the network is safe?
Thanks,
Ben
Thanks,
Ben
It only queries one computer after the other so the impact should be nearly zero
ASKER
I'm out of the office today.
will test & reply next week.
Thanks,
Ben