none
how to update 100 + AD users home directory with script .. RRS feed

  • Question

  • I have a request to update 100 + AD users home directory on user attributes as H: Drive \\server1\userdate\%username% .  and user should have full permission on home folder.

    Please let me know the if any script of window 2003 commands to update in one shot.

    Windows 2003 Domain controller in not supporting Power shell.

    it is possible to integrate below command with powershell to update bulk user

    or

    is there any other way update bulk users home directory

    net user test1 -hmdrv h: -hmir //server/userdata/test1

    • Edited by Raja Y Sunday, December 8, 2013 4:25 PM
    Sunday, December 8, 2013 3:44 PM

Answers

  • Hi,

    If you multiselect the users in ADUC, you can change the attribute for all of them from the profile tab. That's probably going to be the fastest method of handling this (especially since I don't have a template for this in my VBScript library at home).

    Also, just as a FYI, Server 2003 can run the Active Directory Management Gateway. That'll allow you to use the AD powershell module from any Win7+ workstations (with the RSAT tools installed).


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

    Sunday, December 8, 2013 4:32 PM

All replies

  • In windows 2003 AD we do this with Group Policy. PLeas epost you question I the Group Policy forum for further help/

    PowerShell works fin on WS2003.From your question it appears that you really need to spend some time learning the basics of Windows administration.  Iy would help you to ask better questions and it would also help you in learning how to set up and manage AD.

    Start by asking the GP forum how to manage user folders with Group Policy.


    ¯\_(ツ)_/¯

    Sunday, December 8, 2013 4:31 PM
  • Hi,

    If you multiselect the users in ADUC, you can change the attribute for all of them from the profile tab. That's probably going to be the fastest method of handling this (especially since I don't have a template for this in my VBScript library at home).

    Also, just as a FYI, Server 2003 can run the Active Directory Management Gateway. That'll allow you to use the AD powershell module from any Win7+ workstations (with the RSAT tools installed).


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

    Sunday, December 8, 2013 4:32 PM
  • Set-ADUser : Unable to find a default server with Active Directory Web Services
     running.
    At line:1 char:11
    + Set-aduser <<<<  -Identity newuser -homedirectory "\\server\home$\%username
    %" -homedrive H:  -whatif
        + CategoryInfo          : ResourceUnavailable: (newuser:ADUser) [Set-ADUse
       r], ADServerDownException
        + FullyQualifiedErrorId : Unable to find a default server with Active Dire
       ctory Web Services running.,Microsoft.ActiveDirectory.Management.Commands.
      SetADUser
    Monday, December 9, 2013 8:09 AM
  • Set-ADUser : Unable to find a default server with Active Directory Web Services
     running.

    Do you have one up and running? ADWS runs on WS2008R2+, but you can install the Active Directory Management Gateway on WS2003/2008 to use the cmdlets as well.

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

    Monday, December 9, 2013 1:35 PM
  • Hi,

    I don't think that "%username%" will work with Set-ADUser.

    I would recommend ADUC, as previously recommended, if you're not familiar with scripting.

    Bill

    Monday, December 9, 2013 3:47 PM
    Moderator
  • I don't think that "%username%" will work with Set-ADUser.

    Good catch, I didn't even look past the ADWS message.

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

    Monday, December 9, 2013 3:48 PM
  • %username% is converted in ADUC only as noted.  It will not work whenscripting  AD.

    ADUC can allow bulk edits by just selecting all accounts and setting the property.

    AWS is not good for non-technicians as it has many complex requirements and is sensitive to WS2003 servers settings.

    Group Policy is the preferred method of doing this and has been since WIndows 2000. Untrained Admins learn from friends or the Interenet that this used to be scripted on pre-NT4 systems.  It was added as a part of teh User acount on Windows 2000 becuse it was also part of the pre-NT4 user settings.  It still exists as part of local users account settings and has been left inAD to support some domains that are still usng it.  As GP is implemented it just gets overridden.

    There are many wasy to set this up in GP.  The easist is to redirect the users "MyDocuments" and set that as the home folder.  You can even set teh drive letter although most sites are dropping drive letters exxcept for a ferw pices of legacy software that require the older idve methodology.

    FOr anyone not trained in Admin of AD the approach should not be using a script. It should be to use Group Policy. Once this is set up there is never a need to change things. If you run a script itt will alwyas be an issue.

    If you absolutely insist on trying to do it with a script thenlook in the repository.  There are a number of scripts that use VBScript or PowerSHell that set the drive and home folder for already existing accounts.


    ¯\_(ツ)_/¯

    Monday, December 9, 2013 4:08 PM