none
Changing Users Home directory Via powershell getting Z: instead of intended drive letter. RRS feed

  • Question

  • So, changing users home directory path - users are moving to a new server.

    I am trying to change the path by using the command

    set-aduser $user -homedirectory \\blahblah\user\username -homedrive F

    the user folder has been created in the new location with correct rights

    AD shows the correct path and drive letter on the profile tab.

    When the user logs in, they still have the old f: drive mapped to the old location and the new location is mapped to the z:

    Anyone see anything like this before?

    Monday, August 11, 2014 8:48 PM

Answers

  • Ok so I have found the solution.

    If I change my powershell code to set he drive letter first it works just fine

    instead of this:

    set-aduser $user -homedirectory \\blahblah\user\username -homedrive F

    I changed to this:

    set-aduser $user  -homedrive 'F:' -homedirectory \\blahblah\user\username

    And it Works!!

    Tuesday, August 12, 2014 6:05 PM

All replies

  • Group Policy!


    ¯\_(ツ)_/¯

    • Proposed as answer by Mike Laughlin Tuesday, August 12, 2014 5:14 PM
    Monday, August 11, 2014 8:53 PM
  • Are you saying group policy is causing this or that I should just make the change via group policy?

    Tuesday, August 12, 2014 4:49 PM
  • Are you saying group policy is causing this or that I should just make the change via group policy?

    I'd suggest making this change using Group Policy.


    Don't retire TechNet! - (Don't give up yet - 12,950+ strong and growing)

    Tuesday, August 12, 2014 4:55 PM
  • Are you saying group policy is causing this or that I should just make the change via group policy?

    I suggest that GP is already doing this so it is over-writing your changes.

    You need to run GPResults to see what is being applied.

    It is an outside possibility that you have a corrupt domain but I doubt that.  If nothing else comes up be sure to run DCDiag.


    ¯\_(ツ)_/¯

    Tuesday, August 12, 2014 4:59 PM
  • I was thinking the same thing, that group policy was setting the F: already.  I do not see that this is the case.  Did  a dcdiag and everything comes back normal.  If I go and manually set the path on the profile tab, to the same as what is in there already, cut and paste - it works.  
    Tuesday, August 12, 2014 5:44 PM
  • Ok so I have found the solution.

    If I change my powershell code to set he drive letter first it works just fine

    instead of this:

    set-aduser $user -homedirectory \\blahblah\user\username -homedrive F

    I changed to this:

    set-aduser $user  -homedrive 'F:' -homedirectory \\blahblah\user\username

    And it Works!!

    Tuesday, August 12, 2014 6:05 PM
  • Just had this happen.

    Thanks for the tip.

    This should be fixed. Super annoyed. 

    Tuesday, March 14, 2017 8:31 PM