Solved

Rename cn-attribute with ADSI does not work with the movehere function

Posted on 2004-08-05
5
1,023 Views
Last Modified: 2011-09-20
I am working with wscript (ADSI) and I am 'looping' because to move an user I have to rename due to a comma, but to rename I have to use the same MoveHere function...

- we created users with the following canonical name: "Smith, John"
- if we want to move the user to antother OU or rename the user with the Movehere-function, it fails due to the comma in the canonical name.... So I can't move or rename....

any help?

So the output would be like " LDAP://cn=Smith, John, OU=User, DC=mycompany, DC=com"

As you can see the comma is the problem... because the MoveHere function 'thinks' that I specify an other OU.

Any ideas how I am able to rename or move an user?

Kind Regards,

P. Keizer
(the Netherlands)

0
Comment
Question by:keizerpiet
5 Comments
 
LVL 11

Expert Comment

by:ajaikumarr
ID: 11724820
Hai,

May be i'm wrong... I havent tried it before... Just give up a try specify the user  names inside ['] sing quotes...

Will also try for you and let you know.

Bye
Ajai
0
 
LVL 11

Expert Comment

by:ajaikumarr
ID: 11725027
Hai,

Try it in this way
1. "LDAP://cn=\"Smith, John\", OU=User, DC=mycompany, DC=com"
2. "LDAP://cn='Smith, John', OU=User, DC=mycompany, DC=com"
3. "LDAP://cn=\#Smith, John, OU=User, DC=mycompany, DC=com"

Bye
Ajai
0
 
LVL 55

Expert Comment

by:Jaime Olivares
ID: 11726190
TO embed quotes inside a string you must use:

"LDAP://cn=" + chr(34) + "Smith, John" + chr(34) + ", OU=User, DC=mycompany, DC=com"
0
 
LVL 21

Accepted Solution

by:
marc_nivens earned 500 total points
ID: 11731132
All you need to do is comment the comma out with a backslash.  

LDAP://cn=Smith\, John, OU=User, DC=mycompany, DC=com
0
 

Author Comment

by:keizerpiet
ID: 11733157
Thanks to all of you, it works fine now!

The solution of marc nivens is the easiest one... but all of you: THANKS!!!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

919 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now