This topic contains 2 replies, has 2 voices, and was last updated by
July 7, 2019 at 1:49 pm #164563ParticipantTopics: 49Replies: 51Points: 268Rank: 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?
July 7, 2019 at 4:27 pm #164608ParticipantTopics: 49Replies: 51Points: 268Rank: 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'
July 7, 2019 at 5:55 pm #164617Senior ModeratorTopics: 8Replies: 1041Points: 3,439Rank: Community Hero
The documentation says, it requires a colon.
You must be logged in to reply to this topic.