Getting ‘The PC name is invalid’ error while renaming the PC? Here is how to fix the “The PC name is invalid” error in Windows 11.
Recently, I have shown you how to change the PC name in Windows 11 with just a few clicks. However, depending on your PC and user account, you might occasionally see the “The PC name is invalid” error. When you see this error, you will be unable to rename the PC. The error appears right on top of the name field.
There are many reasons why you see this error. For example, your user account may not have enough permissions, you are using special characters, Windows 11 sync feature interference, etc.
No matter the reason, if you see this error, you need to troubleshoot a couple of essential things to fix the problem. The good thing is, it is pretty easy to do.
So, without further delay, let me show you how to fix the ‘The PC name is invalid’ error in Windows 11.
Fix ‘The PC name is invalid’ error
To troubleshoot and fix the “The PC name is invalid” error, follow the below sections one after the other. Here is how to do it.
- Use administrator account
- Make sure not to use special characters
- Turn off sync temporarily
- Try using a local account
- Use PowerShell command
Use administrator account
To change the computer name, you need administrator privileges. More specifically, your user account should have administrator rights. If your user account has admin rights, the Settings app will automatically inherit them while renaming the PC.
If you don’t know whether your user account has admin rights or not, you can check it pretty quickly. Here is how to do it using the Settings app.
- Use “Start + I” to open Settings.
- Select “Accounts” on the sidebar.
- You should see “Administrator” on the header.
- If you see it, you are using an Administrator account.
Detailed steps:
The first thing we need to do is launch the Windows 11 Settings app. You can use the “Start + I” keyboard shortcut or right-click the Start menu and select the “Settings” option. You can also click on the Settings icon in the Start menu.
After opening the Settings app, click on the “Accounts” tab on the sidebar. On this page, you will see your account type right under the account name on the header. If your user account has administrator rights, you should see “Administrator” right under the user account name.
If it doesn’t say “Administrator,” your user account doesn’t have admin rights. In that case, you need to use an administrator account to change the PC name in Windows 11.
Make sure not to use special characters
While naming the PC, you need to follow specific naming conventions. Specifically, you shouldn’t use special characters other than the Hyphen (-). Here are the rules you should follow while naming the Windows 11 PC.
- The PC name can contain numbers 0 through 9.
- The PC name can have uppercase and lowercase letters.
- You can use the Hyphen (-) character.
- You cannot use any special characters other than Hyphen.
- PC name should not contain numbers only.
- The PC name should not have spaces.
Please read the above rules carefully and follow them while changing the name of your Windows 11 PC. You should no longer see the “The PC name is invalid” error message.
Turn off sync temporarily
If you use a Microsoft account to log into Windows 11, the sync feature is turned on by default. While the PC is syncing with your Microsoft account, it might sometimes interfere with renaming the computer.
In that case, turning off sync temporarily and then renaming the PC will fix the problem. Let me show you how to turn off sync temporarily in Windows 11.
- Launch the Settings app (Win + I).
- Select “Accounts” on the sidebar.
- Click on “Windows Backup.”
- Turn off the “Remember my apps” option.
- Turn off the “Remember my preferences” option.
- With that, the Windows 11 Sync is turned off.
Now, try to rename the PC. If the sync feature is responsible for the problem, you should no longer see the “The PC name is invalid” error.
Try using a local account
If turning off sync is not working or your user account doesn’t have administrator rights, you can create a new local account in Windows 11 and change the PC name from there.
Don’t forget to create a new local account with administrator rights.
I’ve already written a detailed guide on how to create a local account in Windows 11. Follow that guide, and it should be ready in no time. After renaming the PC, you can delete the user account.
Use PowerShell command
Alternatively, you can use a simple PowerShell command to rename the PC. It is pretty easy to do and often solves the “The PC name is invalid” error. Here is how to do it.
First, right-click the Start menu and select the “Windows Terminal (Admin)” option. In the terminal window, ensure the PowerShell tab is open. If not, click the dropdown menu on the top bar and select “Windows PowerShell.”
Execute the below command while replacing the “NEW_PC_NAME” with the actual name you want to set. As I said earlier, follow the naming rules shown in the top section.
Rename-Computer -NewName “NEW_PC_NAME”
Close the terminal window.
With that, the “The PC name is invalid” error is solved, and you renamed the PC.
—
That is all. It is that simple to fix the ‘The PC name is invalid’ error in Windows 11.
I hope this simple and easy Windows 11 how-guide helped you.
If you are stuck or need some help, comment below, and I will try to help as much as possible.