Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

GetObject fails

Status
Not open for further replies.

arst06d

Programmer
Nov 29, 2002
324
Hi

when I run the following:

Code:
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<TITLE></TITLE>

<%
	function getUserGroups(sUser)

	
	dim objGroup
	dim objUser
	sDomain = "SHBMAIN"
	Response.Write sUser & " - " & sDomain & "<br><br>"
	
	set objUser = GetObject("WinNT://" & sDomain & "/" & sUser ,"user")

	for each oGroup in objUser.Groups
		sGroups = sGroups & oGroup.Name & "<br>"
	Next

	response.write sGroups

	end function
%>

</HEAD>
<BODY >

<% call getUserGroups("daar01")%>

</BODY>
</HTML>

I get the following output:

Code:
daar01 - SHBMAIN


Microsoft VBScript runtime error '800a01ad' 

ActiveX component can't create object: 'GetObject' 

/david/snapshots/getusergroups.asp, line 15

It runs fine as a vbs svript on my pc, but fails in an asp on the webserver. The webserver is an old recycled NT desktop.

I'd appreciate your thoughts.
 
I'm sure that it's a permissions thing. When your code is run on the webserver, does IUSR_WEB have access to do what you need? On most webservers, then answer is no.

Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook
 
I'm sure you're right - but can you tell me which specific permissions does the anonymous user need to run the code?

Thanks

 
I think that it is the active directory - does this help


Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook
 
Apart from the permission, you have a typo problem to start with.
>[tt]set objUser = GetObject("WinNT://" & sDomain & "/" & sUser ,"user")
set objUser = GetObject("WinNT://" & sDomain & "/" & sUser & ",user")[/tt]
 
I had tried that but get
Code:
daar01 - SHBMAIN

error '800401e4' 
Invalid syntax 

/david/snapshots/getusergroups.asp, line 15
seemed to me I get further with the original syntax.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top