Page 1 of 1

Change Homedir folder

Posted: 10 Nov 2010 09:54
by Vox
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

Re: Change Homedir folder

Posted: 12 Nov 2010 03:00
by amel27

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"
)

Re: Change Homedir folder

Posted: 14 Nov 2010 14:11
by Vox
Thankk youuu

That works:)