RE: [OT] VB Scripting problem

  • From: "William Robertson" <robertson.william@xxxxxxxxxxxxxx>
  • To: "'[ISAserver.org Discussion List]'" <isalist@xxxxxxxxxxxxx>
  • Date: Mon, 18 Aug 2003 14:30:14 +0200

Hi Shaun

 

I am not binding with a specific username/pwd )Frankly because eI can never
tell when I need to :-))

Anyway, my full code looks like this:

 

Const ADS_PROPERTY_CLEAR = 1 

Set objConnection = CreateObject("ADODB.Connection")

objConnection.Open "Provider=ADsDSOObject;" 

Set objCommand = CreateObject("ADODB.Command")

objCommand.ActiveConnection = objConnection 

 

'OU and DC values changed to protect the innocent

objCommand.CommandText =
"<LDAP://OU=<OUName>,DC=<domainname>,DC=com>;(&(objectCategory=person)(objec
tClass=user));distinguishedname;onelevel"

Set objRecordSet = objCommand.Execute 

 

While Not objRecordset.EOF

    Wscript.Echo objRecordset.Fields("distinguishedName")

    

    Set objUser = GetObject("LDAP://"; &
objRecordset.Fields("distinguishedName"))

            'Take note, if a user has a blank decsription then the
objUser.Get function will fail - still need to work out how to get past this

            objUser.Put "description", "The new description goes here"

            

            FullName = objUser.Get("givenName") & " " & objUser.Get("sn")

            objUser.PutEx ADS_PROPERTY_CLEAR, "initials", 0

            objUser.Put "displayName", FullName

            'This next line is the one that fails

            'objUser.Put "name", FullName

            objUser.SetInfo

objRecordset.MoveNext

Wend 

objConnection.Close

 

I do not see that it is necessary to bind with a particular user/pwd as it
manages to do all the other functions just fine. My theory is that the
"name" attribute is protected somehow and I need to find another way to get
to change it.

 

Cheers

William R.

 

 


---------------------------------------------------------------------
Everything in this e-mail and attachments relating to the official
business of Columbus Stainless is proprietary to the company. It is
confidential, legally privileged and protected by law. Columbus
Stainless does not own and endorse any other content. Views and
opinions are those of the sender unless clearly stated as being that
of Columbus Stainless. The person addressed in the e-mail is the sole
authorised recipient.  Please notify the sender immediately if it has
unintentionally reached you and do not read, disclose or use the
content in any way. Whilst all reasonable steps are taken to ensure
the accuracy and integrity of information and data transmitted
electronically and to preserve the confidentiality thereof, no
liability or responsibility whatsoever is accepted if information or
data is,for whatever reason, corrupted or does not reach its intended
destination.
---------------------------------------------------------------------

Other related posts: