?
Solved

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

Posted on 2004-08-05
5
Medium Priority
?
1,036 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 2000 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

770 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