Powershell: How can i get the primary screen resolution of a logged in user?

Viewed 35

Our current scenario is this:

We have more than 80 tablet computers (running Windows 10) in our network that run under the same user (DefaultUser). In order to verify that the display settings are correctly set, we would like to use a powershell script to automatically check the used resolution remotely with a support user account.

So far, we know how to get the primary screen resolution for the user under which the script gets executed (which is rather easy):

  // get primary screen width
  Add-Type -AssemblyName System.Windows.Forms
  [System.Windows.Forms.Screen]::PrimaryScreen.Bounds.Width   // height accordingly

In case we execute this script on one of the tablets using the support account, we get the primary screen resolution for the support account user - but not for the desired user DefaultUser.

How can we get the resolution for the DefaultUser?

0 Answers
Related