Set-SCVirtualHardDisk

Set-SCVirtualHardDisk

Changes the properties of a virtual hard disk object used in VMM.

Syntax

Parameter Set: Default
Set-SCVirtualHardDisk [-VirtualHardDisk] <VirtualHardDisk> [-Description <String> ] [-Enabled <Boolean> ] [-FamilyName <String> ] [-JobGroup <Guid]> ] [-JobVariable <String> ] [-Name <String> ] [-OperatingSystem <OperatingSystem> ] [-Owner <String> ] [-ProductKey <String> ] [-PROTipID <Guid]> ] [-Release <String> ] [-RunAsynchronously] [-SharePath <String> ] [-Tag <List`1> ] [-UserRole <UserRole> ] [-VirtualizationPlatform <VirtualizationPlatform> {Unknown | VirtualServer | HyperV | VMWareVC | VMWareESX | XENServer} ] [-VMMServer <ServerConnection> ] [ <CommonParameters>]

Parameter Set: EquivalencySet
Set-SCVirtualHardDisk [-VirtualHardDisks] <List`1> -FamilyName <String> -Release <String> [-JobVariable <String> ] [-PROTipID <Guid]> ] [-RunAsynchronously] [-VMMServer <ServerConnection> ] [ <CommonParameters>]

Detailed Description

The Set-SCVirtualHardDisk cmdlet changes one or more properties of a virtual hard disk object used in a Virtual Machine Manager (VMM) environment. A virtual hard disk file used in VMM is either a Windows-based .vhd file, a Citrix XenServer-based .vhd file, or a VMware-based .vmdk file.

Properties that you can change include:

-- Description
-- Enabled
-- Name
-- Operating System
-- Owner
-- SharePath

A virtual hard disk file might be stored in the VMM library, or it might be attached to a virtual disk drive on a virtual machine or template.

To change the Bus and LUN settings for a virtual disk drive, use the Set-SCVirtualDiskDrive cmdlet.

Parameters

-Description<String>

States a description for the specified object.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Enabled<Boolean>

Indicates whether to enable an object when set to $True, or disables an object when set to $False. For example, if you want to upgrade software on a virtual machine template, you can disable the template object in the VMM library to temporarily prevent users from using that object.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-FamilyName<String>

Specifies a family name for a physical resource in the VMM library. This value is used in conjunction with Release, Namespace, and Type to establish equivalency among library resources.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-JobGroup<Guid]>

Specifies an identifier for a series of commands that will run as a set just before the final command that includes the same job group identifier runs.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-JobVariable<String>

Specifies that job progress is tracked and stored in the variable named by this parameter.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Name<String>

Specifies the name of a VMM object.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-OperatingSystem<OperatingSystem>

Specifies the type of operating system for a virtual machine. To list the names of all available operating systems in VMM, type Get-SCOperatingSystem.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Owner<String>

Specifies the owner of a VMM object in the form of a valid domain user account.

Example format: -Owner "Contoso\ReneeLo"

Example format: -Owner "ReneeLo@Contoso"

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-ProductKey<String>

Specifies a product key. The product key is a 25-digit number that identifies the product license. A product key can be used to register VMM or an operating system to be installed on a virtual machine or host.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-PROTipID<Guid]>

Specifies the ID of the PRO tip that triggered this action. This allows for auditing of PRO tips.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Release<String>

Specifies a string that describes the release of a library resource. VMM automatically creates a release value for every resource imported into the library. After the resource has been imported, the string can be customized.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-RunAsynchronously

Indicates that the job runs asynchronously so that control returns to the command shell immediately.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-SharePath<String>

Specifies a path to a valid library share on an existing library server that uses a Universal Naming Convention (UNC) path.

Example format: -SharePath "\\LibServer01\LibShare"

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Tag<List`1>

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-UserRole<UserRole>

Specifies a user role object.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-VirtualHardDisk<VirtualHardDisk>

Specifies a virtual hard disk object.

Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

True (ByValue)

Accept Wildcard Characters?

false

-VirtualHardDisks<List`1>

Specifies an array of virtual hard disk objects.

Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

True (ByValue)

Accept Wildcard Characters?

false

-VirtualizationPlatform<VirtualizationPlatform>

Specifies the virtualization platform of a virtual machine host managed by VMM. Valid values are:

-- HyperV
-- VMwareESX
-- XENServer

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-VMMServer<ServerConnection>

Specifies a VMM server object.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByValue)

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see    about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

Outputs

The output type is the type of the objects that the cmdlet emits.

  • VirtualHardDisk

Notes

  • This cmdlet requires a VMM virtual hard disk object, which can be retrieved by using the Get-SCVirtualHardDisk cmdlet.

Examples

Example Example 1: Change the description of a virtual hard disk.

The first command retrieves the virtual hard disk object named WindowsServer2003BootVHD.vhd from the library on VMMServer01, and then stores the object in the $VHD variable.

The second command changes the description of the virtual hard disk object stored in $VHD to Latest Windows Server 2008 R2 Boot VHD.

PS C:\> $VHD = Get-SCVirtualHardDisk -VMMServer "VMMServer01.Contoso.com" | where { $_.LibraryServer.Name -eq "LibraryServer01.Contoso.com" -and $_.Name -eq "WindowsServer2008R2BootVHD.vhd"}
PS C:\> Set-SCVirtualHardDisk -VirtualHardDisk $VHD -Description "Latest Windows Server 2008 R2 Boot VHD" 

Example Example 2: Enable a VMware-based virtual hard disk in the library.

The first command gets the virtual hard disk object named WindowsServer2008.vmdk, and then stores the virtual hard disk object in the $VMDK variable.

The second command disables the virtual hard disk object stored in $VMDK.

PS C:\> $VMDK = Get-SCVirtualHardDisk -VMMServer "VMMServer01.Contoso.com" | where { $_.LibraryServer.Name -eq "LibraryServer01.Contoso.com" -and $_.Name -eq "WindowsServer2008.vmdk"}
PS C:\> Set-SCVirtualHardDisk -VirtualHardDisk $VMDK -Enabled $FALSE

Example Example 3: Specify an owner for all virtual hard disks with an "Unknown" owner.

This command gets all virtual hard disk objects from the VMM library whose owner is Unknown, and then specifies an owner for each virtual hard disk object.

PS C:\> Get-SCVirtualHardDisk -VMMServer "VMMServer01.Contoso.com" | where {$_.Owner -eq "Unknown"} | Set-SCVirtualHardDisk -Owner "Contoso\ReneeLo"

Compress-SCVirtualDiskDrive

Convert-SCVirtualDiskDrive

Expand-SCVirtualDiskDrive

Get-SCVirtualDiskDrive

New-SCVirtualDiskDrive

Remove-SCVirtualDiskDrive

Set-SCVirtualDiskDrive

Get-SCVirtualHardDisk

Move-SCVirtualHardDisk

Remove-SCVirtualHardDisk