Solved

script to capture user screen res and printers

Posted on 2012-03-23
6
454 Views
Last Modified: 2012-05-23
Hi,

Does anyone know if it is possible to script what a users screen resolution is and what printers they have installed and output that information to a text file?

The reason behind it is new user profiles and I want to capture this information, I have scripted other things but just need help with this part if it is possible in anyway?

doesnt have to be a text file it outputs to, can be any other file or automated method!

many thanks
0
Comment
Question by:speechlys
  • 4
  • 2
6 Comments
 
LVL 38

Expert Comment

by:Rich Rumble
ID: 37759581
You can do this with WMI, via a command line or a script, command line would be:
(open cmd prompt)
wmic path Win32_DisplayConfiguration get PelsHeight,PelsWidth

You have to be administrator to get it from a remote machine like:
wmic /node:pc_name.example.com path Win32_DisplayConfiguration get PelsHeight,PelsWidth
(replace pc_name... with the pc's name, or IP address)

Here is a similar script you can have in the user's "startup" folder
http://blogs.technet.com/b/heyscriptingguy/archive/2005/07/21/how-can-i-determine-the-current-screen-resolution-being-used-on-a-computer.aspx
-rich
0
 
LVL 38

Expert Comment

by:Rich Rumble
ID: 37759601
Redirect the output to a file like this
wmic path Win32_DisplayConfiguration get PelsHeight,PelsWidth >C:\temp\resolution.txt
or any path you choose. Same with the VBS script from the link...
cscript resolution.vbs >c:\temp\resolution.txt
-rich
0
 

Author Comment

by:speechlys
ID: 37777635
ok thanks, what about printers ?
0
Don't lose your head updating email signatures!

Do your end users still have the wrong email signature? Do email signature updates bore you or fill you with a sense of dread? You can make this a whole lot easier on yourself by trusting an Exclaimer email signature management solution. Over 50 million users do...so should you!

 
LVL 38

Expert Comment

by:Rich Rumble
ID: 37777782
wmic printer get HorizontalResolution,VerticalResolution,name
That will give you the printers resolution. Just run both commands from a .bat file (batch file) one on one line the second on the next line.
-rich
0
 

Author Comment

by:speechlys
ID: 37777812
i want the installed printers of the user to output to a text file or any other format! this will do that?
0
 
LVL 38

Accepted Solution

by:
Rich Rumble earned 500 total points
ID: 37778081
Did you try the command? It outputs the following:
C:\Windows\system32>wmic printer get name,drivername,Description,HorizontalResolution,VerticalResolution
Description  DriverName                     HorizontalResolution  Name                           VerticalResolution
             Microsoft XPS Document Writer  600                   Microsoft XPS Document Writer  600
             HP Officejet 6300 series       600                   HP Officejet 6300 series       600
             Microsoft Shared Fax Driver    200                   Fax                            200

Open in new window


C:\Windows\system32>wmic printer where "default='TRUE'" get name
Name
HP Officejet 6300 series

You can do "wmic printer get /?" on a command prompt to find all the available items.
You could also download the Scriptomatic 2.0 from M$ and start playing with that, it creates all the code you'd need for the most part.
-rich
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Our Group Policy work started with Small Business Server in 2000. Microsoft gave us an excellent OU and GPO model in subsequent SBS editions that utilized WMI filters, OU linking, and VBS scripts. These are some of experiences plus our spending a lo…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
The viewer will learn how to successfully create a multiboot device using the SARDU utility on Windows 7. Start the SARDU utility: Change the image directory to wherever you store your ISOs, this will prevent you from having 2 copies of an ISO wit…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now