Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

How to retreive the groupcomponent of MSCluster_ClusterSharedVolumeToPartition

$
0
0

I'm trying to find the CSV information by using the below WQL query. I pass in disk partition information to fetch the CSV information.

$connection =New-Object-TypeNameSystem.Management.ConnectionOptions
	$connection.Impersonation="Impersonate"
	$connection.Authentication="PacketPrivacy"if($username -ne ""-and $password -ne ""){
		$connection.Username= $username
		$connection.Password= $password
		$connection.EnablePrivileges= $True}
	$scope =New-Object-TypeNameSystem.Management.ManagementScope-ArgumentList"root/MSCluster", $connection
	$query =New-Object-TypeNameSystem.Management.ObjectQuery-ArgumentList"SELECT * FROM MSCluster_ClusterSharedVolumeToPartition WHERE PartComponent='MSCluster_DiskPartition.Path="\\\\?\\Volume{078e89b7-fgb8-4643-4594-83j75fdb451a}\\"'"
	$search =New-Object-TypeNameSystem.Management.ManagementObjectSearcher-ArgumentList $scope, $querytry{return $search.Get();}catch[Exception]{Write-Host $_.Exception.Messagereturn $false}

But doesn't seem to be working. It complains 'Invalid Query'. I'm i missing the string formatting ?.


Viewing all articles
Browse latest Browse all 6937

Trending Articles