PowerShell Scripts, Tips, Expert Advice & Training, Forums, and Resources

Welcome to PowerShell.com, the educational and community site for Windows PowerShell People. Get a quick overview.

Latest Forum Posts

05-24-2012 - Remove first line of a result
05-18-2012 - Get-childitem script that will...
05-24-2012 - Event Handling & Scope

As a Powershell.com member you will have access to:

  • Daily PowerShell tips written by Microsoft MVPs and other leading Windows PowerShell experts
  • Free Windows PowerShell advice and training provided by Microsoft MVPs and other leading Windows PowerShell experts
  • Access to leading Windows PowerShell blogs
  • A free ebook, Mastering PowerShell, written by Microsoft MVP Dr. Tobias Weltner
PowerTip of the Day

Integrating WhoAmI Into PowerShell

There is a cool little tool called whoami.exe which is part of Windows ever since Windows Vista. Since it can provide results not just in plain text but also as comma separated values, it is very easy to integrate into PowerShell. For example, to find out the groups your user account is member of, try this simple line:

PS> whoami /groups /fo csv | convertfrom-csv

Group Name             Type                   SID
----------             ----                   ---
Everyone               Well-known group       S-1-1-0
BUILTIN\Administrators Alias                  S-1-5-32-544
BUILTIN\Users          Alias                  S-1-5-32-545
NT AUTHORITY\INTERA... Well-known group       S-1-5-4
CONSOLE LOGON          Well-known group       S-1-2-1
NT AUTHORITY\Authen... Well-known group       S-1-5-11
NT AUTHORITY\This O... Well-known group       S-1-5-15
LOCAL                  Well-known group       S-1-2-0
NT AUTHORITY\NTLM A... Well-known group       S-1-5-64-10
Mandatory Label\Med... Label                  S-1-16-8192

Twitter This Tip! ReTweet this Tip!

Concentrated Tech NSoftware Dell Compellent Sponsored by Idera and Concentrated Tech and NSoftware and Dell Compellent
Copyright 2011 PowerShell.com. All rights reserved.