No announcement yet.

Move users (from a file)

  • Filter
  • Time
  • Show
Clear All
new posts

  • Move users (from a file)

    i have a list of users in a .csv file that i want to move to a certain OU.
    I have only the samid of the users, not the dn.
    so my goal is a script that can get the user dn (of the users in the csv) searching the directory and the give the results to dsmove (by a pipe or another file)
    thanks, for help,

  • #2
    Re: Move users (from a file)


    I'm short on time right now but in addition to dsmove.exe, one of the following two commands might also get you what you need: csvde.exe and ldifde.exe (short of constructing a VB or WMI script from the ground up in ADSI).

    It may also be worthy of using ADU&C to perform a query to tag the majority of the users you want to move, highlight them all and then perform the move function in a GUI.

    Similarly, you could perform a dsquery and then a dsget to return the DNs of the user objects which you could then use to move using dsmove.

    VCDX3 #34, VCDX4, VCDX5, VCAP4-DCA #14, VCAP4-DCD #35, VCAP5-DCD, VCPx4, vEXPERTx4, MCSEx3, MCSAx2, MCP, CCAx2, A+ - VMware Virtualization Evangelist
    My advice has no warranties. Follow at your own risk.


    • #3
      Re: Move users (from a file)

      that's ok to get the dn by a dsquery.
      the point is how to give dsquery the records (the csv file)
      to explain:
      i don't need to do a dsquery to the whole directory, but only for the users in the csv file

      regards, pacho