Solved

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

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
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…
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…

763 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

7 Experts available now in Live!

Get 1:1 Help Now