Cmdlets

Choose a cmdlet from the list on the left or search for a specific cmdlet. Choose a cmdlet from the list or search for a specific cmdlet.
About Help  Providers
 

Add-VirtualDiskToMaskingSet

Add-VirtualDiskToMaskingSet

maskingset.cdxml

Synopsis

Adds a virtual disk to a specified masking set and grants access to the virtual disk to all initiator IDs defined in the masking set.

Syntax

Add-VirtualDiskToMaskingSet [-MaskingSetFriendlyName] [-AsJob] [-CimSession] [-DeviceAccesses] [-DeviceNumbers] [-PassThru] [-ThrottleLimit] [-VirtualDisknames] [-Confirm] [-WhatIf] [<CommonParameters>]

Add-VirtualDiskToMaskingSet [-AsJob] [-CimSession] [-DeviceAccesses] [-DeviceNumbers] [-PassThru] [-ThrottleLimit] [-VirtualDisknames] [-InputObject] [-Confirm] [-WhatIf] [<CommonParameters>]

Add-VirtualDiskToMaskingSet [-AsJob] [-CimSession] [-DeviceAccesses] [-DeviceNumbers] [-PassThru] [-ThrottleLimit] [-VirtualDisknames] [-MaskingSetUniqueId] [-Confirm] [-WhatIf] [<CommonParameters>]

Detailed Description

The Add-VirtualDiskToMaskingSet cmdlet adds a virtual disk to a specified masking set and grants access to the virtual disk to all initiator IDs defined in the masking set.

This cmdlet is not needed when using the Storage Spaces subsystem.

Parameters

-AsJob <SwitchParameter>

Runs the cmdlet as a background job. Use this parameter to run commands that take a long time to complete. The cmdlet immediately returns an object that represents the job and then displays the command prompt. You can continue to work in the session while the job completes. To manage the job, use the *-Job cmdlets. To get the job results, use the Receive-Job cmdlet. For more information about Windows PowerShell® background jobs, see about_Jobs.

Aliases

None

Required?

false

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-CimSession <CimSession[]>

Runs the cmdlet in a remote session or on a remote computer. Enter a computer name or a session object, such as the output of a New-CimSession or Get-CimSession cmdlet. The default is the current session on the local computer.

Aliases

Session

Required?

false

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-DeviceAccesses <DeviceAccess[]>

Specifies the way in which initiators can access the virtual disk(s) that are part of this masking set. You must specify a DeviceAccesses value for each virtual disk specified by the VirtualDiskNames parameter. Allowed values are NoAccess, ReadOnly, ReadWrite, and Unknown

Aliases

None

Required?

false

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-DeviceNumbers <UInt16[]>

Specifies the device numbers for one or more virtual disks.

Aliases

None

Required?

false

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-InputObject <CimInstance[]>

Specifies the MaskingSet object to which you want to a virtual disk. Specify a MaskingSet CIM object, which are output by the Get-MaskingSet and New-MaskingSet cmdlets.

Aliases

None

Required?

true

Position

named

Default value

None

Accept pipeline input?

True (ByValue)

Accept wildcard characters?

false

-MaskingSetFriendlyName <String[]>

Specifies the friendly name of the masking set to which you want to add a virtual disk.

Aliases

None

Required?

true

Position

1

Default value

None

Accept pipeline input?

True (ByPropertyName)

Accept wildcard characters?

false

-MaskingSetUniqueId <String[]>

Specifies an UniqueID of the masking set to which you want to add a virtual disk.

Aliases

Id

Required?

true

Position

named

Default value

None

Accept pipeline input?

True (ByPropertyName)

Accept wildcard characters?

false

-PassThru <SwitchParameter>

Specifies that the cmdlet should output an object representing the masking set to which it added a virtual disk. By default, this cmdlet does not generate any output.

Aliases

None

Required?

false

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-ThrottleLimit <Int32>

Specifies the maximum number of concurrent operations that can be established to run the cmdlet. If this parameter is omitted or a value of 0 is entered, then Windows PowerShell® calculates an optimum throttle limit for the cmdlet based on the number of CIM cmdlets that are running on the computer. The throttle limit applies only to the current cmdlet, not to the session or to the computer.

Aliases

None

Required?

false

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-VirtualDisknames <String[]>

Specifies one or more virtual disk names that are to be added to the masking set.

Aliases

None

Required?

false

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-Confirm <SwitchParameter>

Prompts you for confirmation before running the cmdlet.

Aliases

None

Required?

false

Position

named

Default value

false

Accept pipeline input?

false

Accept wildcard characters?

false

-WhatIf <SwitchParameter>

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Aliases

None

Required?

false

Position

named

Default value

false

Accept pipeline input?

false

Accept wildcard characters?

false

Input Type

Microsoft.Management.Infrastructure.CimInstance#ROOT/Microsoft/Windows/Storage/MSFT_MaskingSet

Return Type

Microsoft.Management.Infrastructure.CimInstance#ROOT/Microsoft/Windows/Storage/MSFT_MaskingSet

Notes

None

Examples

Example 1: Add a virtual disk to an existing masking set

This example adds the virtual disks named Volume12 to a masking set named Cluster1MaskingSet, and sets the device access to read-write.

PS C:\> $maskingSet = Get-MaskingSet Cluster1MaskingSet
PS C:\> $virtualDisk = Get-VirtualDisk Volume12
PS C:\> $maskingSet | Add-VirtualDiskToMaskingSet -VirtualDisknames $virtualDisk.Name -DeviceAccesses ReadWrite

Online Version
Get-MaskingSet
Get-VirtualDisk