Anybody know a trick to do this? The $env:profile returns the profile that is being used to logon to Windows. I want to return the account that is being used to run the session when I do a "runas". It would be nice to also get
the domain that user is in too. Why? I run powershell command in multiple domains from my laptop and want to build a way to put the "runas" user name and domain in the window frame so that if I have multiple windows open for powershell
I can see what domain I am in by looking at the frame title.
↧