So I was reading on technet social a question about using environment variables in DFS paths. In this case he wanted to use the %username% variable. I have also thought about how nice that could be, a little magic. And all users could have the same URN for there homedirectory. Just think how nice \domain.local\dfs\MyHome feels. Well on with the blog, you cant. It doesn’t work.

To understand what kind of problems we are facing we need to look into how DFS works:

When a client asks for an UNC path (all paths starting with \), windows will deliver the request to mup.sys (multiple UNC provider). Mup.sys is responsible for sending the request to the correct driver. Or in the case of DFS resolving the path to the correct path and then sending it to the correct driver.

So now we know that mup.sys would need to do the translation. But where in my system is mup.sys? There is a service called mup.

C:\>sc query mup

SERVICE_NAME: mup
        TYPE               : 2  FILE_SYSTEM_DRIVER
        STATE              : 4  RUNNING
                                (STOPPABLE, NOT_PAUSABLE, IGNORES_SHUTDOWN)
        WIN32_EXIT_CODE    : 0  (0x0)
        SERVICE_EXIT_CODE  : 0  (0x0)
        CHECKPOINT         : 0x0
        WAIT_HINT          : 0x0

And since this is a service that does the conversation from DFS to physical UNC path using user environment variables don’t work.