Syntax
Get-VIAccount [-Group] [-User] [[-Name] <String[]>] [-Server <VIServer[]>] [<CommonParameters>]Related Commands
Online versionDetailed Description
This cmdlet retrieves the accounts from the ESX/ESXi or vCenter Server. The Group and User switch parameters let you retrieve group and user accounts. By default, the cmdlet lists only user accounts. If the Domain parameter is specified, the cmdlet retrieves only the accounts on the specified AD domain. Otherwise, only local accounts are listed.Parameters
Name | Type | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
Id | String[] | Specifies the IDs of the accounts you want to retrieve.
Note: When a list of values is specified for the Id parameter, the returned objects would have an ID that matches exactly one of the string values in that list. | false | false | |
Name | String[] | Specifies the names of the accounts you want to retrieve. | false | false | |
Domain | String | Specifies AD domains to search for accounts. | false | false | |
Group | SwitchParameter | Specifies that you want to retrieve only group accounts. | false | false | |
Server | VIServer[] | Specifies the vCenter Server systems on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer. | false | true (ByValue) | |
User | SwitchParameter | Specifies that you want to retrieve only user accounts. | false | false |
Return Type
Zero or more VIAccount objectsNotes
Examples
-------------- Example 1 --------------
Get-VIAccount -Id Administrator
Retrieve accounts by Id.
-------------- Example 2 --------------
Get-VIAccount -Group
Retrieve all group accounts.
-------------- Example 3 --------------
Get-VIAccount -Id Administrator -Domain "MSDomain"
Get all VIAccounts for specified ID and Domain.
-------------- Example 4 --------------
Get-VIAccount -Domain "MSDomain"
Retrieve all accounts for the specified domain.