I am trying to get the UPN of a logged user while running as a service. I was able to get the Username of the logged in users in format DOMAIN\\username
Username
DOMAIN\\username