Thomas Bratt Thomas Bratt - 4 years ago 364
PowerShell Question

How to get current username in Windows Powershell?

How to get the current username in Windows Powershell?

Answer Source

Found it:

[Environment]::UserName

There is also:

[Environment]::UserDomainName
[Environment]::MachineName
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download