<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>The PhenixbluE &#187; Client Management</title>
	<atom:link href="http://phenix.thephenixblue.com/category/computers/client-management/feed/" rel="self" type="application/rss+xml" />
	<link>http://phenix.thephenixblue.com</link>
	<description>Bringing Nonsense to the Masses since 2003!</description>
	<lastBuildDate>Wed, 16 Feb 2011 18:49:19 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Batch Script for IE &amp; Firefox proxies</title>
		<link>http://phenix.thephenixblue.com/2009/10/batch-script-for-ie-firefox-proxies/</link>
		<comments>http://phenix.thephenixblue.com/2009/10/batch-script-for-ie-firefox-proxies/#comments</comments>
		<pubDate>Thu, 01 Oct 2009 13:00:29 +0000</pubDate>
		<dc:creator>Phenix</dc:creator>
				<category><![CDATA[Client Management]]></category>
		<category><![CDATA[Computers]]></category>
		<category><![CDATA[browser]]></category>
		<category><![CDATA[management]]></category>
		<category><![CDATA[proxy]]></category>

		<guid isPermaLink="false">http://phenix.thephenixblue.com/?p=513</guid>
		<description><![CDATA[So, in the many endeavors I pursue at work for needless reasons, here&#8217;s something I hope someone else benefits from. We tend to lock down access on machines that are in public places, or have more than a few users. As we&#8217;re not quite fully migrated over to Microsoft Active Directory, and can&#8217;t manage Group [...]]]></description>
			<content:encoded><![CDATA[<p>So, in the many endeavors I pursue at work for needless reasons, here&#8217;s something I hope someone else benefits from. We tend to lock down access on machines that are in public places, or have more than a few users. As we&#8217;re not quite fully migrated over to Microsoft Active Directory, and can&#8217;t manage Group Policy, theres no easy way to centrally manage browser proxy settings. We use browser proxy settings to limit the websites end users have access to on a machine ( to circumvent many wasted hours of cleaning up virus, spyware, and other junk). Browser proxy setting are super easy to mange with a .PAC file. IE can be managed by both a .INS and a .PAC file, but I&#8217;ve found the .PAC is more compliant throughout the majority of mainstream web browsers. We store a &#8220;restrict.pac&#8221; file on a web server to serve out proxy settings for IE and firefox to minimize the need to touch individual machines to add url&#8217;s to the the exception list. We just edit the one .PAC file and all machines configured to read that file are automatically updates (once the browser is restarted!). The problem is, we still have to touch each machine to setup the initial configuration to read the &#8220;restrict.pac&#8221; to auto configure the proxy settings. I recently developed a batch file that will setup both (IE and Firefox) browsers to use the &#8220;restrict.pac&#8221; file for proxy auto config settings. I haven&#8217;t had time to add conditionals if files already exist, but the script has been tested, and it doesn&#8217;t really matter if the files already exist in our environment. Feel free to use the code, and modify it in any way. If you find yourself needing something a little different, please comment. If you add to it, let me know! Here you go:</p>
<h3>restrict.pac contents:</h3>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>Store info <span style="color: #000000; font-weight: bold;">in</span> variables <span style="color: #000000; font-weight: bold;">for</span> clean code
var ALLOWED = <span style="color: #ff0000;">&quot;DIRECT&quot;</span>;
<span style="color: #000000; font-weight: bold;">//</span><span style="color: #000000; font-weight: bold;">set</span> the proxy server you want to redirect to
var DISALLOWED = <span style="color: #ff0000;">&quot;PROXY services.valdosta.edu:80&quot;</span>;
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> FindProxyForURL<span style="color: #7a0874; font-weight: bold;">&#40;</span>url, host<span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #7a0874; font-weight: bold;">&#123;</span>
<span style="color: #000000; font-weight: bold;">//</span>Add all exceptions <span style="color: #000000; font-weight: bold;">for</span> pages <span style="color: #c20cb9; font-weight: bold;">users</span> need to hit here
&nbsp;
<span style="color: #000000; font-weight: bold;">//</span>all VSU pages
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>shExpMatch<span style="color: #7a0874; font-weight: bold;">&#40;</span>url,<span style="color: #ff0000;">&quot;*valdosta.edu/*&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #7a0874; font-weight: bold;">return</span> ALLOWED;<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">//</span>1Card online card office
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>shExpMatch<span style="color: #7a0874; font-weight: bold;">&#40;</span>url,<span style="color: #ff0000;">&quot;*blackboard.com/*&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #7a0874; font-weight: bold;">return</span> ALLOWED;<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">//</span>Bookstore e-commerce stuff
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>shExpMatch<span style="color: #7a0874; font-weight: bold;">&#40;</span>url,<span style="color: #ff0000;">&quot;*collegestoreonline.com/*&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #7a0874; font-weight: bold;">return</span> ALLOWED;<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">//</span>Off campus housing forum
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>shExpMatch<span style="color: #7a0874; font-weight: bold;">&#40;</span>url,<span style="color: #ff0000;">&quot;*freeforums.org/*&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #7a0874; font-weight: bold;">return</span> ALLOWED;<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">//</span>ADP related links
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>shExpMatch<span style="color: #7a0874; font-weight: bold;">&#40;</span>url,<span style="color: #ff0000;">&quot;*gafirst.esg.edu/*&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #7a0874; font-weight: bold;">return</span> ALLOWED;<span style="color: #7a0874; font-weight: bold;">&#125;</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>shExpMatch<span style="color: #7a0874; font-weight: bold;">&#40;</span>url,<span style="color: #ff0000;">&quot;*adp.com/*&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #7a0874; font-weight: bold;">return</span> ALLOWED;<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">//</span>VSU Athletics
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>shExpMatch<span style="color: #7a0874; font-weight: bold;">&#40;</span>url,<span style="color: #ff0000;">&quot;*vstateblazers.com/*&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #7a0874; font-weight: bold;">return</span> ALLOWED;<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">else</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">&#123;</span>
<span style="color: #000000; font-weight: bold;">//</span>redirect to proxy server <span style="color: #000000; font-weight: bold;">for</span> all other requests
<span style="color: #7a0874; font-weight: bold;">return</span> DISALLOWED;
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">&#125;</span> <span style="color: #000000; font-weight: bold;">//</span> end of <span style="color: #000000; font-weight: bold;">function</span></pre></div></div>

<h3>browserProxy.bat contents:</h3>
<pre>
::Store info used to create user.js in variables
set var1=# Mozilla User Preferences
set var2=user_pref("network.proxy.autoconfig_url", "http://services.valdosta.edu/restrict.pac");
set var3=user_pref("network.proxy.type", 2);
set var4=user_pref("pref.advanced.proxies.disable_button.reload", false);

::concat each variable to create the user.js
echo %var1%&gt; c:\\apps\user.js
echo %var2%&gt;&gt; c:\\apps\user.js
echo %var3%&gt;&gt; c:\\apps\user.js
echo %var4%&gt;&gt; c:\\apps\user.js

:: determine current user's firefox profile and set it to "var5"
for /f %%a in ('FINDSTR /r ".\.default" "%AppData%\Mozilla\Firefox\profiles.ini"') do set var5=%%a
set var5=%var5:~14%
:: Copy "user.js" to Firefox profile directory
COPY "c:\\apps\user.js" "%AppData%\Mozilla\Firefox\Profiles\%var5%\" &gt;nul

:: create IE Proxy
Reg ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v "AutoConfigUrl" /d "http://services.valdosta.edu/restrict.pac" /f</pre>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save" onclick="urchinTracker('/outgoing/www.addtoany.com/share_save?referer=');"><img src="http://phenix.thephenixblue.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://phenix.thephenixblue.com/2009/10/batch-script-for-ie-firefox-proxies/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

