powershellscripts.com

Tutorials  PowerShell Cmdlet Help for Get-Datacenter



NAME
Get-Datacenter

SYNOPSIS
Retrieves the datacenters available on a vSphere server.

SYNTAX
Get-Datacenter [-VM ] [-Cluster ] [-VMHost ] [-Location ] [[-
Name] ] [-Id ] [-NoRecursion] [-Server ] []


DESCRIPTION
Retrieves the datacenters available on a vSphere server. Returns a set of datacenters that correspond to the filter
criteria defined by the cmdlet parameters. By default, the cmdlet searches recursively from any provided starting
point. In this case, if the location is not explicitly specified, the search includes the root folder and all other
inventory items on the root folder level. If the command runs with the -NoRecursion parameter set to $true, and th
e location is not specified, only the root folder is searched and no datacenters are returned. To specify a server
different from the default one, use the -Server parameter.


PARAMETERS
-VM
Specify virtual machines to filter the datacenters that contain at least one of them.

Required? false
Position? named
Default value
Accept pipeline input? true (ByValue)
Accept wildcard characters? true

-Cluster
Specify clusters to filter the datacenters that contain at least one of them.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? true

-VMHost
Specify hosts to filter the datacenters that contain at least one of them.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? true

-Location
Specify vSphere container objects (such as folders) you want to search for datacenters.

Required? false
Position? named
Default value
Accept pipeline input? true (ByValue)
Accept wildcard characters? true

-Name
Specify the names of the datacenters you want to retrieve.

Required? false
Position? 1
Default value
Accept pipeline input? false
Accept wildcard characters? true

-Id
Specify the IDs of the datacenters you want to retrieve.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? true

-NoRecursion
Indicate that you want to disable the recursive behavior of the command.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-Server
Specify the vSphere servers on which you want to run the cmdlet. If no value is given to this parameter, the co
mmand runs on the default servers. For more information about default servers, see the description of Connect-V
IServer.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? true


This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer and OutVariable. For more information, type,
"get-help about_commonparameters".

INPUTS



OUTPUTS
Datacenter


NOTES




-------------- Example 1 --------------

C:\PS>Get-Datacenter -Name Datacenter*


Retrieves a list of all datacenters on the server, whose names begin with "Datacenter".






RELATED LINKS
Online version: http://www.vmware.com/support/developer/PowerCLI/PowerCLI501/html/Get-Datacenter.html
Move-Datacenter
New-Datacenter
Remove-Datacenter
Set-Datacenter