Export (0) Print
Expand All
Expand Minimize

Set-SCVirtualMachine

Updated: April 29, 2014

Applies To: System Center 2012 R2 Virtual Machine Manager

Set-SCVirtualMachine

Changes properties of a virtual machine managed by VMM.

Syntax

Parameter Set: SingleVM
Set-SCVirtualMachine [-VM] <VM> [-AvailabilitySetNames <List<String>> ] [-BlockDynamicOptimization <Boolean> ] [-BootOrder {Floppy | CD | IdeHardDrive | PxeBoot | Unknown}[] ] [-CapabilityProfile <CapabilityProfile> ] [-ClearDRProtection] [-Cloud <Cloud> ] [-ClusterNonPossibleOwner <List<Host>> ] [-ClusterPreferredOwner <List<Host>> ] [-CostCenter <String> ] [-CPUCount <Byte> ] [-CPUExpectedUtilizationPercent <Int32> ] [-CPULimitForMigration <Boolean> ] [-CPULimitFunctionality <Boolean> ] [-CPUMaximumPercent <Int32> ] [-CPUPerVirtualNumaNodeMaximum <Byte> ] [-CPURelativeWeight <Int32> ] [-CPUReserve <Int32> ] [-CPUType <ProcessorType> ] [-Custom1 <String> ] [-Custom10 <String> ] [-Custom2 <String> ] [-Custom3 <String> ] [-Custom4 <String> ] [-Custom5 <String> ] [-Custom6 <String> ] [-Custom7 <String> ] [-Custom8 <String> ] [-Custom9 <String> ] [-DelayStartSeconds <Int32> ] [-Description <String> ] [-DiskIops <Int32> ] [-DRProtectionRequired <Boolean> ] [-DynamicMemoryBufferPercentage <Int32> ] [-DynamicMemoryEnabled <Boolean> ] [-DynamicMemoryMaximumMB <Int32> ] [-DynamicMemoryMinimumMB <Int32> ] [-EnableBackup <Boolean> ] [-Enabled <Boolean> ] [-EnableDataExchange <Boolean> ] [-EnableHeartbeat <Boolean> ] [-EnableOperatingSystemShutdown <Boolean> ] [-EnableTimeSync <Boolean> ] [-FirstBootDevice <String> ] [-HAVMPriority <UInt32> ] [-HighlyAvailable <Boolean> ] [-InstallVirtualizationGuestServices <Boolean> ] [-JobGroup <Guid> ] [-JobVariable <String> ] [-MemoryMB <Int32> ] [-MemoryPerVirtualNumaNodeMaximumMB <Int32> ] [-MemoryWeight <Int32> ] [-MonitorMaximumCount <Int32> ] [-MonitorMaximumResolution <String> ] [-Name <String> ] [-NetworkUtilizationMbps <Int32> ] [-NumaIsolationRequired <Boolean> ] [-NumLock <Boolean> ] [-OperatingSystem <OperatingSystem> ] [-Owner <String> ] [-PROTipID <Guid> ] [-QuotaPoint <UInt32> ] [-RecoveryPointObjective <Int32> ] [-RemoveCapabilityProfile] [-RemoveFromCloud] [-RemoveSelfServiceUserRole <Boolean> ] [-RunAsSystem] [-RunAsUserCredential <PSCredential> ] [-RunAsynchronously] [-SecureBootEnabled <Boolean> ] [-StartAction <VMStartAction> {NeverAutoTurnOnVM | AlwaysAutoTurnOnVM | TurnOnVMIfRunningWhenVSStopped} ] [-StopAction <VMStopAction> {SaveVM | TurnOffVM | ShutdownGuestOS} ] [-Tag <String> ] [-UseHardwareAssistedVirtualization <Boolean> ] [-UserRole <UserRole> ] [-VirtualNumaNodesPerSocketMaximum <Byte> ] [-VirtualVideoAdapterEnabled <Boolean> ] [-VMwareResourcePool <VmwResourcePool> ] [ <CommonParameters>]




Detailed Description

The Set-SCVirtualMachine cmdlet changes one or more properties of a virtual machine managed by Virtual Machine Manager (VMM). Properties that you can change include the following:

-- Associate a virtual machine with a cloud.
-- Name, owner, and description of a virtual machine.
-- BIOS boot order (if deployed on a Hyper-V host).
-- Amount of resources on the host used by a virtual machine. These include:
-- Maximum amount of host CPU resources that a virtual machine can use.
-- Expected use of host CPU by a virtual machine.
-- Amount of host CPU resources used by one virtual machine relative to other virtual machines on the same host.
-- Amount of host memory that a virtual machine can use.
-- Amount of bandwidth on the host's network that a virtual machine can use.
-- Hardware settings for a virtual machine unrelated to host resources. These include:
-- Number of CPUs.
-- Type of CPU.
-- Number of disk input/output operations per second (IOPS).
-- Limiting CPU functionality (for an older operating system, such as Windows NT 4.0).
-- Cost center, tag, and custom settings used to filter virtual machines by criteria.
-- Settings that enable various optional capabilities, including:
-- Enabling or disabling a library object to make it available, or temporarily unavailable, to users.
-- Enabling backing up a virtual machine on a Hyper-V host with Volume Shadow Copy service.
-- Enabling a key/value pair for data exchange between a virtual machine and its Hyper-V host.
-- Enabling shutdown of a virtual machine from the Hyper-V console.
-- Enabling time synchronization between a virtual machine and its Hyper-V host.
-- Enabling the BIOS value for NumLock for a virtual machine on a Hyper-V host.
-- Setting that identifies whether a virtual machine is highly available, that is, a virtual machine to be deployed on a node of a Hyper-V host cluster or a Citrix XenServer host cluster.
-- Setting that determines whether virtualization guest services are installed on a virtual machine deployed on a Hyper-V host.
-- Number of seconds to delay before starting a virtual machine.
-- Setting that identifies the operating system used for a virtual machine.
-- Start and stop actions for a virtual machine.
-- Setting that limits the number of virtual machines self-service users can create.
-- Setting used to switch the role that a self-service user who belongs to multiple roles uses to manage a virtual machine.
-- Setting that assigns a virtual machine on an ESX host to a VMware resource pool.

If you want to change the properties of a virtual floppy drive, virtual DVD drive, virtual network adapter, or virtual SCSI adapter associated with a specific virtual machine, use the Set-SCVirtualFloppyDrive, Set-SCVirtualDVDDrive, Set-SCVirtualNetworkAdapter, or Set-SCVirtualScsiAdapter cmdlets, respectively.

Parameters

-AvailabilitySetNames<List<String>>

Specifies a list of availability set names.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-BlockDynamicOptimization<Boolean>

Indicates whether dynamic optimization is blocked for a virtual machine.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-BootOrder<BootDevice[]>

Specifies the order of devices that a virtual machine on a Hyper-V host uses to start up. Valid values are:

-- CD
-- IDEHardDrive
-- PXEBoot
-- Floppy

Example format: -BootOrder PXEBoot,IDEHardDrive,CD,Floppy


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-CapabilityProfile<CapabilityProfile>

Specifies a capability profile object.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-ClearDRProtection

Indicates that this cmdlet resets the disaster recovery protection option.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Cloud<Cloud>

Specifies a private cloud object.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-ClusterNonPossibleOwner<List<Host>>

Specifies a list of names of the non-possible cluster node owners for a specified virtual machine.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-ClusterPreferredOwner<List<Host>>

Specifies a list of names of the preferred cluster node owners for a particular virtual machine.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-CostCenter<String>

Specifies the cost center for a virtual machine so that you can collect data about the allocation of virtual machines, or resources allocated to virtual machines, to make use of in your billing system.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-CPUCount<Byte>

Specifies the number of CPUs on a virtual machine, on a hardware profile, or on a template. See the examples for a specific cmdlet to determine how that cmdlet uses this parameter.

-- Hyper-V. Up to four CPUs per virtual machine, depending on guest operating system.
-- VMware ESX. Up to four CPUs per virtual machine for any supported guest operating system, except for a virtual machine that runs Windows NT 4.0, which supports one CPU.
-- Citrix XenServer. Up to eight CPUs per virtual machine, depending on guest operating system.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-CPUExpectedUtilizationPercent<Int32>

Specifies the percent of CPU on the host that you expect this virtual machine to use. This value is used only when VMM determines a suitable host for the virtual machine.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-CPULimitForMigration<Boolean>

Indicates whether to limit, when set to $True, processor features for the specified virtual machine in order to enable migration to a physical computer that has a different version of the same processor as the source computer. VMM does not support migrating virtual machines between physical computers that have processors from different manufacturers.


Aliases

LimitCPUForMigration

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-CPULimitFunctionality<Boolean>

Indicates whether to enable an older operating system, such as Windows NT 4.0, on a virtual machine deployed on a Hyper-V host or on a VMware ESX host by providing limited CPU functionality for the virtual machine.


Aliases

LimitCPUFunctionality

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-CPUMaximumPercent<Int32>

Specifies the highest percentage of the total resources of a single CPU on the host that can be used by a specific virtual machine at any given time.

Example format to specify 80 percent: -CPUMaximumPercent 80


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-CPUPerVirtualNumaNodeMaximum<Byte>

Specifies the maximum number of CPUs allowed for each virtual NUMA node.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-CPURelativeWeight<Int32>

Specifies the amount of CPU resources on a host that this virtual machine can use relative to other virtual machines on the same host. A virtual machine with a higher setting is allocated more CPU resources than a virtual machine with a lower setting. The range of relative values for each type of host are:

Hyper-V: 1 to 10000

VMware ESX: 2000 = High

1500 = Above Normal

1000 = Normal (default)

750 = Below Normal

500 = Low

1 to 1000000 = Custom

The VMware term for these values is shares.

Citrix XenServer: 1 to 65536, normal is 256

NOTE: See the examples for a specific cmdlet to determine how that cmdlet uses this parameter.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-CPUReserve<Int32>

Specifies the minimum percentage of the resources of a single CPU on the host to allocate to a virtual machine. The percentage of CPU capacity that is available to the virtual machine is never less than this percentage.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-CPUType<ProcessorType>

Specifies the type of CPU for a virtual machine. To retrieve a list of all CPU types that are available for use in virtual machines in a VMM environment, type Get-SCCPUType.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Custom1<String>

Specifies a custom property on a VMM object.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Custom10<String>

Specifies a custom property on a VMM object.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Custom2<String>

Specifies a custom property on a VMM object.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Custom3<String>

Specifies a custom property on a VMM object.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Custom4<String>

Specifies a custom property on a VMM object.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Custom5<String>

Specifies a custom property on a VMM object.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Custom6<String>

Specifies a custom property on a VMM object.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Custom7<String>

Specifies a custom property on a VMM object.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Custom8<String>

Specifies a custom property on a VMM object.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Custom9<String>

Specifies a custom property on a VMM object.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-DelayStartSeconds<Int32>

Specifies the number of seconds to wait after the virtualization service starts before automatically starting a virtual machine. This delay is used to stagger the startup time of multiple virtual machines to help reduce the demand on the physical computer resources. A typical setting might be 30 to 60 seconds.

The maximum configurable delay is:

Hyper-V: 1000000000 seconds (277777 hours)

VMware ESX: 65535 seconds (18 hours)

Citrix XenServer: Does not apply to XenServer virtual machines.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-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

-DiskIops<Int32>

Specifies the number of disk input/output operations per second (IOPS) on the host that can be used by a specific virtual machine.

Example format to specify 1500 IOPS: -DiskIops 1500


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-DRProtectionRequired<Boolean>

This parameter is reserved for future use.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-DynamicMemoryBufferPercentage<Int32>

Specifies the percentage of memory above a virtual machine’s current memory allocation which the host should try to reserve as a buffer. The default value is 20.

Example format: -DynamicMemoryBufferPercentage 20


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-DynamicMemoryEnabled<Boolean>

Indicates whether to enable, when set to $True, dynamic memory for virtual machines. You can enable dynamic memory directly on a virtual machine, or on a template or hardware profile that you use to create virtual machines. The default value is $False.

REQUIRED: You can enable dynamic memory for a virtual machine only if that virtual machine is deployed on a host running Windows Server 2008 SP1 or later or if the virtual machine is stored in a library in a stopped state (hardware changes to a stored virtual machine can only be made if the virtual machine does not have snapshots). Enabling dynamic memory on a virtual machine stored in a library will limit placement of that machine to hosts running Windows Server 2008 SP1 or later.

Example format: -DynamicMemoryEnabled $True


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-DynamicMemoryMaximumMB<Int32>

Specifies the maximum amount of memory that can be allocated to a virtual machine if dynamic memory is enabled. The default value is 65536.

REQUIRED: You can enable dynamic memory for a virtual machine only if that virtual machine is deployed on a host running Windows Server 2008 R2 SP1 or later or if the virtual machine is stored in a library in a stopped state (hardware changes to a stored virtual machine can only be made if the virtual machine does not have snapshots). Enabling dynamic memory on a virtual machine stored in a library will limit placement of that machine to hosts running Windows Server 2008 R2 SP1 or later.

Example format: -DynamicMemoryMaximumMB 1024


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-DynamicMemoryMinimumMB<Int32>

Specifies the minimum amount of memory that can be allocated to a virtual machine if dynamic memory is enabled. The default value is 65536.

REQUIRED: You can enable dynamic memory for a virtual machine only if that virtual machine is deployed on a host running Windows Server 2008 R2 SP1 or later or if the virtual machine is stored in a library in a stopped state (hardware changes to a stored virtual machine can only be made if the virtual machine does not have snapshots). Enabling dynamic memory on a virtual machine stored in a library will limit placement of that machine to hosts running Windows Server 2008 R2 SP1 or later.

Example format: -DynamicMemoryMinimumMB 1024


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-EnableBackup<Boolean>

Indicates whether to enable the use of the Volume Shadow Copy service to back up a virtual machine if the virtual machine is deployed on a Hyper-V host.


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

-EnableDataExchange<Boolean>

Indicates whether to enable the use of a key/value pair for the exchange of data between a virtual machine and the host operating system if the virtual machine is deployed on a Hyper-V host.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-EnableHeartbeat<Boolean>

Indicates whether to enable the use of a heartbeat, which is a signal emitted at regular intervals, to monitor the health of a virtual machine deployed on a Hyper-V host.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-EnableOperatingSystemShutdown<Boolean>

Indicates whether to enable the shut-down of the operating system on a virtual machine managed by VMM from Hyper-V management interfaces on the host if the virtual machine is deployed on a Hyper-V host.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-EnableTimeSync<Boolean>

Indicates whether to synchronize the system time of a virtual machine with the system time of the operating system running on the host if the virtual machine is deployed on a Hyper-V host.


Aliases

EnableTimeSynchronization

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-FirstBootDevice<String>

Specifies the device on which a boot is first attempted.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-HAVMPriority<UInt32>

Specifies the virtual machine priority. Virtual machines are started in priority order up to the limits of a host cluster node. Valid input for this parameter is a numerical representation of the priority:

3000 = High

2000 = Medium

1000 = Low

0 - Virtual machine does not restart automatically.

Example format: -HAVMPriority 2000


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-HighlyAvailable<Boolean>

Specifies whether a virtual machine will be placed on a Hyper-V host that is part of a host cluster. Configure this setting on a virtual machine, or on a template or hardware profile that you use to create virtual machines.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-InstallVirtualizationGuestServices<Boolean>

Indicates whether to install virtualization guest services on a Windows-based virtual machine. By default, this parameter is set to $False and VMM installs the appropriate virtualization guest service automatically. For a virtual machine on a Hyper-V host, the virtualization guest service is called Integration Components (VMGuest.iso). For a virtual machine on a XenServer host, the virtualization guest service is called Citrix Tools for Virtual Machines (xs-tools.iso). Virtual machines on a VMware ESX host do not use a virtualization guest service.


Aliases

none

Required?

false

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

-MemoryMB<Int32>

Specifies, in megabytes (MB), the amount of random access memory (RAM) on the host that is allocated to a virtual machine. The default value is 512 MB. For a virtual machine on which dynamic memory is enabled on a host running Windows Server 2008 R2 SP1 or later, use MemoryMB to specify the startup memory value. The maximum host memory assignable to a virtual machine is:

-- Hyper-V: Up to 65536 MB RAM per virtual machine.
-- VMware ESX Server 3.0.x: Up to 16384 MB RAM per virtual machine.
-- VMware ESX Server 3.5.x: Up to 65532 MB RAM per virtual machine.
-- Citrix XenServer: Up to 32265 MB RAM per virtual machine.

Example format: -MemoryMB 1024


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-MemoryPerVirtualNumaNodeMaximumMB<Int32>

Specifies the maximum amount of memory, in MB, that each virtual NUMA node is allowed.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-MemoryWeight<Int32>

Indicates the priority in allocating memory to a virtual machine, relative to other virtual machines on the same host. A virtual machine with a higher setting is allocated more memory resources than a virtual machine with a lower setting. For a host running Windows Server 2008 R2 SP1 or later:

5000 = Normal

10000 = High

0 = Low

1 to 10000 = Custom

NOTE: See the examples for a specific cmdlet to determine how that cmdlet uses this parameter.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-MonitorMaximumCount<Int32>

Specifies the maximum number of monitors supported by a virtual video adapter.

Example format: -MonitorMaximumCount 3


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-MonitorMaximumResolution<String>

Specifies, as a string, the value that represents the maximum possible monitor resolution of a virtual video adapter. Valid values are:

-- 1024x768
-- 1280x1024
-- 1600x1200
-- 1920x1200

The default value is 1280x1024.

Example format: -MonitorMaximumResolution "1600x1200"


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

-NetworkUtilizationMbps<Int32>

Specifies, in megabits per second (Mbps), the amount of bandwidth on the host's network that can be used by a specific virtual machine.

Example format: -NetworkUtilizationMbps 10


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-NumaIsolationRequired<Boolean>

Indicates whether NUMA isolation is required.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-NumLock<Boolean>

Indicates whether to enable the BIOS value for NumLock on a virtual machine (or on a template or hardware profile that is used to create virtual machines) on a Hyper-V host. This parameter does not apply to virtual machines on VMware ESX hosts or on Citrix XenServer hosts.


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?

True (ByValue)

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

-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

-QuotaPoint<UInt32>

Specifies a quota that limits the number of virtual machines self-service users can deploy.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-RecoveryPointObjective<Int32>

Specifies the maximum period for which it is tolerable to lose data from an IT service due to a major incident.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-RemoveCapabilityProfile

Indicates that this cmdlet removes one or more specified capability profile objects.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-RemoveFromCloud

Indicates that this cmdlet removes the association a virtual machine has with a cloud.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-RemoveSelfServiceUserRole<Boolean>

Indicates whether to remove the specified self-service user role from the permission list of the virtual machine.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-RunAsSystem

Indicates that a virtual machine runs under the local system account.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-RunAsUserCredential<PSCredential>

Specifies the guest account (domain\account) that a virtual machine runs under. For enhanced security, create a special account with limited permissions.

The minimum required permissions for a guest account are:

.vmc file: Read Data, Write Data, Execute File

.vmc folder: List Folder, Write/Create File (required to save VM state)

.vhd file: Read Data, Read Attributes, Read Extended Attributes, Write Data

.vnc file: Execute File, Read Data, Read Attributes, Read (required if VM connects to a virtual network)

Note: This parameter does not apply to virtual machines on Hyper-V, VMware ESX hosts or Citrix XenServer hosts.


Aliases

none

Required?

false

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

-SecureBootEnabled<Boolean>

Indicates whether secure booting is enabled.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-StartAction<VMStartAction>

Specifies the behavior of a virtual machine when the virtualization service (Hyper-V, VMware, or XenServer) starts. Valid values are:

-- AlwaysAutoTurnOnVM
-- NeverAutoTurnOnVM
-- TurnOnVMIfRunningWhenVSStopped


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-StopAction<VMStopAction>

Specifies the behavior of the virtual machine when the virtualization service (Hyper-V, VMware, or XenServer) stops. Valid values are:

-- SaveVM
-- TurnOffVM
-- ShutdownGuestOS


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Tag<String>

Specifies a word or phrase to associate with an object so that you can search for all objects with the specified set of tags. You can search for a subset of tags, or you can search for the full set of tags.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-UseHardwareAssistedVirtualization<Boolean>

Indicates whether hardware-assisted virtualization is used if it is available.


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

-VirtualNumaNodesPerSocketMaximum<Byte>

Specifies the maximum number of NUMA nodes allowed for each socket.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-VirtualVideoAdapterEnabled<Boolean>

Indicates whether to enable, when set to $True, the Microsoft Synthetic 3D Virtual Video Adapter for virtual machines. You can enable the Virtual Video Adapter directly on a virtual machine, or on a template or hardware profile that will be used to create virtual machines.

REQUIRED: You can enable the Microsoft Synthetic 3D Virtual Video Adapter for a virtual machine only if that virtual machine is deployed on a host running Windows Server 2008 R2 SP1 (with the Remote Desktop Services role and Remote Desktop Virtual Graphics role service installed) or later or if the virtual machine is stored in a library in a stopped state (hardware changes to a stored virtual machine can only be made if the virtual machine does not have snapshots). Enabling the Microsoft Synthetic 3D Virtual Video Adapter on a virtual machine stored in a library will limit placement of that machine to hosts running Windows Server 2008 R2 SP1 (with the Remote Desktop Services role and Remote Desktop Virtual Graphics role service installed) or later.

Example format: -VirtualVideoAdapterEnabled $True


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-VM<VM>

Specifies a virtual machine object.


Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

True (ByValue)

Accept Wildcard Characters?

false

-VMwareResourcePool<VmwResourcePool>

Assigns a virtual machine deployed on a VMware ESX host or a private cloud to a specific VMware resource pool.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see about_CommonParameters.

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.

  • VirtualMachine

Notes

  • This cmdlet requires a VMM virtual machine object, which can be retrieved by using the Get-SCVirtualMachine cmdlet.

Examples

Example 1: Specify an amount of memory for an existing virtual machine

The first command gets the virtual machine object named VM01, and then stores the object in the $VM variable.

The second determines whether the virtual machine stored in $VM is in a powered off state. If the virtual machine is not in a powered off state, the command uses the Stop-SCVirtualMachine command to power off the virtual machine. For more information about powering off a virtual machine, type Get-Help Stop-SCVirtualMachine -detailed.

The last command changes the memory allocated to VM01 to 1024 MB.


PS C:\> $VM = Get-SCVirtualMachine -Name "VM01"
PS C:\> if($VM.Status -ne "PowerOff"){Stop-SCVirtualMachine -VM $VM}
PS C:\> Set-SCVirtualMachine -VM $VM -MemoryMB 1024

Example 2: Change the user role used to manage a virtual machine for a user who belongs to multiple self-service user roles

The first command gets the virtual machine object named VM02 from VMMServer01, and then stores the object in the $VM variable.

The second command gets the user role object named ContosoSelfServiceUsers, and then stores the object in the $SSRole variable.

The last command specifies that members of the self-service user role called SSUserRole3 are now granted the permission to manage the virtual machine called VM02.

VMM uses the UserRole parameter to set which virtual machines are managed by the members of a specific self-service user role. Typically, you do not need to use the Set-SCVirtualMachine cmdlet with the UserRole parameter to configure this setting. However, if one or more users are members of multiple self-service user roles and you grant them permission to manage multiple virtual machines on the same host, you might encounter a case where you want to switch which user role is authorized to manage a particular virtual machine. This example illustrates that scenario.


PS C:\> $VM = Get-SCVirtualMachine -VMMServer "VMMServer01.Contoso.com" -Name "VM02"
PS C:\> $SSRole = Get-SCUserRole -Name "ContosoSelfServiceUsers"
PS C:\> Set-SCVirtualMachine -VM $VM -UserRole $SSRole

Example 3: Disable time synchronization on a virtual machine used as a domain controller

The first command stores the current setting for $ErrorActionPreference in variable $EAP. This variable will be used later to return the setting to its original value.

The second command sets the action preference to Stop. This error action preference changes an error from a non-terminating error to a terminating error. The error object is thrown as an exception instead of being written to the output pipe, and the command does not continue to run.

The third command gets the virtual machine object named VM03, and then stores the object in the $VM variable.

The fourth command disables the time synchronization setting. Typically, disabling time synchronization is required for virtual machines that act as domain controllers. The command uses the trap statement to catch terminating exceptions. If the Set-SCVirtualMachine command fails, the string in the trap statement is displayed. Continue is used in the trap statement to continue running instead of exiting. The Out-Null cmdlet redirects the output to $Null instead of sending it to the console.

The last command sets the value for $ErrorActionPreference to the value stored in $EAP.


PS C:\> $EAP = $ErrorActionPreference
PS C:\> $ErrorActionPreference = "Stop"
PS C:\> $VM = Get-SCVirtualMachine -Name "VM03"
PS C:\> trap{"Fail: Cannot disable Time Synchronization for VM: $VM";continue} Set-SCVirtualMachine -VM $VM -EnableTimeSynchronization $TRUE | Out-Null
PS C:\> $ErrorActionPreference = $EAP

Example 4: Set the device boot order for all virtual machines that support this feature

The first command stores the current setting for $ErrorActionPreference in $EAP. This variable will be used later to return the setting to its original value.

The second command sets the error action preference to Stop. This error action preference changes an error from a non-terminating error to a terminating error. The error object is thrown as an exception instead of being written to the output pipe, and the command does not continue to run.

The third command gets each virtual machine object stores the objects in $VMs. Using the @ symbol and parentheses ensures that the command stores the results in an array in case the command returns a single object or $Null.

The fourth command sets the BIOS boot order for each virtual machine to PXEBoot,IDEHarddrive,CD,Floppy. The command uses trap to catch terminating exceptions. If the Set-SCVirtualMachine command fails, the string in the trap statement is displayed. Continue is used in the trap statement to continue running instead of exiting the Foreach loop. The Out-Null cmdlet redirects the output to $Null instead of sending it to the console.

Note: The BootOrder parameter is used only for virtual machines on Hyper-V and Citrix XenServer hosts. It is not used for virtual machines on VMware ESX hosts. XenServer hosts do not support floppy disks, and therefore will ignore Floppy if listed in the boot order.

The last command sets the value for $ErrorActionPreference to the value stored in $EAP.

For more information about the standard Windows PowerShell Foreach statement, type Get-Help about_Foreach.


PS C:\> $EAP = $ErrorActionPreference
PS C:\> $ErrorActionPreference = "Stop"
PS C:\> $VMs = @(Get-SCVirtualMachine)
PS C:\> Foreach ($VM in $VMs){trap{"Fail: Cannot set BIOS for VM: $VM";continue} Set-SCVirtualMachine -VM $VM -BootOrder "PXEBoot","IDEHarddrive","CD","Floppy" | Out-Null}
PS C:\> $ErrorActionPreference = $EAP

Example 5: Specify an owner for all virtual machines without an owner

This command gets all virtual machine objects on VMMServer01, selects only those virtual machine objects where no owner is listed, and specifies an owner for each virtual machine.


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

Example 6: Enable Dynamic Memory for an existing virtual machine

The first command gets the virtual machine object VM06, and then stores object in the $VM variable. To enable Dynamic Memory on a virtual machine, the virtual machine must reside on a host that is running Windows Server 2008 R2 SP1 or later.

The second command determines whether the virtual machine stored in $VM is in a powered off state. If the virtual machine is not in a powered off state, the command uses the Stop-SCVirtualMachine command to power off the virtual machine. For more information about powering off a virtual machine, type Get-Help Stop-SCVirtualMachine -detailed.

The last command enables Dynamic Memory, sets the startup memory to 1024 MB, and the maximum memory to 2048 MB. The startup memory is the amount of memory on the host that will be allocated to VM06 upon startup. The maximum memory is the maximum amount of memory on the host that will be allocated to VM06.


PS C:\> $VM = Get-SCVirtualMachine -Name "VM06"
PS C:\> if($VM.Status -ne "PowerOff"){Stop-SCVirtualMachine -VM $VM}
PS C:\> Set-SCVirtualMachine -VM $VM -DynamicMemoryEnabled $True -MemoryMB 1024 -DynamicMemoryMaximumMB 2048

Related topics

 
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft