No announcement yet.

Adding AD info globally

  • Filter
  • Time
  • Show
Clear All
new posts

  • Adding AD info globally

    Is it possible to update AD information for a group of users in an OU without going into the individual users properties box. I need to apply a recipient policy (in Exchange 2003) to an ou but the option to select users in an ou is not available. By putting the OU name in, say the department field, i can use this as the criterai to apply the recipient policy email address.

    Posted in Ex 2003 forum but advised scripting was the better option.

    volcano vaporizer classic
    Last edited by Richie; 19th January 2011, 19:41.

  • #2
    Here is a one-liner to update all the AD user accounts and set attributeX (pick your own attribute and replace attributeX in the code) to the name of the OU the object resides in:

    C:\>dsquery user dc=domain,dc=com | gawk " { match($0, /(\")(.*)(\")/,arr); split(arr[2],rdn,\",\"); split(rdn[2],ou,\"=\"); system(\"admod -b \" $0 \" attributeX::\" ou[2]) }"
    This requires:
    dsquery - comes with XP or 2003
    gawk - can be downloaded from
    admod - can be downloaded from

    Now I'll duck and run before being scalded for using Unix approach and not going with VBS
    Guy Teverovsky
    "Smith & Wesson - the original point and click interface"


    • #3
      a few examples can be founded here at Microsoft:

      and yes, it is in VBS
      Technical Consultant

      MCITP(EA, SA), MCSA/E 2003:Security, CCNA, SNAF, DCUCI, CCSA/E/E+ (R60), VCP4/5, NCDA, NCIE - SAN, NCIE - BR, EMCPE
      "No matter how secure, there is always the human factor."

      "Enjoy life today, tomorrow may never come."
      "If you're going through hell, keep going. ~Winston Churchill"