0

Is there a way via WMI or Powershell to ask each domain member what the resolution is on their desktop? I need to know but can't go and visit each one. For bonus points, how to summarize the results and only display one unique result per resolution? That is, instead

  • A: 1920x1080
  • B: 1920x1080
  • C: 1200x800

it would just read

  • 1920x1080
  • 1200x800
tralston
  • 165
  • 1
  • 6

2 Answers2

1

You can actually pull their screen resolution directly. For myself and a Virtual Machine, wmic path Win32_VideoController get VideoModeDescription runs fine. (I do run 64 bit, VM is a 32 bit)

This and other solutions are available here.

Edit: misunderstood what they meant by poll

Also: Combination of both methods, providing the user with their screen resolution as the default entry but giving them the option to change it before submission.

$screenres = wmic path Win32_VideoController get VideoModeDescription | findstr colors
[System.Reflection.Assembly]::LoadWithPartialName('Microsoft.VisualBasic') | Out-Null    
$computer = [Microsoft.VisualBasic.Interaction]::InputBox("Hello, please enter your screen resolution. Thanks.", "Screen Resolution", "$screenres") 

It will be saved as $computer. Echo it into a log on a neutral network share if you want or however you want to collect it.

Let me know if something doesn't work, you need an alternate solution, or you need elaboration. Thanks for readin!

Michael Bailey
  • 462
  • 2
  • 12
  • `wmic path Win32_VideoController get VideoModeDescription` only outputted `VideoModeDescription` on my AD server (WS2008R2). As far as polling, I didn't mean asking the users, I meant having the server "poll" each domain system and find out from the operating system itself what the screen resolution itself. So your first suggestion is more on point, but I couldn't get it to work. – tralston Jul 04 '15 at 05:47
  • Does anything in the other solutions link work? Like **Get-WmiObject -Class Win32_DesktopMonitor | Select-Object ScreenWidth,ScreenHeight** ? – Michael Bailey Jul 04 '15 at 06:13
  • I get a two-column output with ScreenWidth and ScreenHeight at the top, but no data underneath them. – tralston Jul 04 '15 at 19:40
  • @tralston can you consult the first link to ensure none of those solutions work? – Michael Bailey Jul 04 '15 at 20:15
  • I can confirm that I tried all of the solutions on that page, and only the last sort of worked (http://stackoverflow.com/a/22772447/695772). I had to modify it to include the `-ComputerName COMP1` parameter inside the parentheses. – tralston Jul 04 '15 at 20:24
0

Looks like you nedd something like this:

get full descripions from all PC's in AD

Get-ADcomputer -Filer * | Get-WmiObject -Class Win32_VideoController

and only a list of current resolutions

Get-ADcomputer -Filer * | (Get-WmiObject -Class Win32_VideoController).VideoModeDescription

update So this would work

$computerlist = Get-ADComputer -Filter * | Select -Expand Name     
Get-WmiObject -Class Win32_VideoController -ComputerName $Computerlist
strange walker
  • 582
  • 3
  • 10
  • I get the error: `At line:1 char:27 Expressions are only allowed as the first element of a pipeline.` – tralston Jul 04 '15 at 19:38
  • what's your powershell version? – strange walker Jul 04 '15 at 19:41
  • From `$PSVersionTable.PSVersion` I get `3,0,-1,-1` – tralston Jul 04 '15 at 19:43
  • how about this one? Get-WmiObject -Class Win32_VideoController -ComputerName $Computerlist note that you still need to populate $Computerlist variable – strange walker Jul 04 '15 at 19:57
  • That definitely gave ouput. I modified it to give the resolutions: `(Get-WmiObject -Class Win32_VideoController -ComputerName COMP1, COMP2).VideoModeDescription`. Can you update your answer to include this? I still haven't figured out how to globally apply this to all AD computers. – tralston Jul 04 '15 at 20:23
  • I'm trying to get Get-ADComputer working ... argh! I guess I don't have the AD cmdlets installed. Can't find good instructions to install/import them. Will report back. – tralston Jul 06 '15 at 09:09