microsoft.public.adsi.general
  Home FAQ Contact Sign in
microsoft.public.adsi.general only
 
Advanced search
May 2008
motuwethfrsasuw
   1234 18
567891011 19
12131415161718 20
19202122232425 21
262728293031  22
2008
 Jan   Feb   Mar   Apr 
 May   Jun   Jul   Aug 
 Sep   Oct   Nov   Dec 
2008 2007 2006  
total
microsoft.public.adsi.general Profile…
RELATED GROUPS

POPULAR GROUPS

more...

 Up
  Adding users to active directory         


Author:
Date: May 26, 2008 07:38

Hi,

I have just started this new position and am building a web based application to add users to the active directory. The code I am using to add an account is:

Dim dirEnt As DirectoryEntry = GetDirectoryEntry(Container, ownrName, pass)
Dim users As DirectoryEntries = dirEnt.Children
Dim newuser As DirectoryEntry = users.Add("CN=" & FirstName & " " & LastName, "user")

This works perfectly fine for me and the account gets added. However when I am doing a search for all users, the filter
ds.Filter = "(&(objectCategory=Person)(objectClass=user))"
doesn't return the newly added user. I have tried varying the filter but am unable to find the user, although if I query for just the user account I am able to find it. I believe that the objectCategory on the account is not being set to "Person" but have been able to find no information on how to alter these settings.

Any help would be deeply appreciated.

Geoff
1 Comment
  IAdsGroup.members returns an empty set         


Author: Peter
Date: May 26, 2008 00:43

Hi all,

I have a piece of code (see below) which is used to retrieve all user/groups
and their members. This works fine in many network environments, except in
this network where the code was used recently. Are there any conditions
which cause the members property to be empty? The code DOES work for
BUILT_IN groups like "Administrators" and "Guests", but when a custom domain
group is retrieved, the members property stays empty. (and this problem only
occurs in one particular network). Some information:

- The user is a Domain Admin
- There are custom domain groups which have other custom domain groups as a
member.
- All the domain groups are found in the first For Each loop.
- Only the members of the BUILT_IN groups are found in the seconde For Each
loop
- Normally this code works fine, so perhaps it's caused by the network
environment
- The IAdsUser.Groups property works fine in this network (used in an other
piece of code)
Show full article (1.68Kb)
1 Comment