Mass Changes To Active Directory User Objects


we point users home , profile path follows;

\\server\home\a-d\adam01

the a-d portion in example above split ids a-d, e-h, j-p, q-z  not in 1 large folder.

what need start using dfs patchs follows;

\\domain\dfs\ad\adam01

we have tested , works fine, problem have several thousand objects , cant manually go through each 1 editing it.  need replace the \\server\home\ \\domain\dfs\home\

does know of tool can 'find & replace' job on several thousand objects?

can read off list of users (say, users.ini) or can directly run adsi query against domain list users , pass each user account , domain sub-routine:

1 sub changeuserprofilepath(strdomain, struser)  
2 const oldprofile = "\\server\home" 
3 const newprofile = "\\domain\dfs\home" 
4 dim suser, strnewprofilepath  
5  
6 set suser = getobject("winnt://" & strdomain & "/" & struser & ",user")  
7 x=instr(suser.profile, oldprofile)  
8 if x > 0 then  
9   strnewprofilepath = replace(suser.profile, oldprofile, newprofile)  
10   suser.put "profilepath", strnewprofilepath  
11   suser.setinfo  
12 end if  
13 end sub 

salvador manaois iii
mcitp | enterprise/server admin
bytes & badz : http://badzmanaois.blogspot.com/


Windows Server  >  Directory Services



Comments

Popular posts from this blog

2008 Windows Deployment Server Properties Error

Can no longer user MS Update - Files required to use Microsoft Update are no longer registered

How do a find data in one file, search for it in another file and if not found, write a custom message to another file