> For the complete documentation index, see [llms.txt](https://docs.devolutions.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.devolutions.net/powershell/powershell-commands/get-dspamaccount.md).

# Get-DSPamAccount

### Synopsis

Fetch pam accounts.

### Syntax

#### GetByFolder (Default)

```
Get-DSPamAccount [-VaultID <guid>] [-AddActiveCheckoutID] [-IncludeDomainName] [-AsLegacyResponse]
 [<CommonParameters>]
```

#### GetByID

```
Get-DSPamAccount -AccountID <guid> [-AddActiveCheckoutID] [-IncludeDomainName] [-AsLegacyResponse]
 [<CommonParameters>]
```

#### BasicInformation

```
Get-DSPamAccount -AsBasicInformation [-VaultID <guid>] [-AsLegacyResponse] [<CommonParameters>]
```

### Description

Fetch pam accounts. There is three way to do so. First, get a specific account by using the AccountID parameter. Second, get all pam accounts by calling the cmdlet without parameters. Third, get all pam accounts of a specific folder by using the FolderID parameter. In case there is a lot of PAM accounts, it is possible an TryGoOfflineException occurs. If that is the case, there is two way to avoid that error. First, when calling New-DSSession, use the Timeout parameter to increase the polling delay. Another way is to use AsBasicInformation switch of this cmdlet. This will return a simplified object with the information to quickly identify the PAM accounts of interest.

### Examples

#### Example 1

```powershell
PS C:\> $searchRes = Search-DSEntry -By Username -Match ExactExpression -Value 'MyUsername' -IncludePamVaults -IncludeVault @();
        $search = $searchRes[0];
        $pamAccountRes = Get-DSPamAccount -AccountID $search.ID
```

Get the PAM account whose username is 'MyUsername'. It is assumed in this example that the username is unique, so the search result contains a single result.

#### Example 2

```powershell
PS C:\> $pamBasicRes = Get-DSPamAccount -AsBasicInformation;
        $nameStarts = $pamBasicRes | Where Label -like 'MyName*';
        foreach ($pamBasic in $nameStarts) { Remove-DSPamAccount -AccountID $pamBasic.ID }
```

Delete all PAM Accounts whose name starts with 'MyName'.

### Parameters

#### -AccountID

Pam account's ID

```yaml
Type: System.Guid
DefaultValue: ''
SupportsWildcards: false
Aliases:
- PamCredentialID
ParameterSets:
- Name: GetByID
  Position: Named
  IsRequired: true
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
```

#### -AddActiveCheckoutID

Add the CheckoutID property containg the ID of the active checkout

```yaml
Type: System.Management.Automation.SwitchParameter
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: GetByID
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
- Name: GetByFolder
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
```

#### -AsBasicInformation

The returned object will be simplified. It allows simple identification of the PAM Account (ID, Label, Username, Domain), its PAM folder (FolderID, FolderName), and its PAM vault (TeamFolderID). It is quicker than obtaining the complete PAM Accounts objects.

```yaml
Type: System.Management.Automation.SwitchParameter
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: BasicInformation
  Position: Named
  IsRequired: true
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
```

#### -AsLegacyResponse

In versions prior to 2024.2, many DS cmdlets returned a ServerResponse object. Enabling this backward compatibility switch allows scripts developed for earlier versions to function correctly.

```yaml
Type: System.Management.Automation.SwitchParameter
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
```

#### -IncludeDomainName

Include the domain name. Will fetch it from the PAM provider. Can be used by non administrators.

```yaml
Type: System.Management.Automation.SwitchParameter
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: GetByID
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
- Name: GetByFolder
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
```

#### -VaultID

Get all accounts in the specified folder

```yaml
Type: System.Guid
DefaultValue: ''
SupportsWildcards: false
Aliases:
- FolderID
ParameterSets:
- Name: GetByFolder
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
- Name: BasicInformation
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
```

#### CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about\_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).

### Notes

For more information, type "Get-Help Get-DSPamAccount -detailed". For technical information, type "Get-Help Get-DSPamAccount -full".


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.devolutions.net/powershell/powershell-commands/get-dspamaccount.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
