RE: [OT] VB Scripting problem

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

Hi Shawn

I would really appreciate it, thanks.


-----Original Message-----
From: Quillman Shawn (RBNA/CIT1.1) * [mailto:Shawn.Quillman@xxxxxxxxxxxx] 
Sent: 18 August 2003 15:54 PM
To: [ISAserver.org Discussion List]
Subject: [isalist] RE: [OT] VB Scripting problem

http://www.ISAserver.org



Sorry, my brain was in IIS mode...  You shouldn't need to manually bind if
this is a .vbs script running in the context of an account that has the
appropriate permissions.

Hmm.  That all looks ok here.  You might be right about that attribute.
I've never tried doing anything with the name attribut through scripts...  I
will try it at home tonight and see if I can figure something out.

-Shawn

----- 
Shawn R. Quillman 
Robert Bosch Corporation RBNA/CIT1.1 
38000 Hills Tech Drive 
Farmington Hills, MI  48331 
(248) 553-1164 (P)     (248) 848-2855 (F) 
shawn.quillman@xxxxxxxxxxxx 
-----Original Message-----
From: William Robertson [mailto:robertson.william@xxxxxxxxxxxxxx]
Sent: Monday, August 18, 2003 8:30 AM
To: [ISAserver.org Discussion List]
Subject: [isalist] RE: [OT] VB Scripting problem


http://www.ISAserver.org


Hi Shaun

I am not binding with a specific username/pwd )Frankly because eI can never
tell when I need to J)
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: