472,971 Members | 1,923 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,971 software developers and data experts.

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

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
1 1373
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Ian Davies | last post by:
Hello I am trying to run a few INSERT queries only if the user clicks 'continue' in a <a href> The queries takes variables created from SELECT queries. I have tried to acheive this by putting The...
1
by: Del | last post by:
We have a MS SQL Server 2000 application for our shipping system. We have created a front end application using MS Access for our order analyst. The front end application allows the analyst to...
2
by: David Krussow | last post by:
The 2nd parameter of the method controls whether a persistent cookie is created - so that ASP.NET can "know" if the current user has been previously authenticated (during previous browser...
161
by: KraftDiner | last post by:
I was under the assumption that everything in python was a refrence... so if I code this: lst = for i in lst: if i==2: i = 4 print lst I though the contents of lst would be modified.....
37
by: jht5945 | last post by:
For example I wrote a function: function Func() { // do something } we can call it like: var obj = new Func(); // call it as a constructor or var result = Func(); // call it as...
25
by: Andy_Khosravi | last post by:
I just recently changed my database that I'm running from a monolithic DB to a split FE/BE. The front end resides on the client machine and the BE resides on a network drive. I'm experimenting with...
4
by: mohaaron | last post by:
I can think of a lot of reasons why this might need to be done but as far as I can tell it's not possible. I've been looking for a way to add HtmlTableRows to a table using a button click for a...
10
by: happyse27 | last post by:
Hi All, I got this apache errors(see section A1 and A2 below) when I used a html(see section b below) to activate acctman.pl(see section c below). Section D below is part of the configuration...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
3
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.