Summary: Learn how to display user logon information.
How can I use Windows PowerShell to display user logon information in an easy graphical manner?
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.