Avatar of Mark Eckrode
Mark Eckrode
Flag for United States of America asked on

Can I pass my http referer through my VBScript?

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

Open in new window

VB Script

Avatar of undefined
Last Comment
Mark Eckrode

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Mark Eckrode

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes