0

I have this script which outputs the screen-saver settings to a file.

wmic desktop get ScreenSaverActive,ScreenSaverSecure,ScreenSaverTimeout > d:\output\ScreenSaver.txt

It's working fine in Server 2008 and Server 2012 but in Server 2016 it just fills the file with "FALSE"-es parameters.

How can I make it to work on Server 2016?

one of the outputs:

Name=NT AUTHORITY\NETWORK SERVICE
ScreenSaverActive=FALSE
ScreenSaverSecure=
ScreenSaverTimeout=

here is a pic:

https://i.stack.imgur.com/20kRg.jpg

user1284567
  • 141
  • 1
  • 2
  • 10
  • If you use `WMIC /Output:"D:\output\ScreenSaver.txt" Desktop Get Name,ScreenSaverActive,ScreenSaverSecure,ScreenSaverTimeout /Value`, the output file should better show you if there are blank or problem entries and which users they belong to. If you need help following that output, then [edit your question](https://stackoverflow.com/posts/49234425/edit) to include that output, highlighting it and clicking on the `{}` button to format it appropriately. – Compo Mar 12 '18 at 12:05
  • ok, one of my outputs was: Name=NT AUTHORITY\NETWORK SERVICE ScreenSaverActive=FALSE ScreenSaverSecure= ScreenSaverTimeout= but it is not true, there is screen saver turned on in this server, and it's idle time is 15 minutes – user1284567 Mar 12 '18 at 12:21
  • So are you telling me that you've logged into the desktop as `NT AUTHORITY\NETWORK SERVICE` and that 'user' has a screensaver set. _It seems rather odd that were this very limited account be necessary to log into, GUI screensaver settings would be used, set or necessary._ – Compo Mar 12 '18 at 12:29
  • actually it dosent matter what user is it because its the same with all users. here's my user: Name=OFFICE\xameri ScreenSaverActive=FALSE ScreenSaverSecure= ScreenSaverTimeout= – user1284567 Mar 12 '18 at 12:33
  • If this powershell code: `GWmi win32_desktop | FT Name,ScreenSaverActive,ScreenSaverSecure,ScreenSaverTimeout -A`, shows the same information, then I'm afraid you'll have to try to find an alternative to WMI to get your information. – Compo Mar 12 '18 at 12:44
  • i have add pic to the main post – user1284567 Mar 12 '18 at 12:44
  • Got the same info...i'll try to find alternatives. thanks! – user1284567 Mar 12 '18 at 12:52

0 Answers0