Share via


Configuring a New Failover Cluster by Using Windows PowerShell

Updated: October 1, 2009

Applies To: Windows Server 2008 R2

This topic lists common tasks related to configuring a new failover cluster running Windows Server 2008 R2, and shows example Windows PowerShell commands for performing those tasks. The Windows PowerShell cmdlets provide an alternative interface for actions that you might otherwise perform with command-line commands or the Failover Cluster Manager snap-in. For topics that list other common tasks and the corresponding Windows PowerShell commands, see Performing Common Tasks in a Failover Cluster by Using Windows PowerShell.

For more information about how to use Windows PowerShell, see Additional references, later in this topic.

Common tasks and example commands for configuring a new failover cluster

The following table lists common tasks for configuring a new failover cluster, and the example Windows PowerShell commands for performing those tasks.

Task PowerShell command

Run validation tests on a list of servers.

Also saves a report.

Test-Cluster -Node server1,server2

Where server1 and server2 are servers that you want to validate.

For more information, see Test-Cluster (https://go.microsoft.com/fwlink/?LinkId=143830).

Create a cluster using defaults for most settings.

Settings can be adjusted later.

New-Cluster -Name cluster1 -Node server1,server2

Where server1 and server2 are the servers that you want to include in the new cluster.

For more information, see New-Cluster (https://go.microsoft.com/fwlink/?LinkId=143803).

Configure a clustered file server using defaults for most settings.

Add-ClusterFileServerRole -Storage "Cluster Disk 4"

Where Cluster Disk 4 is the disk that the clustered file server will use.

For more information, see Add-ClusterFileServerRole (https://go.microsoft.com/fwlink/?LinkId=143766).

Configure a clustered print server using defaults for most settings.

Add-ClusterPrintServerRole -Storage "Cluster Disk 5"

Where Cluster Disk 5 is the disk that the clustered print server will use.

For more information, see Add-ClusterPrintServerRole (https://go.microsoft.com/fwlink/?LinkId=143772).

Configure a clustered virtual machine using defaults for most settings.

Add-ClusterVirtualMachineRole -VirtualMachine VM1

Where VM1 is an existing virtual machine that you want to place in a cluster.

For more information, see Add-ClusterVirtualMachineRole (https://go.microsoft.com/fwlink/?LinkId=143778).

Add available disks.

Get-ClusterAvailableDisk | Add-ClusterDisk

For more information, see:

Also see Add-ClusterSharedVolume (https://go.microsoft.com/fwlink/?LinkId=143777).

Additional references