<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Reuben's rambles... inc. tech tips &#38; chat &#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>Reuben's collections, anouncements and contributions (rambles!) including Windows related technical arcitecture tips &#38; chat, with occasional event reporting for good measure.</description>
	<lastBuildDate>Wed, 24 Feb 2010 07:07:07 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='blog.thefullcircle.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/c7cc11c05d774a0e0a7e2483ab236318?s=96&#038;d=http://s2.wp.com/i/buttonw-com.png</url>
		<title>Reuben's rambles... inc. tech tips &#38; chat &#187; setup scripting</title>
		<link>http://blog.thefullcircle.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://blog.thefullcircle.com/osd.xml" title="Reuben&#8217;s rambles&#8230; inc. tech tips &amp; chat" />
	<atom:link rel='hub' href='http://blog.thefullcircle.com/?pushpress=hub'/>
		<item>
		<title>Windows Server 2008 Server Core setup scripts &amp; common commands</title>
		<link>http://blog.thefullcircle.com/2008/04/21/windows-server-2008-server-core-setup-scripts-common-commands/</link>
		<comments>http://blog.thefullcircle.com/2008/04/21/windows-server-2008-server-core-setup-scripts-common-commands/#comments</comments>
		<pubDate>Mon, 21 Apr 2008 12:42:14 +0000</pubDate>
		<dc:creator>reubenjcook</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 [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.thefullcircle.com&blog=2967773&post=8&subd=reubenjcook&ref=&feed=1" />]]></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://s.wordpress.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 &#8217;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 \windows\system32\scregedit.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 \windows\system32\scregedit.wsf /ar 0<br />
cscript \windows\system32\scregedit.wsf /cs 1</p>
<p>(for help on what commands are available via scregedit type cscript \windows\system32\scregedit.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>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/reubenjcook.wordpress.com/8/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/reubenjcook.wordpress.com/8/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/reubenjcook.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/reubenjcook.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/reubenjcook.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/reubenjcook.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/reubenjcook.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/reubenjcook.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/reubenjcook.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/reubenjcook.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/reubenjcook.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/reubenjcook.wordpress.com/8/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.thefullcircle.com&blog=2967773&post=8&subd=reubenjcook&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://blog.thefullcircle.com/2008/04/21/windows-server-2008-server-core-setup-scripts-common-commands/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/108028747abc4e56209301fdd9fd3b45?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Reubs</media:title>
		</media:content>
	</item>
	</channel>
</rss>