Create H Drive within Active Directory

Welcome Forums General PowerShell Q&A Create H Drive within Active Directory

Viewing 2 reply threads
  • Author
    Posts
    • #164563
      Participant
      Topics: 67
      Replies: 71
      Points: 526
      Rank: Major Contributor

      I have an Active Directory oddity from the results of a script that I have composed and can’t figure out why this situation is occurring.

      I have a script that will create an Active Directory account and the associated settings along with it.   One of the settings is the H: drive (within AD interface on the Profile Tab under the Home Folder section) and the home directory path.

      I accomplish this by executing the following command.

      Set-ADUser $user.SamAccountName -HomeDrive H -HomeDirectory '\\cfs04\tptest-users$\bctest'

      After I run my script, I go to the AD server and look at the bctest user and confirm within the AD interface, on the profile tab, there is a Home Folder with the ‘H’ drive selected and the correct Path.

      With that recently created account,  log into a terminal server to verify the H drive is there.  A home path has been mapped but it has not mapped with an H drive but with a Z drive.

      I go back to Active directory and verify that it does indeed show that ‘H’ drive is the selected drive.  I then log out of my ts session and then from within Active Directory, change the H: drive to another drive, change it back to the H: drive and apply.  I log into the TS session and I see that the drive has correctly mapped with an H and not a Z.

      So the command above is not declaring an H drive at all.

       

      Does anyone see an error in my statement above?

       

       

       

    • #164608
      Participant
      Topics: 67
      Replies: 71
      Points: 526
      Rank: Major Contributor

      I withdraw my query.  Representing the Drive letter requires it is in quotes with a colon.  I have seen examples where it does not include the quote, but apparently it is required.

       

      Set-ADUser -Server w2k8-dc2 -Identity $user.SamAccountName -HomeDrive "H:" -HomeDirectory '\\cfs04\tptest-users$\bctest'
    • #164617
      Senior Moderator
      Topics: 9
      Replies: 1236
      Points: 4,443
      Helping Hand
      Rank: Community Hero
Viewing 2 reply threads
  • The topic ‘Create H Drive within Active Directory’ is closed to new replies.