0
votes

I have our new hire process automated but we discovered recently that users logging in to their machine would not have their home folder mapped. Thinking it was the automation I have been banging head against the keyboard for the last 2 days trying to figure it out. I have found the issue I dont know how to fix it.

Its not Ansible. Its windows. If I try to add this attribute via powershell it behaves the same way (doesnt map the home folder on login), but if I go into to ADUC and I change one character and basically save it from there it works fine. I do notice that when I do it from the ADUC interface I get an error stating:

"The home folder was set to the following shared folder: \Fileserver{{user}}$

The shared folder already exists. because the folder is at the root of the fileshare, you must verify that the user has the appropriate permissions to manage the contents of the folder."

The following is the powershell command I tried using and appears to work fine Set-ADUser -Identity '{{ uid }}' -homeDrive 'H' -homeDirectory '\Fileserver{{ uid }}$'

The only thing I can think is that message needs acknowledgement but because its more informative powershell doesnt stop it from working or translate it properly.

I dont see a way to force it. Any help/suggestions.

1

1 Answers

0
votes

ADUC does more in the background than just setting the attributes in AD, in two respects:

  1. It sets the homeDrive to the drive letter with a colon. So you should be using -homeDrive 'H:'.

  2. It verifies that the homeDirectory looks valid (it must look like \\server\whatever) and, more importantly, creates the folder on the server, as long as the current user has the permissions to do so.

So your issue could be either that you're just missing the colon in the homeDrive, or your script isn't creating the folder on the server, or both.