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

Mapping Logical disks to a cluster node

$
0
0

Hi

I have got this script apparently supposed to help me get the win32_logicaldiskstopartition function to work. But it does not return any results. But, when I run the same logic using wbemtest utility I see proper mappings.

Can somebody take a look and help me please>

$computerSystem = Get-WmiObject Win32_ComputerSystem

$nodeName = $computerSystem.Name;

 

Write-Output "Current Node: $nodeName"

$logicalDisks = (Get-WmiObject -namespace "root\cimv2" -class "Win32_LogicalDisk") |Where-Object{($_.VolumeName -like '*Actifio*')}

write-output $logicaldisks

 

$availableClusterDisks = Get-WmiObject -namespace "root\mscluster" -class "MSCluster_AvailableDisk" 

Write-Host $availableClusterDisks

 

foreach ($logicalDisk in $logicalDisks)

{ # Write-Output $logicalDisk}

        #$diskPartitions = $logicalDisk.GetRelated("Win32_LogicalDiskToPartition")

       $diskPartitions= $logicalDisk.GetRelated("Win32_logicaldisktopartition")

        foreach ($diskPartition in $diskPartitions)

            {Write-Output $diskPartition

            }

 

            } 


Viewing all articles
Browse latest Browse all 6937

Trending Articles