VI Toolkit/ PowerShell for VMware

download VI Toolkit/ PowerShell  for VMware

of 25

  • date post

  • Category


  • view

  • download


Embed Size (px)


VI Toolkit/ PowerShell for VMware. Randy Snyder. Microsoft PowerShell. Command line shell and scripting language Download Windows PowerShell 1.0 and install Open a command prompt . - PowerPoint PPT Presentation

Transcript of VI Toolkit/ PowerShell for VMware

Slide 1

VI Toolkit/PowerShell for VMware

Randy SnyderMicrosoft PowerShellCommand line shell and scripting languageDownload Windows PowerShell 1.0 and install a command prompt

2Microsoft PowerShell

Next steps Get-HelpCan use tabbing to finish commandsCommands like ls, pwd, dir etc work Files are saved as a .PS1Not only for Windows, (VMware, Quest, F5, Full Armor etc..)

Microsoft PowerShell

VMware VI ToolkitNew version release January 28, 2009Quick Reference GuideVMware forumVMware Europe Lab

6Get-Help command -detailed

Getting Started

What can I do?

PowerGUI 10Connecting

Viewing information

Viewing the Source

The ProblemNeed to get data from a number of serversData is not in a script that I could findField is not somewhere I would normally lookFinding DataGet-VM vm_name | get-view | format-custom >c:\out.txt Summary = class VirtualMachineSummary { Vm = class ManagedObjectReference { Type = VirtualMachine Value = vm-149535 }

($vm | get-view) | get-member

Summary Property VMware.Vim.VirtualMachineSummary Summary {get;}

16($vm | get-view).summary | get-member

Vm Property VMware.Vim.ManagedObjectReference Vm {get;set;}17 ($vm | get-view).summary.vm | get-member

Value Property System.String Value {get;set;}18($vm | get-view).summary.vm

($vm | get-view).summary.vm19Writing the Script

Step 1 Connect #Set variables $vcserver = insert VC Server Name#Connect to VC$VC = Connect-VIServer $VCServerLoop the command#Tell it to loop through the namesforeach ($object in $vmname){

#Provide the command to increase the RAM $vm = Get-VM $object ($vm | Get-View).summary.vm.value + " " + $


Vmotion IPs

Additional ResourcesVMware Administrators guide for VI Toolkit 1.5Undocumented FeaturesReal Time PublishersVI-Toolkit.comPowerScripting PodcastPower of Shell