Tech Blog‎ > ‎

PowerShell - Get Current User

posted Feb 3, 2010, 1:18 PM by Victor Zakharov
Actually, there are many ways to get name of the user, which is currently logged on, including built-in .NET commands.
But let's keep our code clean and stick with native PowerShell.

To get just the user name:


You might also need the domain:


Or both of them: