Monday, April 11, 2011

Script of Getting OS Version using Powershell



Powershell makes it easy to get information from remote servers.

Below is the query to find OS Version of all the remote servers you are connected with-

Step1- Create the list of all the servers in a notepad with name "serverlist.txt". I have saved this file on location "D:\Powershell" you can change it with your own location.

Step2- Execute below script-

PS C:\Windows\system32>$serverlist = Get-Content "D:\Powershell\serverlist.txt"
PS C:\Windows\system32>foreach($server in $serverlist)
{
$serverversion = Get-WmiObject -computer $server -cl Win32_OperatingSystem
write-output $server, $serverversion.version | out-file "D:\Powershell\OSVersion.txt" -append
}

You can also save the script in a notepad and save it with extension ".ps1". When you will execute the file OS Version for all the servers in the server list will store in the OSVersion file.

Saturday, April 9, 2011

Error 1067: The cluster service is stopped on passive node of my two node sql cluster. It throws following error when I try to start this:

This is found that the cluster service in one of the passive stops. This throws following error when I try to start this.

Error 1067: The process terminated unexpectedly

I verified the password under which this cluster service is running. This account is perfect. So there should be some other problem.

Let's go ahead and see the problem in the cluster.log file.

Info from %WINDIR%\Cluster\cluster.log is as follows:

WARN [EVT] EvtBroadcaster: EvPropEvents for node 2 failed. status 1727
WARN [NM] RpcExtErrorInfo: Error info not found.

Error from clusterlog

Error: Failed to read (sector 12), error 170. and Failed to write (sector 12), error 170.


1. started from cmd. net start clussvc
2. The Windows Firewall/Internet Connection Sharing service should neither be enabled nor set to start automatically.

FmGetQuorumResource failed, error 170. Failed to read. Failed to form cluster, status 5086.

Follwoing was the problem:

The Admin NIC threw an error. This caused the netowrk connectionos in the cluster disabled. I disabled and enabled the NIC and this started working.

Regards,
tuitionaffordable