<?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>Andrei DANEASA &#187; automatic</title>
	<atom:link href="http://www.webxpert.ro/andrei/tag/automatic/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.webxpert.ro/andrei</link>
	<description>Programming, database, security, Oracle, .NET, C#, PHP, Travel</description>
	<lastBuildDate>Tue, 18 Oct 2011 15:42:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Preparing for Oracle Database Enterprise Manager &#8211; automatic configuration</title>
		<link>http://www.webxpert.ro/andrei/2008/01/10/preparing-for-oracle-database-enterprise-manager-automated-configuration/</link>
		<comments>http://www.webxpert.ro/andrei/2008/01/10/preparing-for-oracle-database-enterprise-manager-automated-configuration/#comments</comments>
		<pubDate>Thu, 10 Jan 2008 13:47:08 +0000</pubDate>
		<dc:creator>andreiash</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[automatic]]></category>
		<category><![CDATA[configuration]]></category>
		<category><![CDATA[EM]]></category>
		<category><![CDATA[enterprise manager]]></category>
		<category><![CDATA[loopback adapter]]></category>
		<category><![CDATA[oracle]]></category>

		<guid isPermaLink="false">http://www.webxpert.ro/andrei/2008/01/10/preparing-for-oracle-database-enterprise-manager-automated-configuration/</guid>
		<description><![CDATA[I wrote a lot how to install loopback adapter, how to set the ip address (either manual or automatically), how to add an entry to hosts file (either manual or automatically). Now let&#8217;s add all together into a single script. The script will do the following: call DevCon to install Microsoft Loopback Adapter (you need [...]]]></description>
			<content:encoded><![CDATA[<p>I wrote a lot how to install loopback adapter, how to set the ip address (either manual or automatically), how to add an entry to hosts file (either manual or automatically). Now let&#8217;s add all together into a single script.<br />
The script will do the following:</p>
<ul>
<li>call DevCon to install Microsoft Loopback Adapter (you need to <a href="http://download.microsoft.com/download/1/1/f/11f7dd10-272d-4cd2-896f-9ce67f3e0240/devcon.exe">download DevCon</a> and save it in the same folder as the script)</li>
<li>set the IP address and mask for the recently installed loopback adapter</li>
<li>dinamically read from Windows folder the hosts file</li>
<li>dinamically read the hostname</li>
<li>add a new entry to the hosts file with the supplied IP address and hostname</li>
<li>ping the hostname and check if the supplied IP address is responded</li>
<li><strong>MOST IMPORTANT:</strong> everything is dynamic and automatic. You don&#8217;t need to edit the script before each install. Just run it!</li>
</ul>
<p>You can download this script here:<span id="more-51"></span><br />
<a href="http://www.webxpert.ro/andrei/wp-content/uploads/2008/01/loopback_silent.zip"><img src='http://www.webxpert.ro/andrei/wp-content/uploads/2008/01/zip.gif' alt='ZIP' /></a><br />
<a href='http://www.webxpert.ro/andrei/wp-content/uploads/2008/01/loopback_silent.zip' title='EM_configure_interactive'>Silent Install</a><br />
<em>* you will need to run the .bat file and make sure that you have devcon.exe in the same folder</em></p>
<p>I am thinking that maybe some users would want to modify the IP address, mask or set another hostname, they would want to set their own parameters. This is the reason why I created another version of the script which wait for user input for IP, Mask and Hostname, but having the default values filled in like this:<br />
<img src='http://www.webxpert.ro/andrei/wp-content/uploads/2008/01/loopback1.jpg' alt='loopback enter the IP' /></p>
<p>You can download this script here:<br />
<a href="http://www.webxpert.ro/andrei/wp-content/uploads/2008/01/loopback_interactive.zip"><img src='http://www.webxpert.ro/andrei/wp-content/uploads/2008/01/zip.gif' alt='ZIP' /></a><br />
<a href='http://www.webxpert.ro/andrei/wp-content/uploads/2008/01/loopback_interactive.zip' title='EM_configure_interactive'>Interactive Install</a><br />
<em>* you will need to run the .bat file and make sure that you have devcon.exe in the same folder</em></p>
<p><strong>Read also</strong></p>
<li><a href="http://www.webxpert.ro/andrei/2008/01/10/preparing-for-oracle-database-enterprise-manager-manual-configuration/">Preparing for Oracle Database Enterprise Manager &#8211; manual configuration</a></li>
<li><a href="http://www.webxpert.ro/andrei/2008/01/10/microsoft-loopback-adapter-automated-configure/">Microsoft Loopback Adapter automatic configuration</a></li>
<li><a href="http://www.webxpert.ro/andrei/2008/01/10/microsoft-loopback-adapter-automated-install/">Microsoft Loopback Adapter automatic install</a></li>
<li><a href="http://www.webxpert.ro/andrei/2010/10/08/vista-cannot-get-ip-from-some-routers-or-some-dhcp-servers/">Vista cannot get IP from some routers or some DHCP servers</a></li>
<li><a href="http://www.webxpert.ro/andrei/2010/09/09/upgrade-oracle-apex-3-2-1-to-4-0-1-on-oracle-database-10g-express-edition-xe/">Upgrade Oracle APEX 3.2.1 to 4.0.1 on Oracle Database 10g Express Edition (XE)</a></li>
]]></content:encoded>
			<wfw:commentRss>http://www.webxpert.ro/andrei/2008/01/10/preparing-for-oracle-database-enterprise-manager-automated-configuration/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Microsoft Loopback Adapter automatic configuration</title>
		<link>http://www.webxpert.ro/andrei/2008/01/10/microsoft-loopback-adapter-automated-configure/</link>
		<comments>http://www.webxpert.ro/andrei/2008/01/10/microsoft-loopback-adapter-automated-configure/#comments</comments>
		<pubDate>Thu, 10 Jan 2008 10:54:24 +0000</pubDate>
		<dc:creator>andreiash</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[automatic]]></category>
		<category><![CDATA[configuration]]></category>
		<category><![CDATA[loopback adapter]]></category>

		<guid isPermaLink="false">http://www.webxpert.ro/andrei/2008/01/10/microsoft-loopback-adapter-automated-configure/</guid>
		<description><![CDATA[What do you need to know before configuring Loopback Adapter? do not set the gateway because you can screw you internet connection do not set DNS because you really don&#8217;t need it do not set 127.0.0.1 or 192.168.0.1 or addresses from the same class as your internet connection address The addresses that I&#8217;m using most [...]]]></description>
			<content:encoded><![CDATA[<p>What do you need to know before configuring Loopback Adapter?</p>
<ul>
<li>do not set the gateway because you can screw you internet connection</li>
<li>do not set DNS because you really don&#8217;t need it</li>
<li>do not set 127.0.0.1 or 192.168.0.1 or addresses from the same class as your internet connection address</li>
</ul>
<p>The addresses that I&#8217;m using most of the time are <strong>10.10.10.10</strong> and <strong>192.168.100.100</strong>, both with <strong>255.255.255.0</strong> as mask.</p>
<p>Let&#8217;s see how can we set the IP address from the command line.</p>
<p><strong>Solution 1<br />
=======</strong><br />
<strong>Netsh.exe</strong> is a tool installed with Windows 2000, XP and 2003 Server. <span id="more-45"></span>The name comes from Network Shell I guess&#8230;<br />
In order to set an IP address for the adapter called &#8220;Local Area Connection 4&#8243; you need to run this command:</p>
<div class="dean_ch" style="white-space: wrap;">netsh interface ip set address name=<span class="st0">&quot;Local Area Connection 4&quot;</span> static <span class="nu0">192.168</span><span class="nu0">.100</span><span class="nu0">.100</span> <span class="nu0">255.255</span><span class="nu0">.255</span><span class="nu0">.0</span> <span class="nu0">1</span></div>
<p>This solution has a big disadvantage: it is not fully automated. You need first to check the name of the connection and then run netsh with that name. Depending on how many adapter you have installed, the last digit differs. So we need to another solution that will query the adapters and selects the loopback.</p>
<p><strong>Solution 2<br />
=======</strong><br />
A better solution is to create a script that query all the network adapters and selects the loopback adapter. I assume that there is no reason to have more than 1 loopback adapter installed.<br />
The script is the following:</p>
<div class="dean_ch" style="white-space: wrap;">strIPAddress = <span class="st0">&quot;192.168.100.100&quot;</span><br />
strSubnetMask = <span class="st0">&quot;255.255.255.0&quot;</span><br />
Set objNetwork = <span class="kw3">CreateObject</span><span class="br0">&#40;</span><span class="st0">&quot;WScript.Network&quot;</span><span class="br0">&#41;</span><br />
strAlias = objNetwork.ComputerName</p>
<p>Set objWMIService = <span class="kw3">GetObject</span><span class="br0">&#40;</span><span class="st0">&quot;winmgmts:\\&quot;</span> &amp; strComputer &amp; <span class="st0">&quot;\root\cimv2&quot;</span><span class="br0">&#41;</span><br />
Set colNetAdapters = objWMIService.ExecQuery _<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#40;</span><span class="st0">&quot;Select * from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE&quot;</span><span class="br0">&#41;</span><br />
strGatewayMetric = Array<span class="br0">&#40;</span><span class="nu0">1</span><span class="br0">&#41;</span><br />
<span class="kw1">For</span> Each objNetAdapter <span class="kw1">in</span> colNetAdapters</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> objNetAdapter.Description = <span class="st0">&quot;Microsoft Loopback Adapter&quot;</span> <span class="kw1">then</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; errEnable = objNetAdapter.EnableStatic<span class="br0">&#40;</span>array<span class="br0">&#40;</span>strIPAddress<span class="br0">&#41;</span>, array<span class="br0">&#40;</span>strSubnetMask<span class="br0">&#41;</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">If</span> errEnable = <span class="nu0">0</span> <span class="kw1">Then</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; WScript.Echo <span class="st0">&quot;The IP address has been changed.&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">Else</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; WScript.Echo <span class="st0">&quot;The IP address could not be changed.&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">End</span> <span class="kw1">If</span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">end</span> <span class="kw1">if</span><br />
<span class="kw1">Next</span></div>
<p>You can download the script <a href='http://www.webxpert.ro/andrei/wp-content/uploads/2008/01/conf_ip.vbs' title='configure IP silent'>here</a><br />
<strong><br />
Solution 3 &#8211; RECOMMENDED<br />
====================</strong><br />
My preferred solution is to use an interactive script, the same like Solution 2, but the IP Address and mask are entered interactive by the user. The nice thing here is that we can set default values, so if the user is undecided, he can choose the default values.<br />
The script is the following:</p>
<div class="dean_ch" style="white-space: wrap;">strIPAddress = inputbox<span class="br0">&#40;</span><span class="st0">&quot;Set the IP Address&quot;</span>, <span class="st0">&quot;IP Address?&quot;</span>, <span class="st0">&quot;192.168.100.100&quot;</span><span class="br0">&#41;</span><br />
strSubnetMask = array<span class="br0">&#40;</span>inputbox<span class="br0">&#40;</span><span class="st0">&quot;Set mask&quot;</span>, <span class="st0">&quot;Mask?&quot;</span>, <span class="st0">&quot;255.255.255.0&quot;</span><span class="br0">&#41;</span><span class="br0">&#41;</span></p>
<p>Set objNetwork = <span class="kw3">CreateObject</span><span class="br0">&#40;</span><span class="st0">&quot;WScript.Network&quot;</span><span class="br0">&#41;</span></p>
<p>Set objWMIService = <span class="kw3">GetObject</span><span class="br0">&#40;</span><span class="st0">&quot;winmgmts:\\&quot;</span> &amp; strComputer &amp; <span class="st0">&quot;\root\cimv2&quot;</span><span class="br0">&#41;</span><br />
Set colNetAdapters = objWMIService.ExecQuery _<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#40;</span><span class="st0">&quot;Select * from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE&quot;</span><span class="br0">&#41;</span><br />
strGatewayMetric = Array<span class="br0">&#40;</span><span class="nu0">1</span><span class="br0">&#41;</span></p>
<p><span class="kw1">For</span> Each objNetAdapter <span class="kw1">in</span> colNetAdapters</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> objNetAdapter.Description = <span class="st0">&quot;Microsoft Loopback Adapter&quot;</span> <span class="kw1">then</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; errEnable = objNetAdapter.EnableStatic<span class="br0">&#40;</span>array<span class="br0">&#40;</span>strIPAddress<span class="br0">&#41;</span>, strSubnetMask<span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">If</span> errEnable = <span class="nu0">0</span> <span class="kw1">Then</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; WScript.Echo <span class="st0">&quot;The IP address has been changed.&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">Else</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; WScript.Echo <span class="st0">&quot;The IP address could not be changed.&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">End</span> <span class="kw1">If</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">end</span> <span class="kw1">if</span><br />
<span class="kw1">Next</span></div>
<p>When you will run the script it will open the following screen:<br />
<img src="http://www.webxpert.ro/andrei/wp-content/uploads/2008/01/loopback1.jpg" alt="set IP address" /><br />
<img src="http://www.webxpert.ro/andrei/wp-content/uploads/2008/01/loopback2.jpg" alt="set mask" /><br />
You can download the script <a href='http://www.webxpert.ro/andrei/wp-content/uploads/2008/01/conf_ip_interactive.vbs' title='configure IP interactive'>here</a></p>
<p>If you have any issues, comments, suggestions, feel free to post a comment.</p>
<p><strong>Read also</strong></p>
<li><a href="http://www.webxpert.ro/andrei/2008/01/10/preparing-for-oracle-database-enterprise-manager-automated-configuration/">Preparing for Oracle Database Enterprise Manager &#8211; automatic configuration</a></li>
<li><a href="http://www.webxpert.ro/andrei/2008/01/10/preparing-for-oracle-database-enterprise-manager-manual-configuration/">Preparing for Oracle Database Enterprise Manager &#8211; manual configuration</a></li>
<li><a href="http://www.webxpert.ro/andrei/2008/01/10/microsoft-loopback-adapter-automated-install/">Microsoft Loopback Adapter automatic install</a></li>
<li><a href="http://www.webxpert.ro/andrei/2010/10/08/vista-cannot-get-ip-from-some-routers-or-some-dhcp-servers/">Vista cannot get IP from some routers or some DHCP servers</a></li>
<li><a href="http://www.webxpert.ro/andrei/2008/01/02/microsoft-loopback-adapter-manual-install-on-2000-xp-2003-vista/">Microsoft Loopback Adapter manual install on 2000, XP, 2003, Vista</a></li>
]]></content:encoded>
			<wfw:commentRss>http://www.webxpert.ro/andrei/2008/01/10/microsoft-loopback-adapter-automated-configure/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Microsoft Loopback Adapter automatic install</title>
		<link>http://www.webxpert.ro/andrei/2008/01/10/microsoft-loopback-adapter-automated-install/</link>
		<comments>http://www.webxpert.ro/andrei/2008/01/10/microsoft-loopback-adapter-automated-install/#comments</comments>
		<pubDate>Thu, 10 Jan 2008 09:03:29 +0000</pubDate>
		<dc:creator>andreiash</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[automatic]]></category>
		<category><![CDATA[install]]></category>
		<category><![CDATA[loopback adapter]]></category>

		<guid isPermaLink="false">http://www.webxpert.ro/andrei/2008/01/10/microsoft-loopback-adapter-automated-install/</guid>
		<description><![CDATA[Because lots of applications (including Oracle Database) require Microsoft Loopback Adapter installed if you have DHCP-enabled machine, I tried to find a solution to automatize the installation of this dummy device. Lots of attendees that I had on my workshops are configuring the loopback adapter with strange IP&#8217;s, gateways and the most common result is [...]]]></description>
			<content:encoded><![CDATA[<p>Because lots of applications (including Oracle Database) require Microsoft Loopback Adapter installed if you have DHCP-enabled machine, I tried to find a solution to automatize the installation of this dummy device.<br />
Lots of attendees that I had on my workshops are configuring the loopback adapter with strange IP&#8217;s, gateways and the most common result is malfunctioning of the internet connection.</p>
<p>First of all we need a command prompt utility that will act the same way as Device Manager. Microsoft has an utility like this called <strong>DevCon </strong>(probably from Device Console), but for some strange reasons it is not redistributable, so you need to download it from their site.<br />
DevCon&#8217;s description is <a href="http://support.microsoft.com/kb/311272">http://support.microsoft.com/kb/311272</a> and download link is <a href="http://download.microsoft.com/download/1/1/f/11f7dd10-272d-4cd2-896f-9ce67f3e0240/devcon.exe">this</a>.<br />
<span id="more-44"></span><br />
Once you have the executable you can start a command prompt from that location and use following command to install loopback adapter:</p>
<div class="dean_ch" style="white-space: wrap;">devcon install %windir%\inf\netloop.inf *msloop</div>
<p>After a few seconds waiting, you have Loopback Adapter installed.</p>
<p>In the next article you will read about automated configuration of loopback adapter and writing an entry in Windows&#8217; hosts file.</p>
<p><strong>Read also</strong></p>
<li><a href="http://www.webxpert.ro/andrei/2008/01/10/preparing-for-oracle-database-enterprise-manager-automated-configuration/">Preparing for Oracle Database Enterprise Manager &#8211; automatic configuration</a></li>
<li><a href="http://www.webxpert.ro/andrei/2008/01/10/microsoft-loopback-adapter-automated-configure/">Microsoft Loopback Adapter automatic configuration</a></li>
<li><a href="http://www.webxpert.ro/andrei/2008/01/02/microsoft-loopback-adapter-manual-install-on-2000-xp-2003-vista/">Microsoft Loopback Adapter manual install on 2000, XP, 2003, Vista</a></li>
<li><a href="http://www.webxpert.ro/andrei/2010/03/12/install-subversion-for-vps-cpanel-under-centos/">Install subversion for VPS (cPanel) under CentOS</a></li>
<li><a href="http://www.webxpert.ro/andrei/2008/01/10/preparing-for-oracle-database-enterprise-manager-manual-configuration/">Preparing for Oracle Database Enterprise Manager &#8211; manual configuration</a></li>
]]></content:encoded>
			<wfw:commentRss>http://www.webxpert.ro/andrei/2008/01/10/microsoft-loopback-adapter-automated-install/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

