Forum Discussion
esshin
Jan 20, 2020Copper Contributor
Get Logon UserName
Hello fellow humans,
I'm finding how to get logon user name using 'SYSTEM Privilege' (NT AUTHORITY\SYSTEM)
$currentuser = $env:username
$currentuser
Codes show 'SYSTEM' value.
How can i get logon user using system privilege?
Kind Regards
Why would you expect to see a different value when you are running in the context of the system user? If you simply want to list all users currently logged on the machine, use one of the methods here: https://stackoverflow.com/questions/23219718/powershell-script-to-see-currently-logged-in-users-domain-and-machine-status
- esshinCopper ContributorI need to create job schedule using system privilege on AD Client. (GPO Issue)
so, I should to except user privilege.