Locating the User Name and Password for the Windows Security - Enter Network Credentials

Kansas 20 Reputation points
2025-07-10T18:34:13.9066667+00:00

I just purchased a new desktop computer and I am attempting to connect it to my home network. I am able to connect my desktop to my laptop (I remembered the User Name and Password for the laptop) but I am unable to connect the laptop to the desktop. I do not remember the user name nor password for my new desktop computer.

Where can I find the User Name and Password for my desktop? I have tried different combinations of my desktop's computer name and the password for my Microsoft account but these did not work.

Windows for home | Windows 11 | Accounts, profiles, and login

Answer accepted by question author
Francisco Montilla 31,825 Reputation points Independent Advisor
2025-07-11T20:03:00.7466667+00:00

You can keep the window open by using the “/k” switch. Press Win+R, type

cmd /k whoami

and hit Enter. A Command Prompt will open and stay visible, showing something like

DESKTOP-ABC123\JohnDoe

Make a note of the text after the backslash (in this example "JohnDoe"). That's the exact user name you’ll need when entering your network credentials on the laptop.

Was this answer helpful?

10+ people found this answer helpful.
0 comments No comments

3 additional answers

Sort by: Most helpful
  1. Francisco Montilla 31,825 Reputation points Independent Advisor
    2025-07-10T21:27:36.5266667+00:00

    Hello,

    Your network credentials for accessing your new desktop are simply the sign-in credentials (user name and password) for one of the desktop's Windows accounts. If you only ever set up a PIN on that machine, you don't actually have a separate password you can look up. You'll need to create or reset one.

    First, discover exactly what your desktop thinks your user name is. On the desktop, press Win + R, type cmd and press Enter. At the prompt enter

    whoami
    

    and hit Enter. You’ll see something like

    DESKTOP-PC\JohnDoe
    

    "DESKTOP-PC" is your computer name and "JohnDoe" is the account name you need.

    Next you need a password for that account. Because you signed in with a Microsoft account and then set only a PIN, you didn't choose a local password during setup. Windows still knows your Microsoft-account password, but if you can't recall it you'll have to reset it online at account.microsoft.com. If you do remember it, that is the password you must use here (not the PIN).

    If you'd rather define a brand-new password on the machine itself, do this on the desktop: press Win + I to open Settings, go to Accounts, choose Sign-in options, then Password and click Change. Follow the prompts to set a new password for your account.

    Once you have a password in hand, go back to your laptop and, when prompted for network credentials, enter exactly the whoami command result. For example, if whoami showed DESKTOP-PC\JohnDoe, type that in the User name box and the password you just set (or your Microsoft-account password) in the Password box. You'll then connect seamlessly.

    If you'd prefer not to enter credentials every time, you can disable password-protected sharing. On the desktop open Control Panel > Network and Sharing Center > Advanced sharing settings > All Networks, and turn off Password protected sharing. That lets any machine on your LAN connect without a password.

    Was this answer helpful?

    5 people found this answer helpful.

  2. Kansas 20 Reputation points
    2025-07-11T20:34:31.0033333+00:00

    Thank you very much Francisco for helping me to find out who I am. It worked as you suggested. I was able to see my username and I knew my Microsoft password. I entered both and now I am able to see the files on my desktop from my laptop.

    Great job.

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments

  3. Mason Fraser 165 Reputation points
    2025-07-10T18:56:08.5433333+00:00

    The username and password for "Enter Network Credentials" are usually the login details for the desktop you're trying to connect to. If you never set a local password, try leaving it blank. If that doesn’t work:
    For the username, try:

    .\<YourDesktopUsername>
    

    For example,

    .\Admin
    

    For the password: Use the password you set when you first set up the desktop (or your Microsoft account password if you used one).

    If you are still stuck, let me know.

    Was this answer helpful?

    1 person found this answer helpful.

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.