Spamius Posted December 12, 2008 Share Posted December 12, 2008 Hi folks, I've been using AutoIT for a while to handle some basic logon scripts and GUI interfaces. The main one I have running is a logon script which does a version check of a bespoke software package that we use which runs the update process as admin on logon if there is a new version available. The software updates are hosted on our main server and this works perfectly at the main site. However, we've recently opened a second office, and have a seperate network there which is linked to our main via a site-to-site VPN over ADSL. The problem here is that the update script runs fine on logon at the second office, but because it is doing the version check of the software and the update over the VPN, it slows the logon process at the second office to a crawl. I'm planning on sorting this by replicating the software package install to a server at the second office, but the AutoIT script itself needs to be the same on both sites, so I need a function in there to determine which site the PC belongs to when it runs the script on logon. What would be the best way to go about this? I am running a Windows2003 SBS domain, which covers 2 sites linked by a VPN. 1st site has the main server and uses the IP range 192.168.1.*, second has a backup domain controller and uses IP range 192.168.2.*,, so I was thinking of having the script check the IP address of the host computer to tell what site it is on, alternatively is there a way for AutoIT to get the NetBIOS pc name or the location info from active directory? Any help would be appreciated Thanks Link to comment Share on other sites More sharing options...
Spamius Posted December 12, 2008 Author Share Posted December 12, 2008 (edited) Ah, I've discovered the @logonserver and @LogonDNSDomain macros which seem to be a nice easy way of doing what I want - got a basic If statement calling the required update exe depending on the site logon server: CODE If @LogonServer = "\\SERVER1" Then Run("\\SERVER1\NETLOGON\Update1.exe") ElseIf @LogonServer = "\\SERVER2" Then Run ("\\SERVER2\NETLOGON\Update2.exe") EndIf Also been playing about with group policies, so should be able to set up individual logon group policies per site - will have a wee play and see which method works better Edited December 12, 2008 by Spamius Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now