RPC_S_INVALID_NAME_SYNTAX (0X000006C8) fix on Server 2019
The RPC name syntax is invalid. This error hits when connecting to a remote server share or WMI and the name or path has a typo or unsupported character.
Quick answer
Check your UNC path or server name for unsupported characters like spaces, underscores, or trailing backslashes. The fix is to use a proper DNS name or IP without those characters.
What's going on here
You see error 0x000006C8 when something tries to make a Remote Procedure Call (RPC) to a server but the name it passes to the RPC runtime doesn't follow the naming rules RPC expects. This happens more often than you'd think. I've seen it on Server 2019 and Windows 10 machines when someone types a space in a server name in File Explorer's "Map network drive" box, or when a script passes a UNC path with an underscore in the server portion.
RPC names must be valid UNC paths (like \\server\share) or DNS names (like server.example.com). They can't have spaces, underscores, or special characters in the server part. The share and path after the server name can use spaces, but the server name itself is strict.
Step-by-step fix
- Identify exactly where the error appears. Is it when you run
net use, open a shared folder, or when a WMI script runs? The trigger tells you where the bad name is coming from. - Check the server name or IP you're using. Look for these common issues:
- Trailing backslash:
\\server\— remove the last backslash. - Spaces in the server name:
\\my server\share— this won't work. Use\\my-server\shareor\\192.168.1.10\share. - Underscores in the server name:
\\my_server\share— RPC hates underscores. Switch to a hyphen or use the IP. - Wrong case or typo:
\\SERVR\shareinstead of\\SERVER\share.
- Trailing backslash:
- Test with a simple command. Open Command Prompt as administrator and run:
If that works, the issue is your server name. If it fails with the same error, move to the alternative fixes below.net use \\127.0.0.1\C$ - If you're using a DNS name, test the IP directly. Run:
to make sure DNS resolves correctly. If pinging succeeds but the RPC call still fails, try the IP address instead. For example, replaceping [server-name]\\server\sharewith\\192.168.1.50\share. - For WMI queries, check your connection string. If you're using PowerShell, make sure there's no extra quote or special character. Example that works:
If you get the error, replaceGet-WmiObject -ComputerName "server01" -Class Win32_OperatingSystem"server01"with its IP.
If the main fix doesn't work
Sometimes the name is fine but the RPC service itself is having a bad day. Try these:
- Restart the RPC services. Open Services.msc, find "Remote Procedure Call (RPC)" and "RPC Endpoint Mapper". Right-click each and choose Restart. After that, retry your connection.
- Check for a firewall blocking the port. RPC uses port 135 for the endpoint mapper, then random high ports for the actual call. If a firewall blocks those high ports, you get this error. On the server, run
Then test again.netsh advfirewall firewall add rule name="RPC High Ports" dir=in action=allow protocol=TCP localport=49152-65535 - Check DCOM settings. If this happens with a DCOM application (like some backup software), open dcomcnfg.exe, go to Component Services > Computers > My Computer > right-click > Properties. On the Default Protocols tab, make sure "Connection-oriented TCP/IP" is listed first.
Prevention tip
Once you fix it, avoid using server names with underscores, spaces, or special characters. Stick to plain alphanumeric names with hyphens if you need word separation. This error pops up again the moment someone copies a path from an email with a stray character.
Was this solution helpful?