Using PowerShell to Failover Availability Groups and WFC Cluster Nodes
This article will show you how to failover an AG to another node and then move the WFC role to the same secondary…
Read MoreAll things PowerShell (includes v2, v3 and v4)
This article will show you how to failover an AG to another node and then move the WFC role to the same secondary…
Read MoreHere is a very cool PowerShell script that creates a Windows form front-end GUI for RoboCopy: PowerShell Robocopy GUI Tool – PowerCopy Views…
Read MoreHere are the current set of MS Code extensions I use on a daily basis. Views – 2563
Read More…for those of you that use Sapiens’ PowerShell Studio, there is a new feature available since version 5.2.118 that allows you to use…
Read MoreHere is a small cmdlet I wrote to get the currently active node in a Windows cluster:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
function Get-ClusterActiveNode { <# .SYNOPSIS Returns the active server node name for the specified Windows server cluster. .DESCRIPTION Returns the active server node name for the specified Windows server cluster. .EXAMPLE PS C:\> Get-ClusterActiveNode -ClusterCName ClusterAlias .PARAMETER ClusterName Specifies the cluster name or alias for the Windows cluster to query. .OUTPUTS The output is displayed to the console. #> [CmdletBinding(DefaultParameterSetName = 'ClusterName')] [OutputType([string], ParameterSetName = 'ClusterName')] [OutputType([string])] Param ( [Parameter(Mandatory = $true, Position = 0)] [string]$ClusterName ) try { Get-WmiObject -Class Win32_ComputerSystem -ComputerName $ClusterName | Select-Object @{ Label = "Active Node"; Expression = { $_.Name } } } catch { $exception = $_.Exception "Error attempting to retrieve cluster node information for cluster name\alias: $ClusterName" Write-Error "$exception.Message" Write-Error $exception.InnerException Write-Error $exception.Data Write-Error $exception.StackTrace } } |
Using the cmdlet as displayed…
Read MoreI was in the process of writing a few PowerShell cmdlets for a project I was working on and ran across this cmdlet…
Read MoreA neat feature I just discovered was the -ShowWindow toggle when using Get-Help. This toggle allows you to redirect your output when using…
Read MoreYou can unblock a file downloaded from the Internet using IE as follows:
1 |
Unblock-File -Path ./myfile.zip |
Views – 1818
Read MoreHere are some resources and tools for exploring WMI for PowerShell development: WMI Explorer – SorceForge Views – 1953
Read MoreThis query will return, filter and sort the groups an AD account is a member of:
1 |
Get-ADPrincipalGroupMembership lboveeadm | select name | sort name |
This query will return the AD…
Read More