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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error on GetObject("LDAP://RootDSE")

Status
Not open for further replies.

ArmyGeek

Programmer
Nov 9, 2006
2
US
Having problem with vbs file I want to run in HTML with

sPrefix = "LDAP://"
Set oRootDSE = GetObject(sPrefix & "RootDSE")
sDNS = oRootDSE.Get("DefaultNamingContext")

Receive ActiveX Component can't create object: 'GetObject'

Saw reference in thread329-1221917 that it was a Security setting issue but no reference to the correction to overcome
 
Unfortunately the requirement is to host this on a web server to provide reporting data to requesters of the report from where ever they may be in domain made up of numerous physical locations with local domain controllers. They do not want me to distribute the reports to widely so I am controlling access to the reports with a certificate based client authentication and ACL's limiting it to specific users in the domain on a web server. Vbs is my only option at the current time. Could run it pointing to a specific domain controller, but wanted to make use of LDAP//RootDSE to limit traffic to local area network.

But the HTA does open up a lot of possibilities for me for developing capability for my System Support personnel they have been pestering for. Thanks

 
What about something like this instead.

I am new to this still so hopefully PHV could comment.

Code:
Set WSHShell = CreateObject("WScript.Shell")
set objNetwork = WScript.createObject("WScript.Network")

DomainString = objNetwork.UserDomain
UserString = objNetwork.UserName

Set UserObj = GetObject("WinNT://" & objNetwork.UserDomain & "/" & UserString)

Hope this helps.

Thanks

John Fuhrman
Titan Global Services
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top