How do you get account that powershell session is being run under?


anybody know trick this?  the $env:profile returns profile being used logon windows.  i want return account being used run session when "runas".  it nice domain user in too.  why?  i run powershell command in multiple domains laptop , want build way put "runas" user name , domain in window frame if have multiple windows open powershell can see domain in looking @ frame title. 

$env:username , $env:userdomain



Windows Server  >  Windows PowerShell



Comments

Popular posts from this blog

2008 Windows Deployment Server Properties Error

Can no longer user MS Update - Files required to use Microsoft Update are no longer registered

How do a find data in one file, search for it in another file and if not found, write a custom message to another file