Results 1 to 4 of 4

Thread: ADSI Homedrive

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jun 2004
    Posts
    20

    ADSI Homedrive

    Ok I'm using the following code to Add a home drive to my user in AD. I can see the changes in ADUC however when the user logs it connects the home drive as:
    \\server01\home$\
    instead of
    \\server01\home$\newuser

    DE.Properties("homeDrive").Add("h:")
    DE.Properties("homeDirectory").Add("\\server01\home$\%username%")
    DE.CommitChanges()

    However if I just open ADUC go to the profile tab and hit apply next log on it works. I'm I missing something in my code to create the Directory itself?

  2. #2
    Hyperactive Member LeeSalter's Avatar
    Join Date
    Oct 2002
    Location
    Notts, England
    Posts
    307

    Re: ADSI Homedrive

    Hi RedCamel,

    AD will not create the directory for you automatically, you need to create it yourself through your code.
    "I'm Brian and so is my Wife"

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Jun 2004
    Posts
    20

    Re: ADSI Homedrive

    Do you have any sample code?

  4. #4
    Frenzied Member Ideas Man's Avatar
    Join Date
    Aug 2002
    Location
    Australia
    Posts
    1,718

    Re: ADSI Homedrive

    Creating a directory is easy, use the IO class and you can do it in one line of code.
    VB Code:
    1. IO.Directory.CreateDirectory([i]DirectoryToMake[/i])
    I use Microsoft Visual Basic 2005. (Therefore, most code samples I provide will be based around the .NET Framework v2.0, unless otherwise specified)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width