View Single Post
Old 09-02-2007   #2 (permalink)
Hal Rottenberg


 
 

Re: how to get logged-in user credentials?

Replying to myself here... I found these useful bits in my profile which PSCX
put there:

Set-PscxVariable NTIdentity ([Security.Principal.WindowsIdentity]::GetCurrent())

Set-PscxVariable NTAccount
($NTIdentity.User.Translate([Security.Principal.NTAccount]))

11# $ntaccount

Value
-----
EL-GUAPO\Hal

--

Hal Rottenberg
blog: http://halr9000.com
powershell category:
http://halr9000.com/article/category...ng/powershell/
My System SpecsSystem Spec