VMware Cloud Community
t8z5h3
Contributor
Contributor

need help with a script

i am looking to Suspend any powered on vm's using most likely the commandlets get-vm and Suspend-VM also with out conferming each vm

something like Get-vm | where {$_.PowerState -eq "PoweredOn"} | suspend-vm

but i get this error:

Suspend-VM : 30/07/2011 11:17:11 PM    Suspend-VM        fault.RestrictedVersio
n.summary
At line:1 char:60
+ Get-vm | where {$_.PowerState -eq "PoweredOn"} | suspend-vm <<<<
    + CategoryInfo          : NotSpecified: (:) [Suspend-VM], SecurityError
    + FullyQualifiedErrorId : Client20_MoServiceImpl_Invoke_ViError,VMware.Vim
   Automation.ViCore.Cmdlets.Commands.SuspendVM

Reply
0 Kudos
3 Replies
a_p_
Leadership
Leadership

Are you running the free ESXi (Hypervisor) edition?

With this edition access is limited to read-only.

André

Reply
0 Kudos
t8z5h3
Contributor
Contributor

yes... so that explain it.

Reply
0 Kudos
bulletprooffool
Champion
Champion

Unfortunately the free version provides only read access, so you can gather info, but not make changes - sorry.

One day I will virtualise myself . . .
Reply
0 Kudos