Jump to content
EduGeek EdSec 2026 is Go! 27th Oct in Derby! Join us for a day of EdTech security focused talks, networking, and an evening social ×

Recommended Posts

Posted

Hi chaps.

 

Does anyone know of a way I can write a script to find out the name, and resolution of all machines on my network, and have it output to a txt file or an excel spreadsheet?

 

So far I have this which works fine locally, but comes up with a pop up, and it wont work if I want to run it from my machine or the server.

 

Set wshShell = WScript.CreateObject( "WScript.Shell" )
strComputerName = wshShell.ExpandEnvironmentStrings( "%COMPUTERNAME%" )
     WScript.Echo "Computer Name: " & strComputerName
strComputer = "." 
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2") 
Set colItems = objWMIService.ExecQuery( _
   "SELECT * FROM Win32_DesktopMonitor",,48) 
For Each objItem in colItems 
    Wscript.Echo "ScreenWidth: " & objItem.ScreenWidth
    Wscript.Echo "ScreenHeight: " & objItem.ScreenHeight
Next

Posted
unfortunately that pulls way too much info, and I need it literally just the resolutions. I have been asked to get a background out to everyone, but as some run laptops, some run desktops, some run win 7, some run win xp, some run vista, bit of a nightmare via GPO. Rather than go around 4 floors, and around 80 machines a floor, I figure a script is quicker, would output to a file, and make it easier for me to deploy as I can do it based on the resolution of everyone.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...