Windows 10: What are the rules regarding casing of values for environment variable USERNAME in Windows?

Discus and support What are the rules regarding casing of values for environment variable USERNAME in Windows? in AntiVirus, Firewalls and System Security to solve the problem; One of my customers says that in his AD usernames have mixed case sometimes and besides that, that people are able to successfully login using another... Discussion in 'AntiVirus, Firewalls and System Security' started by ThorstenSchöning, Oct 10, 2018.

  1. What are the rules regarding casing of values for environment variable USERNAME in Windows?


    One of my customers says that in his AD usernames have mixed case sometimes and besides that, that people are able to successfully login using another casing of usernames. So there might be an "ExampleUser" in the AD and Windows allows them to login with "exampleUSER" etc. as well.

    But what is the impact on the environment variable "USERNAME"?

    I have tested a bit myself without an AD and in all of my tests "USERNAME" had the value of the username as it has been created. So in case of "ExampleUser" created in Windows, using the login "EXAMPLEuser" provided "ExampleUser" as "USERNAME". That happened for RDP where users are free to input usernames as well as using "runas".

    My customer said that this is not the case for him at least sometimes, but instead if "ExampleUser" in the AD logs in using "exampleUSER", "USERNAME" really contains the value of the current login, "exampleUSER". I've found another question describing that as well:

    > For some users in this office, %USERNAME% is always in the case they type it when logging in.

    > For other users, %USERNAME has until recently always been in the canonical case (for a user logging in as elenasimpson it returns ElenaSimpson), but last week mysteriously started only doing this sometimes and the rest of the time returning it as typed. Rebooting often toggles to the other behaviour.

    What I did not found is any official docs from MS of what is the value of "USERNAME" under which setups and inputs of users. Are there any rules one can rely on?

    Thanks!

    :)
     
    ThorstenSchöning, Oct 10, 2018
    #1
  2. MCK
    mck Win User

    System environment variable won't stick


    Running Win10 Home on an Acer Spin 3, 64bit, i7cpu. I try to add a path to the system environment variables by:

    1. Control Panel > System > Advanced system settings > Advanced tab > Environment variables

    2. The "Environment Variables" window opens.
    3. In the "System Variables" pane I select "Path" and click the EDIT button.
    4. A list of the current system paths is displayed.
    5. I click the NEW button, browse to the path I want to add which is "C:\Python36-32" and click OK. The path "C:\Python36-32" is added to the list of current system paths.
    6. I click OK and am returned to the "Environment Variables" window.
    7. I click the "X" at the top right to close the "Environment Variables" window.

    Now if I click the "Environment Variables" button again (end of step-1) and repeat steps 2-4, the new path I added in step-5 is gone. IOW, adding a new path won't stick.

    What am I doing wrong?
     
  3. Searching environment variable in list

    I'm using a command that gives me a list of environment variables. When searching in the list, I want to find all environment variables with the word
    EXTERNAL; using the following command all that is occurring is all the environment variables are being listed instead of those environment variables with the word
    EXTERNAL ?

    findstr /c "EXTERNAL"
     
    StraightWorld, Oct 10, 2018
    #3
  4. Bree Win User

    What are the rules regarding casing of values for environment variable USERNAME in Windows?

    System environment variable won't stick


    Yes, there's an OK button for each step.


    What are the rules regarding casing of values for environment variable USERNAME in Windows? [​IMG]
     
Thema:

What are the rules regarding casing of values for environment variable USERNAME in Windows?

Loading...
  1. What are the rules regarding casing of values for environment variable USERNAME in Windows? - Similar Threads - are rules regarding

  2. What are values of user environment variable by default set on Windows 11

    in Windows 10 Gaming
    What are values of user environment variable by default set on Windows 11: What are values of user environment variable by default set on Windows 11? One of my user environment variable got deleted by accident https://answers.microsoft.com/en-us/windows/forum/all/what-are-values-of-user-environment-variable-by/eb42907f-679d-4376-8c42-ef3d0cf675d6
  3. What are values of user environment variable by default set on Windows 11

    in Windows 10 Software and Apps
    What are values of user environment variable by default set on Windows 11: What are values of user environment variable by default set on Windows 11? One of my user environment variable got deleted by accident https://answers.microsoft.com/en-us/windows/forum/all/what-are-values-of-user-environment-variable-by/eb42907f-679d-4376-8c42-ef3d0cf675d6
  4. what is temp environment variable?

    in Windows 10 Gaming
    what is temp environment variable?: I have started getting a message with a yellow triangle with an exclamation mark inside it saying"Word could not create the work file. Check the temp environment variable."The variable is C:\users\new13nov2022all it has in it is something called structured query log, which I...
  5. what is temp environment variable?

    in Windows 10 Software and Apps
    what is temp environment variable?: I have started getting a message with a yellow triangle with an exclamation mark inside it saying"Word could not create the work file. Check the temp environment variable."The variable is C:\users\new13nov2022all it has in it is something called structured query log, which I...
  6. environment variables

    in Windows 10 Software and Apps
    environment variables: Cant get the modal window when editing my system variables from the environment variables areai get this windowand i want this window https://answers.microsoft.com/en-us/windows/forum/all/environment-variables/07d24fc8-345d-4062-8169-3fa9bb16a049
  7. What are environment variables in Windows and what does they do?

    in Windows 10 Software and Apps
    What are environment variables in Windows and what does they do?: What are environment variables in Windows and what does they do? And why do we have to add an environment variable when we install any programming language in the PC?...
  8. environment variables

    in Windows 10 Customization
    environment variables: Hi, another question from a noob. I see in my PC environment variables at the bottom of the list a sole entry called ZES_ENABLE SYSMAN 1 .I am a sole PC home windows 10 user who only really games a lot. Should this be here, i can only find entries for this in the...
  9. regarding path variable of user variable of environment variable

    in Windows 10 Customization
    regarding path variable of user variable of environment variable: please help me fast, I accidentally deleted path variable of user variable ..... I want to restore it. the real situation is I cannot run android studio project and it shows error - " unable to start daemon process............This problem might be caused by incorrect...
  10. environment variable

    in Windows 10 Customization
    environment variable: What would happen when we deleted all the environment variable system directory. https://answers.microsoft.com/en-us/windows/forum/all/environment-variable/723a4cb6-5baf-4907-a56b-614f35d77da5