RE: Modify Profile paths and user directory in mass.

Tech-Archive recommends: Fix windows errors by optimizing your registry



Ehren,

If all of the users are moving to a similar location, you can do this in the
GUI. You would select all of the users that you would like to change and
then go to properties. You'll get a dialog that will show you a subset of
properties that can be changed as a group.

In the profile path and home directory fields, you can do something like:
\\Server2\Users\%username%

This will reset them all to the other location and standardize the path. I
am sure someone will point out that this wasn't always an option to edit
multiple objects at the same time -- but I am assuming Server 2003 since
you're using vServer 2005.

If you are looking for something that is a bit more granular to do something
like a search and replace in the path, you might consider a VBS Script that
uses ADSI to change the path. I am sure it is just habit, but I rarely use
ldifde unless I have to.

Give that a shot and let me know if you do need something more.

Hope this helps.
--
Ryan Hanisco
MCSE, MCTS: SQL 2005, Project+
Chicago, IL

Remember: Marking helpful answers helps everyone find the info they need
quickly.


"Ehren" wrote:

We are changing the location of users profiles and home directories and I
want to do it with a script since there are a lot of users. I have a test
environment set up in virtual server 2005 and tried doing the below things
which I cant figure out what is causing the hang up. Im thinking this should
be the easiest method once its working but if anyone has any other
suggestions I am open to them. I can not figure out what is wrong with this
and have looked up and tried a lot of variations and get simmilar results.
If someone could take a look and can tell me I would very much appreciate it!

Thanks!

Run Command: Ldifde –f users.ldf –d
“OU=Stduser,OU=Accounts,DC=phytest,DC=intranet” –l
“homeDirectory,homeDrive,profilePath”

OUTPUT to users.ldf:

dn: OU=StdUser,OU=Accounts,DC=phytest,DC=intranet
changetype: add

dn: CN=Mike Kehdi,OU=StdUser,OU=Accounts,DC=phytest,DC=intranet
changetype: add
homeDirectory: \\server1\users\kehdimic
homeDrive: Z:
profilePath: \\server1\profiles\kehdimic

dn: CN=Rio,OU=StdUser,OU=Accounts,DC=phytest,DC=intranet
changetype: add
homeDirectory: \\server1\users\rio
homeDrive: Z:
profilePath: \\server1\profiles\rio


Change to:

Line01
Line02 dn: OU=StdUser,OU=Accounts,DC=phytest,DC=intranet
Line03 changetype: modify
Line04
Line05 dn: CN=Mike Kehdi,OU=StdUser,OU=Accounts,DC=phytest,DC=intranet
Line06 changetype: modify
Line07 homeDirectory: \\server2\users\kehdimic
Line08 homeDrive: Z:
Line09 profilePath: \\server2\profiles\kehdimic
Line10
Line11 dn: CN=Rio,OU=StdUser,OU=Accounts,DC=phytest,DC=intranet
Line12 changetype: modify
Line13 homeDirectory: \\server2\users\rio
Line14 homeDrive: Z:
Line15 profilePath: \\server2\profiles\rio

SAVE FILE (note: ‘Linexx’ is not actually in the file, noted for reference
of the error)

Run Command : ldifde –I –f users.ldf

OUTPUT:
Connecting to “WSUS3-DC.phytest.intranet”
Logging in as current user using SSPI
Importing directory from file “users.ldf”
Loading entries
There is a syntax error in the input file
Failed on line 5. The last token starts with ‘m’.
0 entries modified successfully.
An error has occurred in the program
No log files were written. In order to generate a log file, please
Specify the log file path via the –j option.

-------------------

I also tried with quotes around the fqdn in line 5 thinking that because
there is a space in Mike Kehdi it caused a problem but it got the same error.

.



Relevant Pages