If you need to know the actual user:
[reflection.assembly]::LoadWithPartialName("System.DirectoryServices.AccountManagement") [System.DirectoryServices.AccountManagement.UserPrincipal]::Current
Using:
[System.DirectoryServices.AccountManagement.UserPrincipal]::Current | gm
to find out the available properties / methods of UserPrincipal
.
source share