Thomas Bratt Thomas Bratt - 1 year ago 185
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