Get-UserLockProtectedAccount Cmdlet
Synopsis
Gets protected accounts.
Syntax
Get-UserLockProtectedAccount [-Name <string[]>] [-Type <ProtectedAccountType[]>] [-Property <string>] [-StartDate <DateTime>] [-EndDate <DateTime>] [-UserLockServerName <string>] [<CommonParameters>]
Description
The Get-UserLockProtectedAccount cmdlet gets protected accounts. Without parameters, Get-UserLockProtectedAccount gets all of the protected accounts. You can also specify a particular protected account by its account name, specify a particular account type (user, group or OU) or get only temporary protected accounts filtering on dates of such protected accounts. Caution: PowerShell 3.0 is required.
Parameters
-Name <string[]>
Specifies one or more protected accounts by account name. You can type multiple account names (separated by commas). The parameter name ("Name") is optional. For a temporary name, either enter its account name and specify StartDate and EndDate parameters, or enter here its identifier.
Required | false |
Position | 1 |
Accepts pipeline input | true (ByValue, ByPropertyName) |
Accepts wildcard characters | false |
-Type <ProtectedAccountType[]>
Specifies one or more protected accounts types. The parameter name ("Type") is optional. Possible values for this parameter include: User or 1 Group or 2 Ou or 3 To specify multiple protected account types, use a comma-separated list. The default protected account type is User,Group,Ou.
Required | false |
Position | named |
Accepts pipeline input | false |
Accepts wildcard characters | false |
Default Value | User,Group,Ou |
-Property <string>
Specifies the name of the property to get.
Required | false |
Position | named |
Accepts pipeline input | false |
Accepts wildcard characters | false |
-StartDate <DateTime>
Specifies the start date of temporary protected account(s). This parameter is optional.
Required | false |
Position | named |
Accepts pipeline input | false |
Accepts wildcard characters | false |
-EndDate <DateTime>
Specifies the end date of temporary protected account(s). This parameter is optional.
Required | false |
Position | named |
Accepts pipeline input | false |
Accepts wildcard characters | false |
-UserLockServerName <string>
Specifies the name of the UserLock server. The default is the localhost name.
Required | false |
Position | named |
Accepts pipeline input | false |
Accepts wildcard characters | false |
Default Value | '.' |
<CommonParameters>
For more information about common parameters, type "Get-Help about_commonparameters".
Input Type
None
Return Type
ISDecisions.UserLockLibrary.ProtectedAccount, ISDecisions.UserLockLibrary.PaTmp
Notes
You can also refer to Get-UserLockProtectedAccount by its alias, "gulpa". For more information, see about_Aliases. To use Get-UserLockProtectedAccount, you must have the "Protected account" UserLock administrative access right.
Examples
Example 1
Get-UserLockProtectedAccount -Name 'Alice', 'Bob' -UserLockServerName 'MyUlSrv'
Gets the 'Alice' and 'Bob' user protected accounts through the 'MyUlSrv' UserLock server.
Example 2
Get-UserLockProtectedAccount -Type Group,Ou -UserLockServerName 'MyUlSrv' | Format-Table
Gets all group and Ou protected accounts through the 'MyUlSrv' UserLock server then display in a table.
Example 3
Get-UserLockProtectedAccount -Property AccountName
Gets the AccountName property of all protected accounts of the localhost UserLock server.
Example 4
[DateTime]$StartDate = '2014-06-01 00:00:00'
[DateTime]$EndDate = '2014-07-01 00:00:00'
nulpa MyUser -StartDate $StartDate -EndDate $EndDate -Force
gulpa MyUser -StartDate $StartDate -EndDate $EndDate
$Id = gulpa MyUser -StartDate $StartDate -EndDate $EndDate -Property Identifier
gulpa $Id
Creates a temporary protected account, then gets its ID through its name and dates, then gets all its properties through its ID.