I have Sql Server 2000 linked to Active Directory. From this I created a view of all the users and ADsPaths. Now in my appilcations I can query the Active Directory view and use the ADsPath to access information in Active Directory.
I want to cycle through the users and add their email address to an array if they are part of the group 'All Staff' (this will exclude resources with email addresses like confrence rooms and vehicles). Here is what I have so far:[tt]
RdrEmail = CmdEmail.ExecuteReader
While RdrEmail.Read
adUser = GetObject(RdrEmail.Item("ADsPath".GetType.ToString())
If adUser.AccountDisabled = False And adUser.Groups("All Staff" Then
Email.Add(adUser.EmailAddress)
End If
End While
RdrEmail.Close()
[/tt]
The underlined text is where I am getting a build error. The error is:[tt]Interface 'ActiveDs.IADsMembers' cannot be indexed because it has no default property.[/tt]
I have also tried [tt]adUser.Groups = "All Staff"[/tt]. From Groups you have 3 choices; Count, Filter, GetEnumerator. I searched their properties and methods as well, but haven't found anything.
How can I go about selecting users from certain groups? This would be the corner stone of setting user rights in applications
thanks for your help
Jason Meckley
Database Analyst
WITF
I want to cycle through the users and add their email address to an array if they are part of the group 'All Staff' (this will exclude resources with email addresses like confrence rooms and vehicles). Here is what I have so far:[tt]
RdrEmail = CmdEmail.ExecuteReader
While RdrEmail.Read
adUser = GetObject(RdrEmail.Item("ADsPath".GetType.ToString())
If adUser.AccountDisabled = False And adUser.Groups("All Staff" Then
Email.Add(adUser.EmailAddress)
End If
End While
RdrEmail.Close()
[/tt]
The underlined text is where I am getting a build error. The error is:[tt]Interface 'ActiveDs.IADsMembers' cannot be indexed because it has no default property.[/tt]
I have also tried [tt]adUser.Groups = "All Staff"[/tt]. From Groups you have 3 choices; Count, Filter, GetEnumerator. I searched their properties and methods as well, but haven't found anything.
How can I go about selecting users from certain groups? This would be the corner stone of setting user rights in applications
thanks for your help
Jason Meckley
Database Analyst
WITF