実行ユーザー取得 by PowerShell
PowerShellで実行ユーザー取得
$id = [System.Security.Principal.WindowsIdentity]::GetCurrent()
$uname = $id.Name
$groupsids = $id.Groups
$groupsids | foreach{ $_.Translate([System.Security.Principal.NTAccount]) }
参考
WindowsIdentity
http://msdn.microsoft.com/ja-jp/library/system.security.principal.windowsidentity(v=vs.110).aspx