vSphere PowerCLI Reference

Get-VIAccount

Synopsis

Retrieves the accounts from the ESX or vCenter Server.

Syntax

Get-VIAccount [-Group] [-User] [[-Name] <String[]>] [-Server <VIServer[]>] [<CommonParameters>]
Get-VIAccount [-Group] [-User] [[-Id] <String[]>] [-Domain <String>] [-Server <VIServer[]>] [<CommonParameters>]

Related Commands

Online version
New-VMHostAccount
Set-VMHostAccount
Remove-VMHostAccount

Detailed Description

Retrieves the accounts from the ESX or vCenter Server. Use the Group and User switch parameters to 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

NameTypeDescriptionRequired?Pipeline InputDefault Value
IdString[]Specify the Ids of the accounts you want to retrieve.falsefalse
NameString[]Specify the names of the accounts you want to retrieve.falsefalse
DomainStringSpecify AD domains to search for accounts.falsefalse
GroupSwitchParameterSpecify that you want to retrieve only group accounts.falsefalse
ServerVIServer[]Specify the vSphere servers on which you want to run the cmdlet. If no value is given to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer.falsetrue (ByValue)
UserSwitchParameterSpecify that you want to retrieve only user accounts.falsefalse

Return Type

VIAccount

Notes

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.


Copyright © 1998 - 2012 VMware, Inc. All rights reserved.