Connect-VirtualDisk
Connect-VirtualDisk
Connects a disconnected virtual disk to the specified computer when using the Storage Spaces subsystem.
構文
Parameter Set: ByFriendlyName
Connect-VirtualDisk [-FriendlyName] <String[]> [-AsJob] [-CimSession <CimSession[]> ] [-PassThru] [-StorageNodeName <String> ] [-ThrottleLimit <Int32> ] [ <CommonParameters>]
Parameter Set: ByName
Connect-VirtualDisk -Name <String[]> [-AsJob] [-CimSession <CimSession[]> ] [-PassThru] [-StorageNodeName <String> ] [-ThrottleLimit <Int32> ] [ <CommonParameters>]
Parameter Set: ByUniqueId
Connect-VirtualDisk -UniqueId <String[]> [-AsJob] [-CimSession <CimSession[]> ] [-PassThru] [-StorageNodeName <String> ] [-ThrottleLimit <Int32> ] [ <CommonParameters>]
Parameter Set: InputObject (cdxml)
Connect-VirtualDisk -InputObject <CimInstance[]> [-AsJob] [-CimSession <CimSession[]> ] [-PassThru] [-StorageNodeName <String> ] [-ThrottleLimit <Int32> ] [ <CommonParameters>]
詳細説明
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-VirtualDisk.
パラメーター
-AsJob
エイリアス |
なし |
必須? |
false |
位置は? |
named |
既定値 |
なし |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
-CimSession<CimSession[]>
リモート セッションまたはリモート コンピューターでコマンドレットを実行します。New-CimSession コマンドレットや Get-CimSession コマンドレットの出力など、コンピューター名またはセッション オブジェクトを入力します。既定値は、ローカル コンピューターで実行中の現在のセッションです。
エイリアス |
Session |
必須? |
false |
位置は? |
named |
既定値 |
なし |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
-FriendlyName<String[]>
Specifies the friendly name of the virtual disk that you want to connect.
エイリアス |
なし |
必須? |
true |
位置は? |
1 |
既定値 |
なし |
パイプライン入力を許可する |
True (ByPropertyName) |
ワイルドカード文字を許可する |
false |
-InputObject<CimInstance[]>
Specifies a VirtualDisk object or an array of VirtualDisk objects to connect. Enter a VirtualDisk CIM object or an array of VirtualDisk objects.
エイリアス |
なし |
必須? |
true |
位置は? |
named |
既定値 |
なし |
パイプライン入力を許可する |
True (ByValue) |
ワイルドカード文字を許可する |
false |
-Name<String[]>
Specifies the name of the virtual disk that you want to connect.
エイリアス |
なし |
必須? |
true |
位置は? |
named |
既定値 |
なし |
パイプライン入力を許可する |
True (ByPropertyName) |
ワイルドカード文字を許可する |
false |
-PassThru
Specifies that the cmdlet should output an object representing a virtual disk. By default, this cmdlet does not generate any output.
エイリアス |
なし |
必須? |
false |
位置は? |
named |
既定値 |
なし |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
-StorageNodeName<String>
Specifies the name of a computer on which to run the cmdlet.
Use this parameter only when you run the cmdlet from a management node to connect a virtual disk to a remote cluster subsystem for the purpose of setting the virtual disk to manual-attach. To set a virtual disk to manual-attach, use the Set-VirtualDisk cmdlet and specify the IsManualAttach parameter.
エイリアス |
なし |
必須? |
false |
位置は? |
named |
既定値 |
なし |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
-ThrottleLimit<Int32>
このコマンドレットを実行するために確立できる最大同時操作数を指定します。このパラメーターを省略するか、値として 0
を入力した場合、Windows PowerShell® では、コンピューターで実行している CIM コマンドレットの数に基づいて、コマンドレットに対する最適なスロットル制限を計算します。スロットル制限は現在のコマンドレットのみに適用され、セッションまたはコンピューターには適用されません。
エイリアス |
なし |
必須? |
false |
位置は? |
named |
既定値 |
なし |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
-UniqueId<String[]>
Specifies the UniqueID of the virtual disk to connect.
エイリアス |
Id |
必須? |
true |
位置は? |
named |
既定値 |
なし |
パイプライン入力を許可する |
True (ByPropertyName) |
ワイルドカード文字を許可する |
false |
<CommonParameters>
このコマンドレットは次の共通パラメーターをサポートします。-Verbose、-Debug、-ErrorAction、-ErrorVariable、-OutBuffer、-OutVariable.詳細については、以下を参照してください。 about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216)。
入力
入力型は、コマンドレットにパイプできるオブジェクトの型です。
Microsoft.Management.Infrastructure.CimInstance#ROOT/Microsoft/Windows/Storage/MSFT_VirtualDisk
You can pipe VirtualDisk objects to the InputObject parameter to specify one or more virtual disks to connect to the local computer.
出力
出力型は、コマンドレットによって生成されるオブジェクトの型です。
Microsoft.Management.Infrastructure.CimInstance#ROOT/Microsoft/Windows/Storage/MSFT_VirtualDisk
The Connect-VirtualDisk cmdlet does not output objects unless you use the Passthru parameter, in which case it outputs objects that represent the virtual disks that you connected.
注
Microsoft.Management.Infrastructure.CimInstance
オブジェクトは、Windows Management Instrumentation (WMI) オブジェクトを表示するラッパー クラスです。シャープ記号 (#
) の後のパスは、基になる WMI オブジェクトの名前空間とクラス名です。
例
Example 1: Connect a virtual disk to the local computer
This example connects the virtual disk named VirtualDisk1 to the local computer.
PS C:\> Connect-VirtualDisk –FriendlyName "VirtualDisk1"
Example 2: Connect all disconnected virtual disks on a remote server
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 the 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.
PS C:\> Get-VirtualDisk –CimSession Srv2 | Where-Object -Filter { $_.OperationalStatus -eq "Detached" } | Connect-VirtualDisk
Example 3: Connect all disconnected virtual disks on two remote computers by using Invoke-Command
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 simultaneously, with all processing done in parallel on each computer and only the results being sent back to the local PowerShell session.
PS C:\> Invoke-Command -ComputerName Srv1, Srv2 -ScriptBlock { Get-VirtualDisk | Where-Object -Filter { $_.OperationalStatus -eq "Detached" } | Connect-VirtualDisk }
Example 4: Connect a virtual disk to a remote computer from a management node
This example connects a virtual disk to a remote computer from a management node in a subsystem that is registered on the management node.
PS C:\> Get-StorageSubSystem –FriendlyName "Clustered Storage Spaces on Cluster01" | Get-VirtualDisk –FriendlyName "VDisk01" | Connect-VirtualDisk –StorageNodeName "ClustNode1"