Old 11-23-2010, 12:42 PM   #1 (permalink)
Untangler
 
Join Date: Nov 2010
Posts: 65
techuser is on a distinguished road
Default Windows 7 & 2008, returning hostname only

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?
techuser is offline  
Old 11-23-2010, 01:01 PM   #2 (permalink)
Master Untangler
 
jcoehoorn's Avatar
 
Join Date: Mar 2010
Location: York, NE
Posts: 475
jcoehoorn is on a distinguished road
Default

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
jcoehoorn is offline  
Old 11-23-2010, 01:25 PM   #3 (permalink)
Untangler
 
Join Date: Nov 2010
Posts: 65
techuser is on a distinguished road
Default

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
techuser is offline  
Old 11-23-2010, 01:28 PM   #4 (permalink)
Untangler
 
Join Date: Nov 2010
Posts: 65
techuser is on a distinguished road
Default

did not work, Task Manager shows script running, but untangle is not updating.
techuser is offline  
Old 11-23-2010, 01:43 PM   #5 (permalink)
Untangler
 
Join Date: Nov 2010
Posts: 65
techuser is on a distinguished road
Default

Is there any log files stored anywhere to see why Untangle is only showing the computername?
techuser is offline  
Old 11-23-2010, 02:02 PM   #6 (permalink)
Untangler
 
Join Date: Nov 2010
Posts: 65
techuser is on a distinguished road
Default

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..
techuser is offline  
Old 11-23-2010, 02:16 PM   #7 (permalink)
Untangle Junkie
 
dmorris's Avatar
 
Join Date: Nov 2006
Location: San Mateo, CA
URLs submitted: 10
Posts: 10,611
dmorris is on a distinguished road
Default

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
dmorris is offline  
Old 11-24-2010, 05:18 AM   #8 (permalink)
Untangler
 
Join Date: Nov 2010
Posts: 65
techuser is on a distinguished road
Default Hard coded the path seems to work.

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
techuser is offline  
Old 11-24-2010, 05:32 AM   #9 (permalink)
Master Untangler
 
Join Date: Aug 2008
URLs submitted: 2
Posts: 442
Danp is on a distinguished road
Default

Looks like you are calling the script with an invalid parameter (adlogon_user.vbs).
Danp is online now  
Old 11-24-2010, 06:46 AM   #10 (permalink)
Untangler
 
Join Date: Nov 2010
Posts: 65
techuser is on a distinguished road
Default

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.
techuser is offline  
Closed Thread

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -7. The time now is 04:39 AM.


© 2010 Untangle, Inc. All Rights Reserved.   SEO by vBSEO 3.6.0 PL2