Jump to content

Recommended Posts

Posted

I am trying to give staff access to internet on their school laptops at home but am running in to a problem. I have experimented with vbs scripts and with pac files and have since decided I prefer the proxy pac method.

IE6 with all latest updates installed and used in all instances;

So, here is my proxy code (I have replaced my domain with 'mydomain' in all parts of this post)

function FindProxyForURL(url, host) 
{ 
if (
	!isInNet(myIpAddress(), "10.112.0.0", "255.255.0.0") ||
	isInNet(host, "10.112.0.0", "255.255.0.0") ||
	dnsDomainIs(host, ".mydomain.local") ||
	isPlainHostName(host) ||
	shExpMatch(host, "*portal.mydomain.com*")
)
return "DIRECT";

return "PROXY myproxy:8080"; 
} 

 

This works flawlessly at home with one exception - the school OWA (may be worth noting that I had the same problem when using a VBS script also).

https://mail.mydomain.com/owa returns a 404 page (not expected)

https://mail.mydomain.com/ returns a default IIS page (expected)

http://mail.mydomain.com/owa returns the page saying can only be accessed with https etc (expected)

https://99.99.99.99/ returns default IIS page (expected)

https://99.99.99.99/owa gives me email working perfectly (expected)

 

nslookup resolves IP address correctly for OWA external address

 

I have checked that hosts file does not contain any entries for 'mydomain', I have checked intranet/restricted/trusted zones in IE and mydomain is not listed.

Exchange 2007 installed on Server 2003 Enterprise

 

Any other information I'm missing?

Anyone come across this anomaly? Have I missed something very obvious?

Posted

None of you guys have any idea about this problem? If someone there is thinking 'duh this is so obvious but I will spare this guys shame by letting him work it out himself', please put me out of my misery :)

 

Alternatively - did I post in the wrong section perhaps? :)

Posted

@Geoff - I had not expected the problem to be with the proxy.pac file, I posted it rather than just stating 'I use a pac file' and having people reply that I should include it in original message :)

 

@fafster - I would prefer not to upgrade to IE7 at least not for the timebeing

 

Any other suggestions?

  • 2 weeks later...
Posted

I thought this would work too, but tried it and was unsuccessful. Later I realised it makes sense that this change shouldn't work since;

 

https://mail.mydomain.com/owa returns a 404 page (not expected)

https://mail.mydomain.com/ returns a default IIS page (expected)

 

I just cannot understand why I'm having this problem, I've spent some time hunting through the registry and the only references to /owa are inside recently visited websites etc.

I have looked at trusted/intranet zones and been playing around in here to see if this has anything to do with it but I can't understand why it should anyway.

Posted
we basically have 2 shortcuts to reg keys that change the proxy... at school if they forget to do it the firewall is set to only allow internet access via the proxy... they soon remember...
Posted
tell em to use firefox at home to avoid proxy issues?

 

We do not want to allow staff to change proxies themselves, they inevitably get it wrong and cry that nothing works. It would also allow them to use a parent proxy instead of our inhouse proxies.

Posted
we basically have 2 shortcuts to reg keys that change the proxy... at school if they forget to do it the firewall is set to only allow internet access via the proxy... they soon remember...

 

It doesn't appear to be a fault of the proxy settings anyway, as even taking out all proxy information when at home still has this oddity when connecting to OWA through IE.

Posted

I created a very simple AutoIT script with a dialog box to switch the proxy on and off. All it does is toggle the "Use a proxy server" tickbox so you'll need to set the proxies up before use.

 

Disclaimer: This is my own homebrew work, thrown together when a teacher asked if it could be done. It has been tested but I am not responsible for use / misuse / computer catches fire. etc.

proxy.zip

  • Thanks 1
Posted
I created a very simple AutoIT script with a dialog box to switch the proxy on and off. All it does is toggle the "Use a proxy server" tickbox so you'll need to set the proxies up before use.

 

Disclaimer: This is my own homebrew work, thrown together when a teacher asked if it could be done. It has been tested but I am not responsible for use / misuse / computer catches fire. etc.

 

I just played with the script and it works a treat. Thanks. I'm off to the autoit site to have a play. :D

Posted (edited)
does it work correctly when your trying to use a not networked PC?

 

or just OWA doesn't work on any PC not in your network?

 

This only happens using a teacher laptop at home, any other computer (not a member of the domain) will access it fine, just as any domain PC (including teacher laptop) has no issue connecting when on the school's network.

 

To re-emphasise the point, I do not expect any problem to be with my script, or whether proxy is turned on/off but rather I believe some other function somewhere is confusing the matter.

I do appreciate the efforts so far, and perhaps I have not explained the difficulty very well - which is part of the reason I have had no success in 'googleing' this problem.

 

 

https://domainname/ resolves but shows page not found (regardless of location)

https://ipaddress/ shows page not found (regardless of location)

http://domainname/ tells me i must use https (regardless of location)

http://ipaddress/ tells me i must use https (regardless of location)

http://domainname/owa tells me i must use https (regardless of location)

http://ipaddress/owa tells me i must use https (regardless of location)

https://ipaddress/owa displays fine (regardless of location)

 

https://domainname/owa displays on laptop when in school, displays on all PCs outside of school. However, teacher laptops (members of the school domain), when not connected to the school domain, are unable to get this page (and it has just occurred to me I need to double check the response code, but is either blank or 404 I'm sure).

Edited by itwasntme
Posted
I suspect it's something to do with IIS. Have you checked the configuration of that?

 

I've looked through it but I cannot imagine what would be wrong here, I mean, if it works without a problem when on the school network, and on home PCs, yet not on a domain pc on home network, what would I expect to find fault with in IIS?

Posted
We do not want to allow staff to change proxies themselves, they inevitably get it wrong and cry that nothing works. It would also allow them to use a parent proxy instead of our inhouse proxies.

 

yes yes thats what happens here. we say leave IE alone with our settings in and install firefox which wont have any proxy settings in.

 

are you saying no proxy settings would work at school?

Posted
yes yes thats what happens here. we say leave IE alone with our settings in and install firefox which wont have any proxy settings in.

 

are you saying no proxy settings would work at school?

 

They could enter an alternative LEA proxy which would bypass our logging proxy.

 

I think I may have got it sorted out, by messing around with intranet zone info, I'll post when I'm sure.

  • 1 month later...
Posted
I created a very simple AutoIT script with a dialog box to switch the proxy on and off. All it does is toggle the "Use a proxy server" tickbox so you'll need to set the proxies up before use.

 

Disclaimer: This is my own homebrew work, thrown together when a teacher asked if it could be done. It has been tested but I am not responsible for use / misuse / computer catches fire. etc.

Hi,

 

Was just working on something similar using Autoit when I stumbled across your posting. Can I suggest adding in the code below, (incomplete, but you get the idea). That way the complied script can be put in the logon script / Start folder, so that no user interaction is required.

 

Begin Code ================

 

$ip = Stringmid(@IPAddress1,1,8)

 

if $IP = "192.168." Then

MsgBox ( 0, "WSA Location Finder", "You are on the LAN")

call ("SetLanProxy")

Else

MsgBox ( 0, "WSA Location Finder", "You are somewhere else")

call ("SetNoProxy")

EndIf

 

exit

 

Func SetLanProxy()

;Check IE is closed

;~ HttpSetProxy ( 2, "192.168.3.4:8080" )

EndFunc

 

Func SetNoProxy()

;Check IE is closed

;~ HttpSetProxy ( 1, "192.168.3.4:8080" )

EndFunc

 

END CODE==================

 

My logic with this code is that our DHCP server hands out 192.168.* addresses, and a home networks tend not to (big assumption I am sure!). So the script runs, see's if it has a DHCP IP, if it does, it must be on the lan so runs the appropriate .reg files.

 

Anyway hope this is helpful. This is my first ever post in EduGeek forums and hope the posting of code is OK.

 

Richard.

Posted
Hi,

 

 

My logic with this code is that our DHCP server hands out 192.168.* addresses, and a home networks tend not to (big assumption I am sure!). So the script runs, see's if it has a DHCP IP, if it does, it must be on the lan so runs the appropriate .reg files.

 

Anyway hope this is helpful. This is my first ever post in EduGeek forums and hope the posting of code is OK.

 

Posting code is fine, but you might want to use the code tags in the post editor to keep the formatting nice.

 

As for the idea of going off IP address, I think you might be safer trying to ping a specific IP address on your network as that's much less likely to give a false positive than going off 192.168.* which many home routers will be dishing out.

 

Rob van der Woude's awesome site has this handy code snippet for testing if a server is pingable in a batch:

 

 

A well known way to check if a server is still "on the air" is


PING server | FIND "TTL=" >NUL
IF ERRORLEVEL 1 ECHO Error pinging server

In Windows 95/98/NT this will result in 4 tries from PING to detect the presence of server.
When checking large amounts of servers, some time could be saved by a fast check, followed by a more thorough check only when the first check fails.


PING server -n 1 | FIND "TTL=" >NUL
IF NOT ERRORLEVEL 1 GOTO Next
PING server -w 3000 | FIND "TTL=" >NUL
IF ERRORLEVEL 1 ECHO Error pinging server
:Next

 

HTH!

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 account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...