When you connect to a shared folder on another PC, NAS, or Windows server using SMB (Server Message Block), Windows asks for a username and password. People often get stuck at this step — “what username? what password?” — because SMB credentials are not a separate secret you set specifically for file sharing in most cases.
This guide explains what those credentials are, how to find them on Windows 11, how to change or reset them, and how to use saved credentials safely.
What SMB credentials actually mean
SMB authenticates you using a user account that exists on the machine serving the share (or in the domain if you’re in an Active Directory environment). There are three common setups:
- Local user on the host: The share accepts usernames that exist as local accounts on the host PC (e.g.,
sukh
,admin
). Use that account’s password. - Microsoft account on the host: If the host’s user account is a Microsoft account, the username is the Microsoft email (e.g.,
[email protected]
) and the Microsoft account password is used. - Domain account: In corporate networks, SMB uses domain credentials (e.g.,
MYDOMAIN\jdoe
or[email protected]
).
There is no distinct “SMB password” separate from the normal password for the account you are using.
How to find your username on Windows 11 (the client or the host)
If you’re not sure what your Windows username is, try one of these quick methods:
- Settings
- Open Start > Settings > Accounts.
- If you signed in with a Microsoft account, you’ll see your email. If it’s a local account, you’ll see the account name.
- Command prompt
- Press
Win + R
, typecmd
, press Enter. - Type
whoami
and press Enter.
Output looks likeDESKTOP-XYZ\sukh
orDESKTOP-XYZ\Administrator
. The part after the backslash is the username.
- Press
- PowerShell
- Open PowerShell and run:
Get-LocalUser
— this lists local accounts on the PC.
- Open PowerShell and run:
- Control Panel (older view)
- Open Control Panel > User Accounts to see account names.
If you need to connect to a share on another machine, find the username that exists on the host (the machine that shares the folder). If you don’t have an account there, create one or ask the host admin.
Can I view my Windows password?
No. Windows does not let you “show” the current password for a user. If you’ve forgotten it you must reset it:
- Local account: Sign in as another admin and change the password:
Start > Settings > Accounts > Family & other users > select user > Change account type
(or usenet user username newpassword
from an elevated command prompt). - Microsoft account: Reset online at the Microsoft account recovery page (you’ll need the email and recovery options).
- Domain account: Contact your IT helpdesk or use domain password reset procedures.
How to change/reset the password (step-by-step)
Using Settings (local or Microsoft account):
Start > Settings > Accounts > Sign-in options
— choose Password and follow prompts to change it (you’ll need current password).- For other local users:
Settings > Accounts > Family & other users
, select the user, then “Change account type” / manage.
Using Command Prompt (admin) for a local account:
- Open Command Prompt as Administrator.
- Run
net user username newpassword
Example:net user sukh P@ssw0rd123
Note: Changing the password on the host invalidates saved cached credentials on other machines — you’ll need to re-enter the new password when reconnecting.
Saved credentials and Credential Manager
Windows can save SMB credentials so you don’t type them every time.
- Open Control Panel > Credential Manager > Windows Credentials.
You’ll see entries likeTERMSRV/servername
orMicrosoftAccount:[email protected]
. You can Edit or Remove credentials here.
If a saved credential is wrong, remove it and reconnect so Windows prompts you for the correct username/password.
How to connect to a share using a different username
If your current Windows account is different from the account on the host, you can supply different credentials.
File Explorer (GUI)
- Right-click This PC > Map network drive.
- Enter folder
\\server\share
. - Check Connect using different credentials and click Finish.
- Enter
server\username
orusername@domain
and the password.
Command line
Use net use
:
net use Z: \\SERVER\Share /user:SERVERNAME\username *
The *
prompts for the password (safer than typing it on the command line).
Troubleshooting common SMB login problems
- “Access denied” or wrong credentials: Make sure the username exists on the host and the password is correct. Remove old saved credentials from Credential Manager.
- Using Microsoft accounts: Some NAS devices don’t accept Microsoft accounts; create a local share account on the host.
- Two accounts conflict: Windows allows only one set of credentials per server — if you connected once with one username, you may need to
net use \\server\share /delete
or log off to switch users. - SMB versions: Old devices may require SMBv1 (disabled by default). Enabling SMBv1 is insecure — avoid if possible. Prefer enabling SMBv2/3 on both ends.
- Firewall or services: Ensure the Server service is running on the host and that Windows Firewall allows File and Printer Sharing on the network profile.
- Domain vs local: In domain environments, use domain credentials:
DOMAIN\username
.
Security tips
- Avoid enabling SMBv1. It’s legacy and insecure.
- Use strong unique passwords for accounts with shared access.
- Use SMB signing and SMB encryption if the host supports it (good for sensitive data).
- Remove or disable accounts that are no longer needed.
- Use the Credential Manager only on trusted devices.
Final checklist before you try to connect
- Identify the account on the host (local username or Microsoft email).
- Ensure you have or reset the account password.
- If using a different account, use Map network drive > Connect using different credentials or
net use /user:
. - Remove stale saved credentials in Credential Manager if you get repeated login failures.
- Check firewall and SMB services on both machines.
Short answer (in one line)
Your SMB username is the Windows account name you use on the computer that is sharing the folder (or the account created on the NAS/server). The password is the password for that same Windows account (or the account on the device hosting the share). If the host uses a Microsoft account, use the Microsoft account email and password.