+ Post New Thread
Results 1 to 4 of 4
Scripts Thread, Script to change LDAP attributes in Coding and Web Development; Hi Everyone I need to add several Ldap atributes to numerous computer accounts in Active Directory I have this script ...
  1. #1

    Join Date
    Feb 2008
    Location
    Gloucester
    Posts
    32
    Thank Post
    6
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Script to change LDAP attributes

    Hi Everyone

    I need to add several Ldap atributes to numerous computer accounts in Active Directory

    I have this script but it only adds detail to one computer account. I need to read computer accounts from file using a for loop

    Script as follows:-

    Set objComputer = GetObject ("LDAP://CN=ibook04,ou=A4 Apple Computers,ou=Classroom PCs,DC=churchdown,DC=gloucs,DC=sch,DC=uk")
    objComputer.Put "description", "Art-A4"
    objComputer.SetInfo

    Any pointers would be greatly appreciated )

  2. #2

    Join Date
    Mar 2008
    Location
    Surrey
    Posts
    2,161
    Thank Post
    95
    Thanked 318 Times in 260 Posts
    Blog Entries
    4
    Rep Power
    111
    Are you happy using PowerShell?

    If so you could use Import-CSV and a foreach loop, just replacing the computer name in the LDAP string with something like $computer.

  3. #3

    Join Date
    Feb 2008
    Location
    Gloucester
    Posts
    32
    Thank Post
    6
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    James

    Thanks for replying

    I am new to PoweShell, any help on how this script should look would be appreciated

    Regards

    Barry

  4. #4

    Join Date
    Mar 2008
    Location
    Surrey
    Posts
    2,161
    Thank Post
    95
    Thanked 318 Times in 260 Posts
    Blog Entries
    4
    Rep Power
    111
    There's a script here which will create computer objects from a CSV file, and should give you the basic structure to work with.

    And another here which demonstrates how to modify AD attributes.

    Hope that helps.

  5. Thanks to jamesb from:

    barrystone (1st November 2010)

SHARE:
+ Post New Thread

Similar Threads

  1. LDAP script to block exchange address lists
    By jdibsdale in forum Windows
    Replies: 3
    Last Post: 10th September 2010, 02:20 PM
  2. Logon script to change profile?
    By garethedmondson in forum Windows 7
    Replies: 1
    Last Post: 4th March 2010, 08:28 PM
  3. Change a file name to something else by script
    By andy_nic in forum Scripts
    Replies: 11
    Last Post: 28th January 2010, 11:57 AM
  4. [Moodle] LDAP Script Questions
    By FN-GM in forum Virtual Learning Platforms
    Replies: 12
    Last Post: 18th August 2009, 09:06 AM
  5. Script to change printer server
    By button_ripple in forum Scripts
    Replies: 1
    Last Post: 16th September 2008, 12:29 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •