Hi everyone. I am in the midst of moving our Intranet system from Windows NT to Windows 2000. (I know, I know.) I am a web programmer, not a network admin. Our old Windows NT Intranet was relying on a dll called NTUtils to get a list of groups. On the new system, I want to use the abilities built into VBScript.
I'm new to the terms ADSI, LDAP, and the WINNT provider of ADSI.
For a week, I've gotten nothing but errors. I've cut and pasted and tweaked scripts from the Microsoft script archive, O'Reilly, etc. and read up as much as I could. Nothing seems to works. But the closest I've come is MrNiceGuy's explanation of LDAP in thread329-731498.
When I do this:
Dim strGroups
'Bind to Active Directory System Info
Set AdsSysteminfo = CreateObject("adsysteminfo")
'Bind to the currently logged on user.
Set UserObj= Getobject("LDAP://" & adsSysteminfo.UserName)
'display the Ldap Path of the OU the user is in. (it's parent)
strGroups = UserObj.Parent
session("Groups") = lcase(strGroups)
It correctly returns the ldap path of the parent. It's beautiful. Music to my eyes. But when I take it a step farther:
'get list of groups from login name
Dim strGroups
'Bind to Active Directory System Info
Set AdsSysteminfo = CreateObject("adsysteminfo")
'Bind to the currently logged on user.
Set UserObj= Getobject("LDAP://" & adsSysteminfo.UserName)
'display the Ldap Path of the OU the user is in. (it's parent)
strGroups = UserObj.Parent
'bind to the OU.
Set OUobj=GetObject(strGroups)
'display the name of the OU. after removing the "OU="
strGroups = replace(OUobj.name,"OU=","")
session("Groups") = lcase(strGroups)
I get error '8007200a' and the line number it complains about is the one: Set OUobj=GetObject(strGroups)
My goal (and the reason my variable is named strGroups) is to store a list of all a user's groups, comma-delimited, in a session variable for an ASP application. This code is going in my global.asa file. The site is set up in IIS so that the users have to login. I can get their login name from this. (str = Request.ServerVariables("Auth_USER")). The Intranet relies heavily on this list of groups. The way we give people authority to use certain pages is by placing them in a group.
Thanks in advance, and for the help I've already gotten. I feel like I understand more about this after a couple of hours in this forum than after a week of surfing the web in general.
I'm new to the terms ADSI, LDAP, and the WINNT provider of ADSI.
For a week, I've gotten nothing but errors. I've cut and pasted and tweaked scripts from the Microsoft script archive, O'Reilly, etc. and read up as much as I could. Nothing seems to works. But the closest I've come is MrNiceGuy's explanation of LDAP in thread329-731498.
When I do this:
Dim strGroups
'Bind to Active Directory System Info
Set AdsSysteminfo = CreateObject("adsysteminfo")
'Bind to the currently logged on user.
Set UserObj= Getobject("LDAP://" & adsSysteminfo.UserName)
'display the Ldap Path of the OU the user is in. (it's parent)
strGroups = UserObj.Parent
session("Groups") = lcase(strGroups)
It correctly returns the ldap path of the parent. It's beautiful. Music to my eyes. But when I take it a step farther:
'get list of groups from login name
Dim strGroups
'Bind to Active Directory System Info
Set AdsSysteminfo = CreateObject("adsysteminfo")
'Bind to the currently logged on user.
Set UserObj= Getobject("LDAP://" & adsSysteminfo.UserName)
'display the Ldap Path of the OU the user is in. (it's parent)
strGroups = UserObj.Parent
'bind to the OU.
Set OUobj=GetObject(strGroups)
'display the name of the OU. after removing the "OU="
strGroups = replace(OUobj.name,"OU=","")
session("Groups") = lcase(strGroups)
I get error '8007200a' and the line number it complains about is the one: Set OUobj=GetObject(strGroups)
My goal (and the reason my variable is named strGroups) is to store a list of all a user's groups, comma-delimited, in a session variable for an ASP application. This code is going in my global.asa file. The site is set up in IIS so that the users have to login. I can get their login name from this. (str = Request.ServerVariables("Auth_USER")). The Intranet relies heavily on this list of groups. The way we give people authority to use certain pages is by placing them in a group.
Thanks in advance, and for the help I've already gotten. I feel like I understand more about this after a couple of hours in this forum than after a week of surfing the web in general.