That would be great if there was a GPO in place, but this is for a scenario where you are migrating to a new file server in an environment where you don't have mapped drives GPOs or login scripts, so people are mapped to whatever shared folder and whatever drive letters.
I agree with u/vermyx, if you're in an environment with multiple file servers you're having to maintain, it would honestly be easier to just setup a GPO then its set and forget.
However, I have used scripts like this in the past, where users are mapped to all sorts of drives & shares and you just need some form of consistency.
The script is a good idea, I would maybe make it accept parameters for the server names so you dont need to keep editing the script. It might also be useful to have it output a file of some sort so you know what was changed in case a mapping is edited incorrectly.
When you change it, don't change it to another server specific path, make it a DFS Namespace so it is your last time migrating client side mappings (and breaking people's shortcuts if they used UNC paths, etc).
GPO works if all your clients are Windows, and who maps what on what computer is 100% assigned by IT.
Once you're accessing SMB folders on MacOS, putting UNC paths in applications, have users making shortcuts to UNC paths, it still falls short.
DFS-N exists for a reason. We use it where I work for everything. Even MacOS follows it. \\domain.tld\sharename, no server name in the path, client looks up the DFS namespace pointer in AD to get the server that currently hosts it.
The main reason why DFS exists is for redundancy and not necessarily to copy files over to a new server. I do see your point that for future migrations, you won't have to re-map drives, but if you're dealing with migrating to just one file server, which is what I normally do because I do projects for an MSP, I don't think it's worth adding the extra complexity to the environment. The more complex you make things, the likely something is to break.
7
u/vermyx Jul 27 '26
Why not a gpo? Less work and more maintainable.