Script to find and change users' with homedirectory path on one server to another server AD
Posted on 2009-05-12
I need a script to find users in AD who have their homedirectory on a specific server, and then change that homedirectory to a new path.
E.g., I have many users who currently are using the path \\servername\username$. We're moving the folders to a new server, and I only want to use one share. So for those users, I'd like to find them and change the path to \\newservername\users$\%username%.
If I have to, I can do it through ADUC by selecting them and modifying them, but I'd rather script it.
I've already looked through a lot of scripting guys scripts, and can't seem to put the two together (Find and then replace).