By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,089 Members | 1,507 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,089 IT Pros & Developers. It's quick & easy.

How to know when user has been created in the AD?

P: n/a
Hi, I'm building a C#-application that will simplify my daily work
(adding/removing/updating users in the AD). I'm using functions from
the System.DirectoryServices-namespace. When I have added a user I
want to set user-rights on a folder (which I create in my
application). The problem is that it takes a while until the user has
been added to the AD. If I just go on with setting the user-rights on
the folder I get an exception telling me there's no such user and
everything fails. I would like to know the best way to know when the
user has been added to the AD so I can go on with setting the user-
rights. Polling the AD seems like a bad idea (lots of overhead?).
Right now I'm using a 5 second delay between the user-creation and
setting the user-rights, I know that's a bad idea too, but at least
I'm not generating lots of queries to the AD.

Sep 19 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
The overhead of polling the AD is probably fairly insignificant - when you
create a user in code you should be able to get a GUID back when the user is
created to determine whether your code can continue or not,

See the examples here:
http://www.codeproject.com/cs/system...ingInAD.asp#40

Regards

John Timney (MVP)
http://www.johntimney.com
http://www.johntimney.com/blog
"irrbloss" <ir******@gmail.comwrote in message
news:11**********************@k79g2000hse.googlegr oups.com...
Hi, I'm building a C#-application that will simplify my daily work
(adding/removing/updating users in the AD). I'm using functions from
the System.DirectoryServices-namespace. When I have added a user I
want to set user-rights on a folder (which I create in my
application). The problem is that it takes a while until the user has
been added to the AD. If I just go on with setting the user-rights on
the folder I get an exception telling me there's no such user and
everything fails. I would like to know the best way to know when the
user has been added to the AD so I can go on with setting the user-
rights. Polling the AD seems like a bad idea (lots of overhead?).
Right now I'm using a 5 second delay between the user-creation and
setting the user-rights, I know that's a bad idea too, but at least
I'm not generating lots of queries to the AD.

Sep 19 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.