Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1
    Untangler
    Join Date
    Jan 2011
    Location
    Recife - PE, Brazil
    Posts
    70

    Smile Automated AD Login for Untangle

    I don't like to work with the AD Login Script, because if several users are logged in into the same workstation (changing user without logging out), all AD Scripts are running and are concurrently logging in at the same time.

    So I created a little Application, wich does the following:

    1. Login while program started
    2. Logout while program ending
    3. Changing windows user will Logout locked user and login new user
    4. Login/Logout with RemoteControl User works in the same manner
    5. Periodically check if current session user still logged in.

    Settings:
    - Hostname, Username, Domain name are given by environment variables
    - Default Gateway is defined as Captive Portal Untangle Server
    - Default value for checking interval is 60 seconds.

    All this settings can be overwritten by the
    UntangleADLogin.ini File wich has to be placed in the same directory as UntangleADLogin.exe

    Sample:
    [Untangle]
    Server=IP or Domainname of Untangle server
    User=...
    Domain=XYZ.COM
    Client=Client Computer name

    ; Timeinterval to check if user still logged in.
    Interval=60000

    This Application has no GUI and will be visible in task manager only!

    Please install the adautologin.jsp into the following directory on your Untangle Box:
    /usr/share/untangle/web/adpb

    Feel free to use the Source Code to modify the program. Its written in Delphi XE.

    The program is downloadable from my homepage, because its 600kb which is more then the allowed ZIP attachment size in this forum:

    http://www.seelig-family.ch/files/UntangleADLogin.zip

    Have Fun!

    Michael


    P.S. This program release works only with Untangle 9.0.1, because some classes in Captive Portal were renamed.

  2. #2
    Untangle Ninja Mathiau's Avatar
    Join Date
    Feb 2008
    Location
    Costa Frickn' Rica
    Posts
    1,630

    Default

    nice work, curious, how was it you did this part

    3. Changing windows user will Logout locked user and login new user

    ?
    kv-2 | UT 11.0.1 | Dell R610 Server | Intel Xeon 2.8Ghz Quad Cores | 24Gb DDR3 ECC | 1 Intel QPort NIC | Integrated Broadcom QP | Dell Perc 4i | 6 x 73G 2.5 15k SAS raid 10 | 100mb/100mb | 30mb/30Mb

  3. #3
    Untangle Ninja jcoehoorn's Avatar
    Join Date
    Mar 2010
    Location
    York, NE
    Posts
    1,943

    Default

    @Mathiau - it's an actual program that runs in the background.
    Five time Microsoft ASP.Net MVP managing a Lenovo RD330 / E5-2420 / 16GB with Untangle 16.5 to protect a 1Gbps fiber link for ~450 residential college students and associated staff and faculty

  4. #4
    Untangler
    Join Date
    Jan 2011
    Location
    Recife - PE, Brazil
    Posts
    70

    Default

    Quote Originally Posted by Mathiau View Post
    nice work, curious, how was it you did this part

    3. Changing windows user will Logout locked user and login new user

    ?
    The program registers a windows api listener to get the information from thr operating system, whenever the user is logged in/out, locked... In the link above you have the running program but also the source coded in Delphi XE, if you are familiary in programming, you will understand the code ease.

    Michael

  5. #5
    Master Untangler
    Join Date
    Dec 2008
    Posts
    121

    Default

    Does this require captive portal be in use?
    Or can it work without the captive portal?
    Premium Packaged

  6. #6
    Untangle Ninja Mathiau's Avatar
    Join Date
    Feb 2008
    Location
    Costa Frickn' Rica
    Posts
    1,630

    Default

    good to know, was just curious, i have an issue with some staff not logging out and this syncing their roaming profiles with our server all the time, i looked into automated log off scripts, this just seemed like another option.
    kv-2 | UT 11.0.1 | Dell R610 Server | Intel Xeon 2.8Ghz Quad Cores | 24Gb DDR3 ECC | 1 Intel QPort NIC | Integrated Broadcom QP | Dell Perc 4i | 6 x 73G 2.5 15k SAS raid 10 | 100mb/100mb | 30mb/30Mb

  7. #7
    Untangler
    Join Date
    Jan 2011
    Location
    Recife - PE, Brazil
    Posts
    70

    Default

    @otis: I didn't checked it out before you asked :-), but yes with a little change it will work perfect. If using with captive portal my logout call is http://untanglebox/users/logout, without cp i have to call http://untanglebox/adpb/registration...&action=logout

    my tests worked very well, so I will enable the app, to define if you like to work with/without cp.

    Michael

  8. #8
    Untangler
    Join Date
    Jan 2011
    Location
    Recife - PE, Brazil
    Posts
    70

    Default

    @mathiau: If your users are not logon the same computer with different logins at the same time, the logoff script will work well for you:
    Code:
    'Handle or Ignore all errors
    On Error Resume Next
    
    URL_PREFIX = "http"
    
    ServerName = "untangleservername
    
    Set AJAX = CreateObject("MSXML2.ServerXMLHTTP")
    Set wshShell = CreateObject("WScript.Shell")
    strUser = wshShell.ExpandEnvironmentStrings("%USERNAME%")
    strDomain = wshShell.ExpandEnvironmentStrings("%USERDOMAIN%")
    strHostname = wshShell.ExpandEnvironmentStrings("%COMPUTERNAME%")
    
    ' you have only to run one of the following commands, depending if you work with/without captive portal.
    
    ' if you are working with captive portal use this command
    command = URL_PREFIX+"://"+ServerName+"/users/logout"
    AJAX.Open "GET", command
    AJAX.Send ""
    
    ' if you are working with AD Connector only, run this command
    command = URL_PREFIX+"://"+ServerName+"/adpb/registration?
    username="+strUser+"&domain="+strDomain+"&hostname="+strHostname+"&action=logout"
    AJAX.Open "GET", command
    AJAX.Send ""
    
    AJAX.Abort 
    Set AJAX = nothing
    Michael

  9. #9
    Master Untangler
    Join Date
    Dec 2008
    Posts
    121

    Default

    Quote Originally Posted by mseelig View Post
    @otis: I didn't checked it out before you asked :-), but yes with a little change it will work perfect. If using with captive portal my logout call is http://untanglebox/users/logout, without cp i have to call http://untanglebox/adpb/registration...&action=logout

    my tests worked very well, so I will enable the app, to define if you like to work with/without cp.

    Michael

    That would be awesome if you could do that. I do have issues with laptop users without the CP but they have not wanted me to try it.
    Thanks for sharing a great hack.
    Premium Packaged

  10. #10
    Untangler
    Join Date
    Jan 2011
    Location
    Recife - PE, Brazil
    Posts
    70

    Default

    Quote Originally Posted by otis View Post
    That would be awesome if you could do that. I do have issues with laptop users without the CP but they have not wanted me to try it.
    Thanks for sharing a great hack.
    Because you talked about laptops, i think I will extend the program, so that you can define, which gateway you are using in the office, so the app will only to try login/logout inside the company net.

    Michael

Page 1 of 2 12 LastLast

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

SEO by vBSEO 3.6.0 PL2