Fix Net User Domain System Error 5 Access Denied
When you run net user or net user /domain in Command Prompt and get System error 5 has occurred. Access is denied., it means your current command prompt session lacks the administrative rights needed to query or modify user accounts. This guide walks you through the exact steps to launch an elevated prompt, run the command correctly, and resolve the underlying permission issues that cause this error on Windows.
What You’ll Need
- A Windows PC (Windows 10 or 11) with an administrator account you can log into.
- If you’re using a domain account, you need credentials that have permission to view or change domain users (e.g., Domain Admin or delegated account operator).
- Your computer must be joined to the domain if you’re using
/domain; otherwise, the command will fail with a different error.
Step-by-Step
- Close all Command Prompt windows. If any are open, right-click the title bar and choose Close, or just close them.
- Open an elevated Command Prompt. Click the Start button, type
cmdorCommand Prompt. In the search results, right-click Command Prompt and select Run as administrator. If prompted by User Account Control (UAC), click Yes. - Verify the prompt is elevated. The title bar of the Command Prompt window should say Administrator: Command Prompt. If it doesn’t, close it and repeat step 2.
- Run the command again. For a local user, type:
net user username
For a domain user, type:net user username /domain
Replaceusernamewith the actual account name. If you want to list all users, usenet user(without a username) ornet user /domain. - If you still get error 5, check the domain context. If you’re on a domain-joined machine and using
/domain, make sure you are logged in with a domain account that has rights. You can also try running the command with explicit credentials:runas /user:DOMAIN\admin "net user username /domain"
Enter the password when prompted. - If the command works now, you’re done. The issue was simply that your previous Command Prompt was not running as administrator.
Common Mistakes
- Running as administrator but still getting error 5: This usually happens when the UAC prompt was declined, or you clicked Run instead of Run as administrator. Double-check the title bar.
- Using
/domainon a non-domain machine: If your PC is not part of a domain, the command will fail. Usenet userwithout/domainfor local accounts. - Typing the username with extra spaces or wrong case: The command is case-insensitive, but extra spaces cause errors. Ensure the username is correct.
- Forgetting to close the old prompt: Even if you open a new elevated prompt, the old one might still be the active window. Always close all previous instances.
Tips
- Use PowerShell instead: If you prefer, open PowerShell as administrator and run the same
net usercommands – they work identically. - Check the Local Security Policy: On some systems, the policy “User Account Control: Admin Approval Mode for the Built-in Administrator account” might be disabled, causing issues. You can check this via
secpol.mscbut only if you understand the security implications. - For domain queries, use Active Directory tools: If you have access,
dsquery useror the Active Directory Users and Computers MMC snap-in are more reliable for domain user management. - Run as a different user: If your current account doesn’t have admin rights, use
runas /user:Administrator cmdto open an elevated prompt with the built-in admin account.
Troubleshooting
If you still see error 5 after following the steps above:
- Check if your account is actually an administrator. Go to Settings > Accounts > Your info. If it says “Administrator” under your name, you’re good. If not, you need to log in with an admin account or ask the admin to grant you rights.
- Verify the domain path. If you’re using
/domain, confirm the computer is domain-joined by runningsysteminfoand looking for “Domain” – it should show your domain name, not “WORKGROUP”. - Test with a simple elevated command. Run
whoami /groupsin the elevated prompt and look for “Mandatory Label\High Mandatory Level”. If you see “Medium”, your prompt is not elevated. - Disable UAC temporarily (not recommended). If you’re desperate, you can set UAC to “Never notify” in
User Account Control Settings, then reboot and try again. But this weakens security – re-enable it afterward. - Check for group policy restrictions. Some organizations restrict who can run
net usereven as admin. Contact your IT department if this is a work computer.
Frequently Asked Questions
Why do I get error 5 even though I am logged in as admin?
Because the Command Prompt itself is not running with elevated privileges. Windows separates the admin token from normal operations – you must explicitly right-click and choose “Run as administrator”.
Can I fix this without admin rights?
No. The net user command modifies user accounts, which requires administrative privileges. You need to ask the system administrator to run it for you or provide you with an admin account.
Is there a difference between error 5 and error 5 with /domain?
Error 5 with /domain often means your domain account lacks the necessary permissions to view domain users, even if you’re a local admin. You need domain-level rights (like Domain Admin) for that.
Does this work on Windows 7 or Windows Server?
Yes, the same steps apply to Windows 7, 8, 10, 11, and Windows Server (2008 R2 and later). The “Run as administrator” option is available in all these versions.
What if I need to reset another user’s password?
You can use net user username * (for local) or net user username * /domain (for domain) to prompt for a new password. You must be elevated and have the right permissions.
Can I use this command in a batch script?
Yes, but the script must be run as administrator. You can right-click the .bat file and select “Run as administrator”, or use a scheduled task with “Run with highest privileges”.
Related
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.