barrystone Posted October 26, 2010 Posted October 26, 2010 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 )
jamesb Posted October 26, 2010 Posted October 26, 2010 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.
barrystone Posted October 26, 2010 Author Posted October 26, 2010 James Thanks for replying I am new to PoweShell, any help on how this script should look would be appreciated Regards Barry
jamesb Posted October 26, 2010 Posted October 26, 2010 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. 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now