Change Homedir folder

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
Vox
Posts: 4
Joined: 25 Oct 2010 06:53

Change Homedir folder

#1 Post by Vox » 10 Nov 2010 09:54

hello, I want to change the path of the homedir folder for a lot of users.
I have a txt file with the usernames of the users.

I know the command to change the homedirs folder:
for /f "delims=" %%a in ('c:\users.txt') do (dsmod user "cn=full name,ou=hc gebruikers,ou=hc,DC=hc,dc=tmg,dc=lan" -hmdir=\\hc-file02\homedirs\%%a.

The only problem is how do i get the full name in this command?

Can sombody help.
Thank in advance

Vox

amel27
Expert
Posts: 177
Joined: 04 Jun 2010 20:05
Location: Russia

Re: Change Homedir folder

#2 Post by amel27 » 12 Nov 2010 03:00

Code: Select all

set $OU=ou=hc gebruikers,ou=hc,DC=hc,dc=tmg,dc=lan
for /f "usebackq delims=" %%a in ("c:\users.txt") do (
dsquery user "%$OU%" -scope subtree -samid %%a|dsmod user -hmdir "\\hc-file02\homedirs\%%a"
)

Vox
Posts: 4
Joined: 25 Oct 2010 06:53

Re: Change Homedir folder

#3 Post by Vox » 14 Nov 2010 14:11

Thankk youuu

That works:)

Post Reply