- Individual Applications
Protect
Filter
Perform
Connect
Add-Ons
- Software Packages
- Complete Appliances
|
|
#1 (permalink) |
|
Untangler
Join Date: Nov 2010
Posts: 65
![]() |
I am currently running a fresh installation of 8.0 with Directory Connector. I removed the comment (Wscript.echo) so that the adlogon.vbs script echo's the information to the screen. I placed the adlogon script into a User configured Group Policy. The script runs appears to run perfectly, constantly echoing the right information to the screen. However, the Untangle Server never updates the username. Originally, Untangle was showing computername$, but when I killed the (wscript.exe) in task manager, and then manually launched the script, the username correctly updates on untangle.
It appears that Untangle get's updated if the adlogon script is manually launched, but if the script is called from either a scheduled task or a Group Policy, it does not run. Can anyone provide assistance on this? |
|
|
|
|
#2 (permalink) |
|
Master Untangler
Join Date: Mar 2010
Location: York, NE
Posts: 475
![]() |
Try adding a short delay to the front of script.
__________________
Three time Microsoft ASP.Net MVP managing an IBM System x3250 / X3440 / 8GB with Untangle 9.2 to protect 40Mbits for 450+ residential college students and associated staff and faculty |
|
|
|
|
#3 (permalink) |
|
Untangler
Join Date: Nov 2010
Posts: 65
![]() |
such as?..
Code:
'Handle or Ignore all errors
WScript.sleep(2000)
On Error Resume Next
'Time in milliseconds to sleep between request 60000=1min
SLEEP_PERIOD = 60000
URL_PREFIX = "http"
If WScript.Arguments.Count = 1 Then
ServerName = WScript.Arguments.Item(0)
Else
ServerName = "firewall.invotec.com"
End If
'WScript.Echo "ServerName is:"
'WScript.Echo ServerName
Do While True
Set AJAX = CreateObject("MSXML2.ServerXMLHTTP")
Set wshShell = CreateObject("WScript.Shell")
strUser = wshShell.ExpandEnvironmentStrings("%USERNAME%")
strDomain = wshShell.ExpandEnvironmentStrings("%USERDOMAIN%")
strHostname = wshShell.ExpandEnvironmentStrings("%COMPUTERNAME%")
command = URL_PREFIX+"://"+ServerName+"/adpb/registration?username="+strUser+"&domain="+strDomain+"&hostname="+strHostname+"&action=login"
'WScript.Echo command
AJAX.Open "GET", command
AJAX.Send ""
WScript.sleep(SLEEP_PERIOD)
AJAX.Abort
Set AJAX = nothing
Loop
|
|
|
|
|
#6 (permalink) |
|
Untangler
Join Date: Nov 2010
Posts: 65
![]() |
When I turn the echo on, this is the response that I get, I assume that this is correct?
--------------------------- Windows Script Host --------------------------- Code:
http://adlogon_user.vbs/adpb/registration?username=testuser&domain=DOMAINBLAH&hostname=BLAH-11&action=login OK --------------------------- Last edited by techuser; 11-23-2010 at 02:05 PM.. |
|
|
|
|
#7 (permalink) |
|
Untangle Junkie
![]() Join Date: Nov 2006
Location: San Mateo, CA
URLs submitted: 10
Posts: 10,611
![]() |
adlogon_user.vbs is your hostname?
That doesn't look right.
__________________
Attention: Support and help on the Untangle Forums is provided by volunteers and community members like yourself. If you need Untangle support please call or email support@untangle.com |
|
|
|
|
#8 (permalink) |
|
Untangler
Join Date: Nov 2010
Posts: 65
![]() |
I hard coded the script for the ServerName instead of using the variable. The Group Policy Logon Script appears to work now. I don't understand why the variable didn't work when executed from a Group Policy opposed to manually be ran though?
WORKS --------------------------- Windows Script Host --------------------------- Code:
http://firewall.company.com/adpb/registration?username=testuser&domain=COMPDOMAIN&hostname=BLAH-11&action=login OK --------------------------- DOESN’T WORK --------------------------- Windows Script Host --------------------------- Code:
http://adlogon_user.vbs/adpb/registration?username=testuser&domain=COMPDOMAIN&hostname=BLAH-11&action=login OK --------------------------- HARD CODED SCRIPT NOW WORKS --------------------------- Windows Script Host --------------------------- Code:
http://firewall.company.com/adpb/registration?username=testuser&domain=COMPDOMAIN&hostname=BLAH-11&action=login OK --------------------------- Code:
'Handle or Ignore all errors
Dim objWMI: Set objWMI = GetObject("winmgmts://./root/cimv2")
Set colProcess = objWMI.ExecQuery ("Select * from Win32_Process Where Name='cscript.exe'")
WScript.sleep(2000)
On Error Resume Next
'Time in milliseconds to sleep between request 60000=1min
SLEEP_PERIOD = 60000
URL_PREFIX = "http"
If WScript.Arguments.Count = 1 Then
ServerName = WScript.Arguments.Item(0)
Else
ServerName = "firewall.company.com"
End If
'WScript.Echo "ServerName is:"
'WScript.Echo ServerName
Do While True
Set AJAX = CreateObject("MSXML2.ServerXMLHTTP")
Set wshShell = CreateObject("WScript.Shell")
strUser = wshShell.ExpandEnvironmentStrings("%USERNAME%")
strDomain = wshShell.ExpandEnvironmentStrings("%USERDOMAIN%")
strHostname = wshShell.ExpandEnvironmentStrings("%COMPUTERNAME%")
command = URL_PREFIX+"://firewall.company.com/adpb/registration?username="+strUser+"&domain="+strDomain+"&hostname="+strHostname+"&action=login"
WScript.Echo command
AJAX.Open "GET", command
AJAX.Send ""
WScript.sleep(SLEEP_PERIOD)
AJAX.Abort
Set AJAX = nothing
Loop
|
|
|
|
|
#10 (permalink) |
|
Untangler
Join Date: Nov 2010
Posts: 65
![]() |
Well, the script get's an invalid parameter when running as a Group Policy Logon property. If running the script manually, the script seems to run perfectly with no problems and get's the correct parameter.
I am suspicious about the "WScript.Arguments.Count causing a problem?, because the variable should work in my opinion, not sure how the ServerName variable is getting changed to the name of the file. |
|
|
![]() |
| Thread Tools | |
|
|