WAS command line

on Sunday, August 19, 2012

Just a reference for the WAS commands from the command line.

net stop was /y # stop was and w3svc/iis
net start was # start was
net start w3svc # start w3svc/iis


So, I found this tracking down an issue with using a shared config in a web farm. (Which is not the right way to configure a web farm.) http://technet.microsoft.com/en-us/library/cc735179(v=ws.10).aspx

appwiz.cpl for Server Core

on Tuesday, August 14, 2012

appwiz.cpl is the Add/Remove Programs dialog. On Windows Server Core the control panel is not available. Instead the wmic program can be used to gather the install list. The output from the command is pretty long, so it’s best to store it in a file and open it with notepad.

wmic product get > list.txt 
notepad list.txt


(http://technet.microsoft.com/en-us/magazine/dd630943.aspx)



Or, with powershell (if .NET 3.5.1 is installed)



gp HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\* | Select DisplayName, DisplayVersion, Publisher, InstallDate, HelpLink, UninstallString | ogv


(http://blogs.msdn.com/b/powershell/archive/2009/11/15/i-can-do-that-with-1-line-of-powershell-installed-software.aspx)

PowerShell Script for a WebFarm Server

on Sunday, August 5, 2012

I’m not sure where gbecerra got this script, but it is very nice. And, the reason it was posted on experts-exchange is because it was being executed in PowerShell ISE, which doesn’t support the *-Tracing commands (they are only supported from the command line on the host).

http://www.experts-exchange.com/Programming/Languages/Scripting/Powershell/Q_26769992.html

The only slight improvement that was added to the script was implementing MS Knowledge Base issue 977754 (http://support.microsoft.com/kb/977754). For some odd reason, some of our servers had this problem.

########################## Implement KB977754 fix ##########################
# http://support.microsoft.com/kb/977754
Write-Host "Implementing KB977754 fix"

$kb977754Files = Get-Item $Env:ALLUSERSPROFILE\Microsoft\Crypto\RSA\MachineKeys\76944fb33636aeddb9590521c2e8815a_*
foreach($i in $kb977754Files) {
$acl = Get-Acl $i
$permissionSet = "NT AUTHORITY\LOCAL SERVICE",”Read”,”Allow”
$ar = New-Object  system.security.accesscontrol.filesystemaccessrule $permissionSet
$acl.SetAccessRule($ar)
Set-Acl $i $acl
}


Creative Commons License
This site uses Alex Gorbatchev's SyntaxHighlighter, and hosted by herdingcode.com's Jon Galloway.