$env:username
I get a funny when trying to automate with powershell (on startup) and asking for the username/domain
(using set variables from local Windows 10 laptop)
The next two examples giving me a un expected output:
$USERDNSDOMAIN=$env:USERDNSDOMAIN
$USERNAME=$env:USERNAME
username gives me the computername with an $ sign on the end
Userdnsdomain is empty
Suppose these values aren't available on startup?
(using set variables from local Windows 10 laptop)
The next two examples giving me a un expected output:
$USERDNSDOMAIN=$env:USERDNSDOMAIN
$USERNAME=$env:USERNAME
username gives me the computername with an $ sign on the end
Userdnsdomain is empty
Suppose these values aren't available on startup?
Comments
Is there any way I can script user settings?
You may be able to launch another instance of powershell as another user, if you know their user name and password.