MAC Addresses on NLB Cluster

December 2, 2015

With my colleague we were working  on strange NLB cluster issue and were discussing Layer 2 data transmission and strange MAC addresses on NLB cluster. My colleague brought an interesting point to my attention

Read the rest of this entry »


List the Printers in Print Cluster

March 25, 2014

New plans, new projects…

As a part of one of such plans I needed to list all the printers located at the Windows 2000 print cluster (I know, I know what you wanna say). Simple task, one line command can do this

Get-WMIObject win32_Printer -computerName PrintClusterName

Ooops… No printers listed. OK, this print cluster has several resource groups and several virtual names, one per department. Print cluster itself does not have any printer, all are installed within those resource groups

Get-WMIObject win32_Printer -computerName DepartamentalVirtualName

No printers listed.

Short investigation showed that Windows cluster 2000/2003 does not support WMI, so, no way to list the printers.

Good thing is that all those printers were published in Active Directory. This approach worked, not from the first run though.

Search for the PrintQueue object class

$ADRoot = [ADSI]””
$Searcher = New-Object System.Directoryservices.DirectorySearcher($ADRoot)
$Searcher.SearchRoot = $ADRoot
$Searcher.SearchScope = “subtree”
$Searcher.Filter = “(objectClass=PrintQueue)”
$ADPrinters = $Searcher.FindAll()

and be aware that all the object properties are collections and their names are case sensitive.For example, the driver name is available like this

$ADPrinter.Properties.drivername[0] 

That’s it. In addition the script pings IP printer addresses to filter out “forgotten” printers.

The entire script is provided below. It allows to get almost every bit of information we usually see in the Printer Properties window

#####################################################################
#### FUNCTIONS ####################################################
#####################################################################
FUNCTION Ping ($Device)
{
$Filter = “Address=” + [char]34 + $Device + [char]34
$PingStatus = Get-WMIObject Win32_PingStatus -Filter $Filter
return (($PingStatus -ne $Null) -and ($PingStatus.StatusCode -eq 0))
}

FUNCTION GetProperty ($PropertyName)
{
if ($ADPrinter.Properties.$PropertyName -eq $Null)
{return “”}
else
{
if ($ADPrinter.Properties.$PropertyName[0] -ne $Null)
{return $ADPrinter.Properties.$PropertyName[0].ToString()}
else
{return $ADPrinter.Properties.$PropertyName.ToString()}
}
}

#####################################################################
#####################################################################
#####################################################################

#####################################################################
#### INITIALIZING THE VARIABLES
#####################################################################
$InfoMessage = $Host.PrivateData.WarningForeGroundColor
$ErrorMessage = $Host.PrivateData.ErrorForeGroundColor
$ScriptPath = Split-Path $MyInvocation.MyCommand.Path

############################################################
$OutputFileName = (Read-Host “Enter the result file name”).Trim()
if ($OutputFileName -ne “”)
{
if ($OutputFileName.IndexOf(“:”) -eq -1)
{$OutputFileName = Join-Path $ScriptPath $OutputFileName}
if ((Test-Path $OutputFileName) -eq $True)
{
Write-Host ($OutputFileName + ” already exists”) -foregroundColor $ErrorMessage
return
}
Add-Content $OutputFileName -value “Virtual Cluster Name;Printer Name;Port Name;IP Address;Share Name;Driver Name;Creation Date;Location;Description;Active”
}

#####################################################################
#### MAIN LOOP
#####################################################################

$ADRoot = [ADSI]””
$Searcher = New-Object System.Directoryservices.DirectorySearcher($ADRoot)
$Searcher.SearchRoot = $ADRoot
$Searcher.SearchScope = “subtree”
$Searcher.Filter = “(objectClass=PrintQueue)”
$ADPrinters = $Searcher.FindAll()
Write-Host “Searching for the printers in Active Directory…”

ForEach ($ADPrinter in $ADPrinters)
{
Write-Host “.” -noNewLine

$Line = (GetProperty “shortservername”) + “;” + (GetProperty “printername”) + “;” + (GetProperty “portname”) + “;”

$Active = “Incorrect Port Name”
$IPAddress = “”
if ($ADPrinter.Properties.portname[0] -match “IP_(.*)”)
{
$IPAddress = $Matches[1]
if ((Ping $IPAddress))
{$Active = “YES”}
else
{$Active = “No”}
}

$Line = $Line + $IPAddress + “;” + (GetProperty “printsharename”) + “;” + (GetProperty “drivername”) + “;” + (GetProperty “whencreated”) + “;”
$Line = $Line + (GetProperty “location”) + “;” + (GetProperty “description”)
$Line = $Line + “;” + $Active
Add-Content $OutputFileName -value $Line
}
Write-Host

return

 

 


The Cluster Service Cannot Be Started: The Network Path Not Found

April 21, 2011

The solution is pretty simple and has been taken from this MS article:

Use a period (.) as a cluster name when you are in the Open Connection to Cluster dialog box. Remember, in many cases for Microsoft (.) means “local name”


“RequireKerberos” Error During the SQL 2008 Installation on Windows 2008 Cluster

October 28, 2010

During the SQL Server 2008 installation on Windows 2008 Cluster the following error occurs:

There was an error setting private property ‘RequireKerberos’ to value ‘1’ for resource ‘SQL Network Name (SQL-SERVER-NAME)’.  Error: Value does not fall within the expected range.

Read the rest of this entry »


MS DTC Resource Fails Due to Network Name

October 26, 2010

As you know, Windows 2008 Cluster does not need the cluster service account anymore; it relies on SYSTEM account. This is nice, but also it was the reason why I could not install MS DTC (Distributed Transaction Coordinator) on the Windows 2008 cluster. Below you can find the solution

Read the rest of this entry »