Hi, this is probably a little bit off the standards. I'm using something calles Active Roles Server which is a web interface application where one can connect to AD through the web service.
But you need to program alot of the features yourself and I'm in need of getting an extract of each group which are members of a certain computer object. The language is some kinf of Visual Basic, but the developers have created their own SDK. But the similaritities are very clear to standard Visual Basic. Perhaps somebody understand what I should alter in the code to query memberships of a computer object instead of a user object.
The computer object is set through the value of a textbox. In other words, the user himself types in the name of his own computer in a text box. And after the changes have been saved, then the rest of the code uses the value to build the string to the actual computer object in AD.
What I need is some help constructing the function getting this information.
I already have a function which find group memberships of the user I'm currently browsing in the web interface. But I can't figure out how the system knows which object to bind to. If it could be possible to override the object type somehow? This is the code as it is today. Remember, it only picks up group memberships of the user I'm currently browsing in the web interface.
Function IsGroupPresent (ByVal arrGroups, ByVal strGroup)
IsGroupPresent = False
For Each strMemberOf in arrGroups
If strMemberOf = strGroup Then
IsGroupPresent = True
Next
End function
Then we have the code in the event handler:
Call Request.AddRequestedAttribute("memberOf")
Dim arrMemberOf : arrMemberOf = Request.GetEx("memberOf")
Dim strSelectedComputer
strSelectedComputer = CStr(Request.Get("TextField_RequestedComputer")
If IsGroupPresent(arrMemberOf, "CN=blablabla") = True Then
'Perform some action
Else
'Do something else
End If