I've searched the forums for something like this. I came across ADFunctions.au3 but I am unsure this is exactly what I need (and I am also getting an error on line 78 of ADFunctions.au3).
I basically want to find out what (group/ou?) attributes are assigned to the current computer object. For instance, I want to be able to run a script on the local machine, have it query that machine's AD group membership, create a new computer object and copy those attributes over to the new computer object. First and foremost, I just want to be able to DISPLAY (echo) the group membership just so I am sure it's correct.
I found some VB Code that's supposed to do just this but I can't make heads or tails of it:
Set objCompt = _ GetObject("LDAP://cn=Computers,dc=NA,dc=fabrikam,dc=com") Set objComptCopy = objCompt.Create("computer", "cn=SEA-SQL-01") objComptCopy.Put "sAMAccountName", "sea-sql-01" objComptCopy.SetInfo Set objComptTemplate = GetObject _ ("LDAP://cn=SEA-PM-01,cn=Computers,dc=NA,dc=fabrikam,dc=com") arrAttributes = Array("description", "location") For Each strAttrib in arrAttributes strValue = objComptTemplate.Get(strAttrib) objComptCopy.Put strAttrib, strValue Next objComptCopy.SetInfo
I know I can import it into AutoIt via a variety of ways but can someone please enlighten me as to what it's actually doing and how I can query AD first to make this happen? Thanks ahead of time for all of your help!!!!