<?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>Matt Wilson &#187; Microsoft</title>
	<atom:link href="http://www.mattwilsoninc.com/category/microsoft/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mattwilsoninc.com</link>
	<description>A glimpse into Web Operations</description>
	<lastBuildDate>Fri, 22 Jan 2010 15:00:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>CScript Visual C++ Runtime Library Error</title>
		<link>http://www.mattwilsoninc.com/microsoft/cscript-visual-c-runtime-library-error/</link>
		<comments>http://www.mattwilsoninc.com/microsoft/cscript-visual-c-runtime-library-error/#comments</comments>
		<pubDate>Mon, 11 Aug 2008 20:23:22 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Knowledgebase]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Troubleshooting]]></category>
		<category><![CDATA[cscript]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.mattwilsoninc.com/?p=44</guid>
		<description><![CDATA[Last week I had interesting issue with running cscript to execute wsf jobs on a  Windows Server 2003 x64 Edition Server running SQL Server 2005. Every time Cscript ran, a Microsoft Visual C++ Runtime Library Error popped up. Error Details: &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; Runtime Error! Program: C:\winnt\system32\cscript.exe R6034 An Application has made an attempt to load the [...]]]></description>
			<content:encoded><![CDATA[<p>Last week I had interesting issue with running cscript to execute wsf jobs on a  Windows Server 2003 x64 Edition Server running SQL Server 2005. Every time Cscript ran, a Microsoft Visual C++ Runtime Library Error popped up.</p>
<p>Error Details:</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>Runtime Error!</p>
<p>Program: C:\winnt\system32\cscript.exe</p>
<p>R6034</p>
<p>An Application has made an attempt to load the C runtime library incorrectly. Please contact the application&#8217;s support team for more information.</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<div id="attachment_45" class="wp-caption alignnone" style="width: 310px"><a href="http://www.mattwilsoninc.com/wp-content/uploads/2008/08/cscript_issue_bad-server1.png"><img class="size-medium wp-image-45" title="cscript_issue_bad-server1" src="http://www.mattwilsoninc.com/wp-content/uploads/2008/08/cscript_issue_bad-server1-300x185.png" alt="CScript Visual C++ Runtime Lbrary Error" width="300" height="185" /></a><p class="wp-caption-text">CScript Visual C++ Runtime Lbrary Error</p></div>
<p>We have five other SQL Server that run the same job, so I know the job works. In order to find out what was going on, I ran <a href="http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx" target="_blank">Process Monitor</a> to see what dlls are being called by cscript. As you can see from the error, the Microsoft Visual C++ Runtime library was being called from the Microsoft SQL Server Tools\Binn directory. CScript should be calling the msvcr80.dll from the C:\winnt\WinSxS directory as noted in the screen shot below. (I ran the job and Process Monitor on a system where the job ran correctly.)</p>
<div id="attachment_46" class="wp-caption alignnone" style="width: 310px"><a href="http://www.mattwilsoninc.com/wp-content/uploads/2008/08/cscript_issue_correct_server.png"><img class="size-medium wp-image-46" title="cscript_issue_correct_server" src="http://www.mattwilsoninc.com/wp-content/uploads/2008/08/cscript_issue_correct_server-300x63.png" alt="CSCript Correctly Calling msvcr80.dll" width="300" height="63" /></a><p class="wp-caption-text">CSCript Correctly Calling msvcr80.dll</p></div>
<p>Now that we know that the incorrect msvcr80.dll is being called, we need to figure out why and how to correct it.</p>
<p>Microsoft WinSxs Directory is for Side-by-Side assemblies and dlls. The Windows Kernel works with Fusion to find the correct dll needed for the application. (Learn more about <a href="http://www.grimes.demon.co.uk/workshops/fusWSThirteen.htm">Fusion</a>). In the case of the working system, fusion was finding the correct msvcr80.dll.</p>
<p><strong>The Result:</strong></p>
<p>The wsf script called SQLDMO.dll for a function call. The working system had an updated version of the dll with a Manifest which pointed to the correct msvcr80.dll.</p>
<p>The problem system had an older version of the dll with no Manifest, so the closest msvcr80.dll was being used after SQLDMO.dll was called.</p>
<p>To fix, The SQLDMO.dll was updated to the latest version and the problem was solved.</p>
<p>With this issue, using Process Monitor was the best tool to figure out what the problem system and the control system were doing since it pointed out the different msvcr80.dlls being used.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://www.mattwilsoninc.com/wp-content/plugins/add-to-any/share_save_171_16.gif" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.mattwilsoninc.com/microsoft/cscript-visual-c-runtime-library-error/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The many ways to control Windows Services</title>
		<link>http://www.mattwilsoninc.com/microsoft/the-many-ways-to-control-windows-services/</link>
		<comments>http://www.mattwilsoninc.com/microsoft/the-many-ways-to-control-windows-services/#comments</comments>
		<pubDate>Tue, 05 Aug 2008 04:29:05 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Add new tag]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[VBScript]]></category>
		<category><![CDATA[Windows Services]]></category>

		<guid isPermaLink="false">http://www.mattwilsoninc.com/?p=31</guid>
		<description><![CDATA[I&#8217;m often asked how windows services are controlled in the enterprise. There is a variety of convenient ways to control services, each with strengths and weeknesses. We&#8217;ll go through some of them today. 1. The services.msc MMC is the nice GUI provided by windows. This features a very intuitive interface, but can only connect to [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m often asked how windows services are controlled in the enterprise. There is a variety of convenient ways to control services, each with strengths and weeknesses. We&#8217;ll go through some of them today.</p>
<p>1. The <strong>services.msc</strong> MMC is the nice GUI provided by windows. This features a very intuitive interface, but can only connect to one system at a time. This is not very scalable if you need to shut down many services on multiple machines.</p>
<p>2. net start, net stop etc.. This is the original command line version to control services. Good when you are on the system. This is scriptable via a batch file. This command came with Windows NT.</p>
<p>3. <strong>sc.exe</strong> comes with the Windows Resource Kit. This is a great tool and allows to control services on remote machines. Setting up services can also be done with this tool.</p>
<div id="attachment_29" class="wp-caption alignnone" style="width: 310px"><a href="http://www.mattwilsoninc.com/wp-content/uploads/2008/08/sc_query.png"><img class="size-medium wp-image-29" title="sc_query" src="http://www.mattwilsoninc.com/wp-content/uploads/2008/08/sc_query-300x138.png" alt="scquery" width="300" height="138" /></a><p class="wp-caption-text">scquery</p></div>
<p> 4. PS Service (psservice.exe) from the <a href="http://technet.microsoft.com/en-us/sysinternals/bb896649.aspx" target="_blank">PS Tools Suite</a>, authored by <a href="http://blogs.technet.com/markrussinovich/" target="_blank">Mark Russinovch</a>. psservice runs on the command line like sc.exe and shares some of the same features like controlling services on remote machines. One advantage is displaying the security descriptor in a readable format.</p>
<div id="attachment_34" class="wp-caption alignnone" style="width: 310px"><a href="http://www.mattwilsoninc.com/wp-content/uploads/2008/08/psservice_security.png"><img class="size-medium wp-image-34" title="psservice_security" src="http://www.mattwilsoninc.com/wp-content/uploads/2008/08/psservice_security-300x252.png" alt="PSService Security" width="300" height="252" /></a><p class="wp-caption-text">PSService Security</p></div>
<p>5. WMI or Windows Management Instrumentation can control services. WMI can be programmed from VBScript, c# (.NET) and PowerShell. Flow control can be quickly executed with any of the mentioned programming languages giving administrators precise control over which services and systems need to have services controlled. Below is an example of some VBScript functions starting and stopping services via WMI. These functions also start/stop the dependate services which is important.</p>
<pre>Function StopServiceWMI(strServiceName)

  strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    &amp; "{impersonationLevel=impersonate}!\\" &amp; strComputer &amp; "\root\cimv2")
Set colServiceList = objWMIService.ExecQuery("Associators of " _
   &amp; "{Win32_Service.Name='" &amp; strServiceName &amp; "'} Where " _
        &amp; "AssocClass=Win32_DependentService " &amp; "Role=Antecedent" )
For each objService in colServiceList
    objService.StopService()
Next
Wscript.Sleep 5000
Set colServiceList = objWMIService.ExecQuery _
        ("Select * from Win32_Service where Name='" &amp; strServiceName &amp; "'")
For each objService in colServiceList
    errReturn = objService.StopService()
Next

End Function

Function StartServiceWMI(strServiceName)

  strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    &amp; "{impersonationLevel=impersonate}!\\" &amp; strComputer &amp; "\root\cimv2")
Set colServiceList = objWMIService.ExecQuery _
    ("Select * from Win32_Service where Name='" &amp; strServiceName &amp; "'")
For each objService in colServiceList
    errReturn = objService.StartService()
Next
Wscript.Sleep 5000
Set colServiceList = objWMIService.ExecQuery("Associators of " _
   &amp; "{Win32_Service.Name='" &amp; strServiceName &amp; "'} Where " _
        &amp; "AssocClass=Win32_DependentService " &amp; "Role=Dependent" )
For each objService in colServiceList
    objService.StartService()
Next

End Function</pre>
<p>5. One of the last methods is to use the native Get-Service PowerShell CmdLet. To understand what Get-Service can do. Type in Get-Help Get-Service in the PowerShell command prompt. You can resume, start, stop, restart, suspend, set service properties and create a new service. PowerShell does not currently have remoting capabilities, so all CmdLets are executed on the local server. PowerShell V2 will have remoting capability using WS-MAN, but that will be a topic for another time.</p>
<p>I hope you&#8217;ve enjoyed the quick tour with controlling Windows Services. Automation is the key to success in the enterprise.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://www.mattwilsoninc.com/wp-content/plugins/add-to-any/share_save_171_16.gif" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.mattwilsoninc.com/microsoft/the-many-ways-to-control-windows-services/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mojave Experiment</title>
		<link>http://www.mattwilsoninc.com/microsoft/mojave-experiment/</link>
		<comments>http://www.mattwilsoninc.com/microsoft/mojave-experiment/#comments</comments>
		<pubDate>Wed, 30 Jul 2008 20:55:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[Mojave]]></category>
		<category><![CDATA[SP1]]></category>
		<category><![CDATA[Vista]]></category>

		<guid isPermaLink="false">http://www.mattwilsoninc.com/?p=15</guid>
		<description><![CDATA[Microsoft is tired of hearing it&#8217;s rebel teen-ager, Apple, poke and prod that the Apple OS is better than Windows. The Mojave Experiment is focus group like marketing event where Microsoft asks for user input on the &#8220;next&#8221; Windows OS called Mojave.  Many people comment that the new OS is &#8220;Sexy&#8221;, &#8220;Easy to Use&#8221; and [...]]]></description>
			<content:encoded><![CDATA[<p>Microsoft is tired of hearing it&#8217;s rebel teen-ager, Apple, poke and prod that the <a href="http://www.apple.com/getamac/ads/" target="_blank">Apple OS is better than Windows.</a> The <a href="http://mojaveexperiment.com" target="_blank">Mojave Experiment</a> is focus group like marketing event where Microsoft asks for user input on the &#8220;next&#8221; Windows OS called Mojave.  Many people comment that the new OS is &#8220;Sexy&#8221;, &#8220;Easy to Use&#8221; and that it &#8220;Makes me want to use a computer more often.&#8221; Then Microsoft pulls the rug and says this is Vista. Most people are shocked.</p>
<p>This is certainly a clever way to help mitigate the Windows Vista perception issue. This is done is a way that is not directly goading Apple, which is the right move for Microsoft. Microsoft shouldn&#8217;t respond back in kind to Apple with similar ads, that would only ligitamize Apple&#8217;s campaign. It really is a perception problem at this point. Vista SP1 fixed many <a href="http://redmondmag.com/features/article.asp?editorialsid=2479" target="_blank">concerns</a> about the OS. There is still the lingering &#8220;Vista Ready&#8221; issue, but that is dying out in the news.</p>
<p>Personally, I have a Vista partition and an XP partition. I use Vista for development, Office, Email etc. On the XP partition I run VMWare workstation. Vista Ultimate takes up too much RAM to run a VM and Vista with 1.5GB RAM. Maybe it&#8217;s time to upgrade the PC?</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://www.mattwilsoninc.com/wp-content/plugins/add-to-any/share_save_171_16.gif" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.mattwilsoninc.com/microsoft/mojave-experiment/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
