How to save CurrentUser as String This topic contains 0 replies, has 1 voice, and was last updated by Forums Archives 5 years, 3 months ago. Author Posts January 1, 2012 at 12:00 am #5330 Forums ArchivesMember by the_hutch at 2012-12-07 11:26:19 When I use the command, "Get-CurrentUser" it outputs the username for the person running the script. The output looks like this: AuthenticationType : KerberosImpersonationLevel : NoneIsAuthenticated : TrueIsGuest : FalseIsSystem : FalseIsAnonymous : FalseName : domainname\usernameOwner : ——–User : ——-Groups : ——–Token : ——- I wanted to assign this entire output to a string. Was trying this:[string]$User = Get-CurrentUser The value of $User becomes "System.Security.Principal.WindowsIdentity" instead of a string of the output above. Does anyone know how I can save the output from Get-CurrentUser to a string variable? by RichardSiddaway at 2012-12-07 11:34:14 $user = Get-CurrentUser | Out-String by the_hutch at 2012-12-07 11:43:42 Thanks Richard. Appreciate the quick reply. by RichardSiddaway at 2012-12-09 02:37:51 You're very welcome Author Posts You must be logged in to reply to this topic.