473,387 Members | 2,436 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 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 1395
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.