Quantcast
Channel: Hey, Scripting Guy! Blog
Viewing all articles
Browse latest Browse all 3333

PowerTip: Use PowerShell Grid View to Display Logon Info

$
0
0

Summary: Learn how to display user logon information.

Hey, Scripting Guy! Question How can I use Windows PowerShell to display user logon information in an easy graphical manner?

Hey, Scripting Guy! Answer Create two hash tables using environmental variables, and pipe the input to the Out-Gridview cmdlet,
           for example:

@{"username" = $env:USERNAME}, @{"Computername"=$env:COMPUTERNAME} |
Out-GridView -Title "user logon info"

Note This is a single-line command broken at the pipeline character for display on the blog.


Viewing all articles
Browse latest Browse all 3333

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>