Set-EmcHostDiskReadonlyState

Changes the read-only state for the specified disk.

 

Syntax

 

Parameters

-HostDisk <Disk>

Attributes: Required, Position: named

Specifies the ESI host disk object, which you can get from the ESI host system object or by using the Get-EmcHostDisk or Find-EmcHostDisk cmdlets.

 

-Readonly <SwitchParameter>

Attributes: Required, Position: named

Changes the disk state to read only.

 

-Silent <SwitchParameter>

Attributes: Optional, Position: named

Turns off all the informational and verbose messages. However, it still displays errors.

 

-ReadWrite <SwitchParameter>

Attributes: Required, Position: named

Changes the disk state to read-only.

 

<CommonParameters>

This cmdlet supports these common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, WarningVariable, OutBuffer, and OutVariable. Type get-help about_commonparameters for more details.

 

Examples

-------------- Example 1 --------------

C:\PS>$h = Get-EmcHostSystem *.148

C:\PS>$h | Update-EmcSystem -Silent

C:\PS>$h.HostDisks | select hostdiskidentifier

HostDiskIdentifier

------------------

\\?\PhysicalDrive4

\\?\PhysicalDrive7

\\?\PhysicalDrive1

\\?\PhysicalDrive2

\\?\PhysicalDrive3

\\?\PhysicalDrive5

\\?\PhysicalDrive6

 

C:\PS>$hd = $h.HostDisks[1]

C:\PS>Set-EmcHostDiskReadonlyState -Readonly -HostDisk $hd

This example changes the disk state to read-only.

 

-------------- Example 2 --------------

C:\PS>C:\PS>$h = Get-EmcHostSystem *.148

C:\PS>$h.RefreshDisks()

C:\PS>$h.HostDisks | select hostdiskidentifier

HostDiskIdentifier

------------------

\\?\PhysicalDrive4

\\?\PhysicalDrive7

\\?\PhysicalDrive1

\\?\PhysicalDrive2

\\?\PhysicalDrive3

\\?\PhysicalDrive5

\\?\PhysicalDrive6

 

C:\PS>$hd = $h.HostDisks[1]

C:\PS>Set-EmcHostDiskReadonlyState -HostDisk $hd -ReadWrite

This example changes the disk state to read and write.