Solved

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

Posted on 2004-08-05
5
1,024 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

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Problem to skip loop 6 57
VBA error replacing data 6 40
Using "ScreenUpdating" 6 65
VB6 ListBox Question 4 44
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…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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 utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

777 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