[OT] VB Scripting problem

  • From: "William Robertson" <robertson.william@xxxxxxxxxxxxxx>
  • To: <isalist@xxxxxxxxxxxxx>
  • Date: Fri, 15 Aug 2003 07:28:56 +0200

Hi there

 

Sorry to bother this list with a VB problem, but with all the MS.Blaster VB
Code running around I'm sure that someone on this list is more than capable
of saving me from my newbie-VB skills :-)

 

I wish to correct the Display Names of all users in my AD and have written a
script to do it. Following is the crux of the script:

 

While Not objRecordset.EOF

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

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

            objUser.PutEx ADS_PROPERTY_CLEAR, "initials", 0

            objUser.Put "displayName", FullName

            objUser.Put "name", FullName

            objUser.SetInfo

    objRecordset.MoveNext

Wend

 

What I found is that just by writing the "displayName" attribute my problem
is not solved because when I browse my AD I still see a user's previous
name. I then used ldp.exe to find that the "name" attribute is another
attribute that I have to change, but when I try to run my script I get an
error saying:

"The server is unwilling to process the request."

 

I presume that the "name" (and "cn" for that matter) attributes are
essentially protected and was wondering if you knew what attribute I could
use to try and correct the display names? So far the only way I know that it
works is to right-click a name and select the "rename" option.

 

Thanks

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: