c# Create AD-User with different networkdrive

socom1985
socom1985 used Ask the Experts™
on
I hope someone could give me an example on how to do this.. I want to create multiple users in the domain from my application. This allready works. But now I want to give each user a different map.
Example
User1 drive T:/ --> /server01/User1/
User2 drive T:/ --> /server01/User2/

 
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
got it              

 DirectoryEntry de = new DirectoryEntry(strpath);
                DirectoryEntries child = de.Children;
                DirectoryEntry deuser = child.Add("CN=" + strUser, "user");
                deuser.Properties["sAMAccountName"].Add(strUser);

                // Home dir (drive letter)  
                deuser.Properties["homedirectory"].Add(homeDir);

                // Home dir (path)  
                deuser.Properties["homedrive"].Add(homeDrive);  
                deuser.CommitChanges();
                SetPassword(deuser, strPassword);
                Enable(deuser);

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial