[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

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

Posted on 2004-08-05
5
Medium Priority
?
1,041 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

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
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…
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…
Suggested Courses

649 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