none
Copying users from Active directory to individual folder structures on File Server

    Question

  • Hello all. I'm building a map drive structure for one of our new buildings. to start I created a folder called 'Users' on our file server. however I would like to know if anyone knows how to create individual folders  for each AD user on our file server without me having to type each users folder out one by one for each user.
    • Moved by nzpcmad1 Sunday, March 12, 2017 5:31 PM From ADFS
    • Edited by NetworkPizza Monday, March 13, 2017 8:04 PM
    Friday, March 10, 2017 2:55 PM

All replies

  • Hi NetworkPizza,

    I think you probably want the scripting forum - you want to create a folder for each user based on their username? Try this:

    get-aduser -filter * | select -expand samaccountname | %{md $_}

    But you probably want to do a lot more than that - set NTFS permissions, create a user specific share etc. Suggest you head over to the Microsoft Gallery. I am sure there are scripts that can help you out. Here is one that has a lot of downloads and some good stars https://gallery.technet.microsoft.com/scriptcenter/How-to-create-home-folder-d968f1d4

    Good Luck

    Shane

    Saturday, March 11, 2017 8:39 PM
  • Hello,

    in the AD User Object go to > Profile > Home Folder > \\NameFileserver\Sharename\%Username%

    A folder with Name from the specific user will create and only this user has access to this folder.

    Regards

    Saturday, March 11, 2017 11:34 PM
  • Thank you for your reply. But I need to do this in bulk. I have over 800 users I have to create folders for. Any ideas?
    Tuesday, March 14, 2017 7:25 PM
  • this should help you

    # CHANGE HOME DIRECTORY
    Get-ADUser -Filter * -SearchBase "OU=Users,OU=Test,DC=contoso,DC=com" | Foreach-Object{
    $sam = $_.SamAccountName
    Set-ADuser -Identity $_ -HomeDrive "H:" -HomeDirectory "\\server\share$\$sam"
    }

    https://social.technet.microsoft.com/Forums/scriptcenter/en-US/2bb716ed-d30d-4ca5-b38e-ea0894555fac/using-powershell-to-bulk-change-the-home-folder-path-of-ad-objects-username?forum=ITCG

    Thursday, March 16, 2017 10:19 PM
  • Hi,

    I am checking how the issue is going, if you still have any questions, please feel free to contact us.

    And if the replies as above are helpful, we would appreciate you to mark them as answers, and if you resolve it using your own solution, please share your experience and solution here. It will be greatly helpful to others who have the same question.

    Appreciate for your feedback.

    Best regards,

    Wendy


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Tuesday, March 21, 2017 9:29 AM
    Moderator
  • This worked. Thank you so much
    Monday, April 3, 2017 3:07 PM