June 27th, 2013

PowerTip: Use PowerShell to Find Screensaver Info for Logged-on User

Doctor Scripto
Scripter

Summary: Use Windows PowerShell to find screensaver information for a user who is currently logged-on.

Hey, Scripting Guy! Question How can I use Windows PowerShell to find screensaver information for a currently logged-on user?

Hey, Scripting Guy! Answer Use WMI, query the Win32_Desktop class, and select the currently logged-on user.

      • In Windows PowerShell 3.0:

Get-CimInstance win32_desktop | where name -eq (whoami)

      • In Windows PowerShell 2.0:

Get-WmiObject win32_desktop | where { $_.name -eq (whoami) } 

Author

The "Scripting Guys" is a historical title passed from scripter to scripter. The current revision has morphed into our good friend Doctor Scripto who has been with us since the very beginning.

0 comments

Discussion are closed.

Feedback