Book Image

Learning PowerCLI for VMware VSphere

By : Robert van den Nieuwendijk
Book Image

Learning PowerCLI for VMware VSphere

By: Robert van den Nieuwendijk

Overview of this book

Table of Contents (17 chapters)
Learning PowerCLI
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Working with host services


PowerCLI has a number of cmdlets to work with host services. You can easily find these cmdlets using the Get-Command cmdlet:

PowerCLI C:\> Get-Command -Noun VMHostService

CommandType Name                  ModuleName
----------- ----                  ----------
Cmdlet      Get-VMHostService     VMware.VimAutomation.Core
Cmdlet      Restart-VMHostService VMware.VimAutomation.Core
Cmdlet      Set-VMHostService     VMware.VimAutomation.Core
Cmdlet      Start-VMHostService   VMware.VimAutomation.Core
Cmdlet      Stop-VMHostService    VMware.VimAutomation.Core

Retrieving information about host services

You can use the Get-VMHostService cmdlet to retrieve information about the services running on a host.

The syntax of the Get-VMHostService cmdlet is:

Get-VMHostService [-VMHost] <VMHost[]> [-Refresh] [-Server <VIServer[]>] [<CommonParameters>]

Let's retrieve a list of all the services of one of the hosts:

PowerCLI C:\> Get-VMHostService -VMHost 192...