troubleshooting Question

Can I pass my http referer through my VBScript?

Avatar of Mark Eckrode
Mark EckrodeFlag for United States of America asked on
VB Script
1 Comment1 Solution287 ViewsLast Modified:
I am trying to run the below script to allow my users a one click login to Relias training that inserts their AD GUID into the link, however they require a http referer to complete the login. Whether I run this from the vbs file or launch it from a button on my intranet the referer is hidden or missing. Any ideas on how I can pass my referer or set one in the code?

Sub GUID()

' NameTranslate constants Const ADS_NAME_INITTYPE_GC = 3 Const ADS_NAME_TYPE_NT4 = 3 Const ADS_NAME_TYPE_GUID = 7

Dim strDN Dim wscript

Set wscript = CreateObject("Wscript.Shell")

' Determine the NetBIOS name of the domain and the NT name of the current user. Set objNet = CreateObject("WScript.Network") strNT4Name = objNet.UserDomain & "\" & objNet.UserName

' Use the NameTranslate object to convert the NT user name to the GUID Set objNameTranslate = CreateObject("NameTranslate")

' Initialize NameTranslate by locating the Global Catalog. objNameTranslate.Init ADS_NAME_INITTYPE_GC, ""

' Use the Set method to specify the NT format of the object name. objNameTranslate.Set ADS_NAME_TYPE_NT4, strNT4Name

' Use the Get method to retrieve the GUID string.

strDN = objNameTranslate.get(ADS_NAME_TYPE_GUID)

CreateObject("WScript.Shell").Run(http://<mycompany>.training.reliaslearning.com/clink.aspx?username="+strDN+"&ad=1")

End Sub
ASKER CERTIFIED SOLUTION
Mark Eckrode
Operations Manager

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 1 Comment.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 1 Comment.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros