Ensure data drives are brought online in sysprep’ed VHDX deployments

When deploying multidisk templates in VMM, secondary disks aren’t brougt online.
Before running Sysprep from MDT task sequence, insert “Run Command Line ..” “cmd /c echo san policy=OnlineAll  | Diskpart”

SAN-Policy

Or from a CMD.exe prompt :
SAN-Policy-cmd

If using a PS prompt, make sure the “echo” is enclosed in quotes :

SAN-Policy-PS

 

 

Cluster Shared Volume Info

$Cluster = "XXX"
$csvdata = Get-ClusterSharedVolume -cluster $Cluster
$csvs = @()
foreach ( $csvitem in ($csvdata))
{
   $cimSession = New-CimSession -ComputerName $csvitem.OwnerNode
   $DiskInfo = Get-Disk -CimSession $cimSession 
   $volumeInfo = $DiskInfo | Get-Partition | Select DiskNumber, @{Name="Volume";Expression={Get-Volume -Partition $_ | Select -ExpandProperty ObjectId}}
   $csvVolume = $csvitem.SharedVolumeInfo.Partition.Name
   $csvdisknumber = ($volumeinfo | ? { $_.Volume -eq $csvVolume}).Disknumber
   $DiskID = ($DiskInfo | where {$_.Number -eq $csvdisknumber}).UniqueId
   $csvinfo = $csvitem | select -Property Name -ExpandProperty SharedVolumeInfo
   $csv = [pscustomobject] [ordered]@{
        Name        = $csvitem.Name
        OwnerNode   = $csvitem.OwnerNode
        Path        = $csvinfo.FriendlyVolumeName
        Size        = [int]($csvinfo.Partition.Size /1GB)
        FreeSpace   = [int]($csvinfo.Partition.FreeSpace /1GB)
        UsedSpace   = [int]($csvinfo.Partition.UsedSpace /1GB)
        PercentFree = [int]$csvinfo.Partition.PercentFree
        DiskID      = $DiskId
    }
    $csvs += $csv   
}
$csvs | sort Freespace

Name : CSVxx_LUNyy
OwnerNode : HVHOST-XXX
Path : C:\ClusterStorage\Volume21
Size : 4096
FreeSpace : 1743
UsedSpace : 2353
PercentFree : 43
DiskID : 60060E801652EE00000152EE00000090