I am trying to do a query to active directory with the following code:
but I always get error '80072020'
at this line of code: Set oUser = GetObject("LDAP://" & sysInfo.Username)
I do not use anonymous access in IIS and am using Windows Authentication.
How do I get around this problem?
public function authorizeUser()
Dim sysInfo, oUser
ok = false
Set sysInfo = CreateObject("ADSystemInfo")
Set oUser = GetObject("LDAP://" & sysInfo.Username)
for each oGroupName in oUser.memberOf
group = left(oGroupName,instr(oGroupName,",")-1)
group = right(group, len(group) - 3)
if group = "Adminstrators" then
ok = true