Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Retrieve screen resolution from all PC's on LAN 1

Status
Not open for further replies.

GregD13

MIS
Mar 9, 2005
34
CA
Can anyone suggest a tool that will tell me what all my users settings are for thier screen resolution? I don't want to visit every PC or ask them what it is.

Thanks for any help you can offer.
Greg
 
Here is a simple script for you that will grab the screen resolution and PC name.

Code:
On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")

Set OScolItems = objWMIService.ExecQuery("Select * from Win32_ComputerSystem",,48)
For Each objItem in OScolItems
    PCname = objItem.Name
Next    
Set VCcolItems = objWMIService.ExecQuery("Select * from Win32_VideoController",,48)
For Each objItem in VCcolItems
    HRes = objItem.CurrentHorizontalResolution
    VRes = objItem.CurrentVerticalResolution
Next

WScript.Echo "Computer: " & PCname & vbTab & " Video Resolution:" & HRes & "x" & VRes

Refer to my FAQ faq329-4871 for help on how you could alter the script to run against multiple computers.

I hope you find this post helpful. Please let me know if it was.

Regards,

Mark
 
Well as I am a begginer at scripting it took me a while to figure out the specifics for my task but I got it done thanks to you.

Thank you very much.
Greg
 
Glad to be of service. You just have to love vbscript and WMI! :)

I hope you find this post helpful.

Regards,

Mark
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top