Announcement

Collapse
No announcement yet.

Display Property

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Display Property

    Hello, everyone.
    I wrote a script to modify any attribute of an Active Directory object. I added this script on the context menu in ADUC for user objects. (I followed the steps described here http://www.petri.com/add_unlock_user_option_to_dsa.htm)

    Here is the script:

    Set wshArguments = WScript.Arguments
    Set objUser = GetObject(wshArguments(0))

    strAttribute = InputBox(Attribute,Attribute,"example")
    strValue = InputBox(Value,Value,"example-value")

    objUser.put strAttribute, strValue
    objUser.setinfo

    msgbox "Done - " & objuser.sAMAccountName


    This works fine but what if I want to change an attribute to more than one user at a time? I tried to select more names and execute the script from the context menu but nothing happend. Is there a trick to make it work with more objects?

    Thanks

  • #2
    Re: Display Property

    Not too sure about using the contect menu but when making bulk changes in AD is use AD Modify .Net (free from MS).

    Hope this helps
    Server 2000 MCP
    Development: ASP, ASP.Net, PHP, VB, VB.Net, MySQL, MSSQL - Check out my blog http://tonyyeb.blogspot.com

    ** Remember to give credit where credit is due and leave reputation points sigpic where appropriate **

    Comment


    • #3
      Re: Display Property

      Originally posted by v3ry900d
      Hello, everyone.
      I wrote a script to modify any attribute of an Active Directory object. I added this script on the context menu in ADUC for user objects. (I followed the steps described here http://www.petri.com/add_unlock_user_option_to_dsa.htm)

      Here is the script:

      Set wshArguments = WScript.Arguments
      Set objUser = GetObject(wshArguments(0))

      strAttribute = InputBox(Attribute,Attribute,"example")
      strValue = InputBox(Value,Value,"example-value")

      objUser.put strAttribute, strValue
      objUser.setinfo

      msgbox "Done - " & objuser.sAMAccountName


      This works fine but what if I want to change an attribute to more than one user at a time? I tried to select more names and execute the script from the context menu but nothing happend. Is there a trick to make it work with more objects?

      Thanks
      one of the possible things to do is to make a loop.
      I don't have the time to create you a script but this is just an idea:

      Get all arguments
      Set counter=0
      For each argument do
      Set objUser = GetObject(wshArguments(counter))
      do rest of the script
      counter = counter +1
      loop
      Marcel
      Technical Consultant
      Netherlands
      http://www.phetios.com
      http://blog.nessus.nl

      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"

      Comment


      • #4
        Re: Display Property

        Originally posted by Dumber
        one of the possible things to do is to make a loop.
        I don't have the time to create you a script but this is just an idea:

        Get all arguments
        Set counter=0
        For each argument do
        Set objUser = GetObject(wshArguments(counter))
        do rest of the script
        counter = counter +1
        loop
        That will not work. When I played with displaySpecifiers and could not find a way of working with multiple selections no matter how I tried to parse the arguments.
        If someone figures that out, please let me know.
        Guy Teverovsky
        "Smith & Wesson - the original point and click interface"

        Comment

        Working...
        X