Why not ask Windows for that information?
On my Windows machine I see environment variables like
USERDNSDOMAIN=xxx.yyy.COM
USERDOMAIN=xxx
USERDOMAIN_ROAMINGPROFILE=xxx
USERNAME=zzz
USERPROFILE=C:\Users\zzz
not sure if those are Windows defaults or something our local support team created.
... View more