<?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 Full Circle Blog &#187; setup scripting</title>
	<atom:link href="http://blog.thefullcircle.com/tag/setup-scripting/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.thefullcircle.com</link>
	<description>The news, views and skews of The Full Circle</description>
	<lastBuildDate>Thu, 26 Jan 2012 11:33:00 +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>Windows Server 2008 Server Core setup scripts &amp; common commands</title>
		<link>http://blog.thefullcircle.com/2008/04/windows-server-2008-server-core-setup-scripts-common-commands/</link>
		<comments>http://blog.thefullcircle.com/2008/04/windows-server-2008-server-core-setup-scripts-common-commands/#comments</comments>
		<pubDate>Mon, 21 Apr 2008 12:42:14 +0000</pubDate>
		<dc:creator>ReubenC</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[Hyper-V]]></category>
		<category><![CDATA[Server Core]]></category>
		<category><![CDATA[setup scripting]]></category>
		<category><![CDATA[Windows Server 2008]]></category>
		<category><![CDATA[WS2008]]></category>

		<guid isPermaLink="false">http://reubenjcook.wordpress.com/?p=8</guid>
		<description><![CDATA[In a previous post I talked about setting up Windows Server 2008 Enterprise Edition 64-bit to be a Hyper-V platform, Microsoft&#8217;s recommendation is for the Virtual Machine host to be running Server Core - dig out your old PC-DOS or MS-DOS commands then apply 20+ years of updates Server Core is all about the command line and scripting and I was recently lucky [...]]]></description>
			<content:encoded><![CDATA[<p>In a previous post I talked about setting up Windows Server 2008 Enterprise Edition 64-bit to be a Hyper-V platform, Microsoft&#8217;s recommendation is for the Virtual Machine host to be running Server Core - dig out your old PC-DOS or MS-DOS commands then apply 20+ years of updates <img src='http://blog.thefullcircle.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>Server Core is all about the command line and scripting and I was recently lucky enough to have attended a Microsoft Hyper-V RDP bootcamp in which we covered Server Core deployments, this and having trawled various blog posts but not being able to find a single source for common Hyper-V server core setup commands made me want to document the setup scripts I used to allow quick and easy replication and, of course, for all dev environments &#8211; frequent rebuild!</p>
<p>These are listed in the order I would perform them to either minimise security or network &#8216;steps&#8217; (such as name registration order):</p>
<p>To enable Automatic Updates and force an immediate update (apparently you can also define a schedule - for non-managed servers we only allow Saturday at 03:00)<br />
[sc-enableAU.cmd]<br />
cscript windowssystem32scregedit.wsf /au 4<br />
net stop wuauserv<br />
net start wuauserv<br />
wuauclt /detectnow</p>
<p>To enable Terminal Services access<br />
[sc-enableTS.cmd]<br />
cscript windowssystem32scregedit.wsf /ar 0<br />
cscript windowssystem32scregedit.wsf /cs 1</p>
<p>(for help on what commands are available via scregedit type cscript windowssystem32scregedit.wsf /?)</p>
<p>To rename the local computer name<br />
[sc-renamecomputer.cmd]<br />
hostname<br />
netdom renamecomputer &lt;old_host_name&gt; /newname:&lt;new_host_name&gt;<br />
rem &#8211; a shutdown /r /t 0 will be needed to restart the computer for the change to be applied</p>
<p>To change the workgroup name<br />
[sc-changeWGroup.cmd]<br />
rem usage sc-changeWGroup &lt;host_name&gt; &lt;workgroup_name&gt;<br />
hostname<br />
wmic computersystemwhere name=&#8221;%1&#8243; call joindomainorworkgroup name=&#8221;%2&#8243;<br />
rem &#8211; a shutdown /r /t 0 will be needed to restart the computer for the change to be applied</p>
<p>To list the status of Hyper-V and install it (assumes any pre-req patches such as RC0)<br />
[sc-enableHV.cmd]<br />
oclist | find &#8220;Hyper-V&#8221;<br />
ocsetup Microsoft-Hyper-V</p>
<p>To rename the new virtual switch interface from the default Local Area Connection 3<br />
[sc-renameLAN3.cmd]<br />
netsh interface set interface name = &#8220;Local Area Connection 3&#8243; newname = &#8220;Local Area Connection &#8211; Virtual&#8221;</p>
<p>Script to set IP, mask, G/W, &amp; DNS servers<br />
[sc-setIP.cmd]<br />
rem changes ip address by script<br />
rem usage &#8211; sc-setIP &lt;ip address&gt; &lt;subnet mask&gt; &lt;gateway&gt; &lt;dns1&gt; &lt;dns2&gt;</p>
<p>netsh interface ipv4 set address name=&#8221;Local Area Connection &#8211; Virtual&#8221; source=static address=%1 mask=%2 gateway=%3</p>
<p>netsh interface ipv4 add dnsserver name=&#8221;Local Area Connection &#8211; Virtual&#8221; address=%4 index=1<br />
netsh interface ipv4 add dnsserver name=&#8221;Local Area Connection &#8211; Virtual&#8221; address=%5 index=2</p>
<p>netsh interface ipv4 show config | more</p>
<p>To open WMI for Hyper-V remote administration<br />
[sc-openWMI.cmd]<br />
winrm quickconfig<br />
netsh advfirewall firewall set rule group=&#8221;Windows Management Instrumentation (WMI)&#8221; new enable=yes<br />
net localgroup &#8220;Distributed COM Users&#8221; /add Admin-TFCSupport</p>
<p>or to open a WorkGroup server for full remote administration&#8230;<br />
[sc-openRA-WGroup.cmd]<br />
netsh advfirewall firewall set rule group=“Remote Administration” new enable=yes</p>
<p>[sc-setIP.cmd]<br />
rem changes ip address by script<br />
rem usage &#8211; sc-setIP &lt;ip address&gt; &lt;subnet mask&gt; &lt;gateway&gt; &lt;dns1&gt; &lt;dns2&gt;</p>
<p>netsh interface ipv4 set address name=&#8221;Local Area Connection&#8221; source=static address=%1 mask=%2 gateway=%3</p>
<p>netsh interface ipv4 add dnsserver name=&#8221;Local Area Connection&#8221; address=%4 index=1<br />
netsh interface ipv4 add dnsserver name=&#8221;Local Area Connection&#8221; address=%5 index=2</p>
<p>netsh interface ipv4 show config | more</p>
<p>[sc-enableICMP]<br />
netsh firewall set icmpsetting 8</p>
<p>(or to simply disable the entire firewall&#8230; netsh firewall set opmode disable)</p>
<p>[sc-setNTP.cmd]<br />
w32tm /configure /manualpeerlist:pool.ntp.org,212.111.32.110,0&#215;8 /syncfromflags:MANUAL<br />
net stop w32time<br />
net start w32time<br />
w32tm /resync /nowait</p>
<p>Of course, a lot of these commands are not just specific to Server Core but can be also run on full versions of WS2008, the new Hyper-V Server soon to be launched, or indeed Vista.<br />
One last great command line line tool to confirm many of the outcomes and changes executed by the commands detailed here is &#8217;systeminfo&#8217; &#8211; try it!</p>
<p>update&#8230; two excellent resources that expand way more than I have time to are:<br />
<a href="http://blogs.technet.com/server_core/">http://blogs.technet.com/server_core/</a><br />
<a href="http://msmvps.com/blogs/ad/archive/2008/09/18/admin-s-guide-to-server-core-commands.aspx">http://msmvps.com/blogs/ad/archive/2008/09/18/admin-s-guide-to-server-core-commands.aspx</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.thefullcircle.com/2008/04/windows-server-2008-server-core-setup-scripts-common-commands/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

