PowerShell Logo Small

Connect-VirtualDisk



This is the built-in help made by Microsoft for the command 'Connect-VirtualDisk', in PowerShell version 4 - as retrieved from Windows version 'Microsoft Windows 8.1 Enterprise' PowerShell help files on 2016-06-23.

For PowerShell version 3 and up, where you have Update-Help, this command was run just before creating the web pages from the help files.

SYNOPSIS

Connects a disconnected virtual disk to the specified computer when using the Storage Spaces subsystem.

SYNTAX


Connect-VirtualDisk [-FriendlyName] <String[]> [-AsJob] [-CimSession <CimSession[]>] [-PassThru] [-StorageNodeName <String>] [-ThrottleLimit <Int32>] [<CommonParamete
rs>]
Connect-VirtualDisk [-AsJob] [-CimSession <CimSession[]>] [-PassThru] [-StorageNodeName <String>] [-ThrottleLimit <Int32>] -Name <String[]> [<CommonParameters>]
Connect-VirtualDisk [-AsJob] [-CimSession <CimSession[]>] [-PassThru] [-StorageNodeName <String>] [-ThrottleLimit <Int32>] -InputObject <CimInstance[]> [<CommonParame
ters>]
Connect-VirtualDisk [-AsJob] [-CimSession <CimSession[]>] [-PassThru] [-StorageNodeName <String>] [-ThrottleLimit <Int32>] -UniqueId <String[]> [<CommonParameters>]



Search powershellhelp.space

DESCRIPTION


The Connect-VirtualDisk cmdlet connects a disconnected virtual disk to the specified computer when using the Storage Spaces subsystem.


To connect a virtual disk to a remote computer, from a management node in a subsystem that is registered on the management node, specify the StorageNodeName parameter
.


To connect to a virtual disk to a remote computer, use the CimSession parameter, or use the Enter-PSSession or Invoke-Command cmdlets in conjunction with Connect-Virt
ualDisk.



<

RELATED LINKS

Online Version: http://go.microsoft.com/fwlink/?LinkID=294425
Invoke-Command
Disconnect-VirtualDisk
Get-VirtualDisk
Hide-VirtualDisk
New-VirtualDisk
Remove-VirtualDisk
Repair-VirtualDisk
Resize-VirtualDisk
Set-VirtualDisk
Show-VirtualDisk

REMARKS

<

Examples


Example 1: Connect a virtual disk to the local computer

PS C:\>Connect-VirtualDisk –FriendlyName "VirtualDisk1"



This example connects the virtual disk named VirtualDisk1 to the local computer.




Example 2: Connect all disconnected virtual disks on a remote server

PS C:\>Get-VirtualDisk –CimSession Srv2 | Where-Object -Filter { $_.OperationalStatus -eq "Detached" } | Connect-VirtualDisk



This example uses the Get-VirtualDisk cmdlet to get all virtual disk objects on the computer Srv2 (by using the CimSession parameter). It then pipes the objects to th
e Where-Object cmdlet to filter out all virtual disks except those with the “Detached” operational status. Finally, it pipes these objects to the Connect-VirtualDisk
cmdlet.




Example 3: Connect all disconnected virtual disks on two remote computers by using Invoke-Command

PS C:\>Invoke-Command -ComputerName Srv1, Srv2 -ScriptBlock { Get-VirtualDisk | Where-Object -Filter { $_.OperationalStatus -eq "Detached" } | Connect-VirtualDisk }



This example uses the Invoke-Command cmdlet to run the cmdlets specified in Example 2 (now specified in the ScriptBlock parameter) on multiple remote computers simult
aneously, with all processing done in parallel on each computer and only the results being sent back to the local PowerShell session.




Example 4: Connect a virtual disk to a remote computer from a management node

PS C:\>Get-StorageSubSystem –FriendlyName "Clustered Storage Spaces on Cluster01" | Get-VirtualDisk –FriendlyName "VDisk01" | Connect-VirtualDisk –StorageNodeName "Cl
ustNode1"



This example connects a virtual disk to a remote computer from a management node in a subsystem that is registered on the management node.