> 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/de/readme/devolutions-powershell.md).

# Devolutions PowerShell

Devolutions-Produkte integrieren Microsoft PowerShell vollständig und bieten leistungsstarke Skripting- und Automatisierungsmöglichkeiten. Sie können die Devolutions-Produkte selbst steuern und über Remote Desktop Manager PowerShell-Skripte in Ihrer gesamten Umgebung ausführen. Vor diesem Hintergrund erfahren Sie hier, wie PowerShell auf der Devolutions-Plattform eingesetzt wird.

| Integration                                                                | Zweck                                                                                                                               | Referenz                                                                                                                                                                                                                                                                                                                                                                                                                 |
| -------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Devolutions.PowerShell-Modul                                               | Dieses PowerShell-Modul wird verwendet, um direkt mit Devolutions-Produkten zu interagieren.                                        | <ul><li><a href="https://www.powershellgallery.com/packages/Devolutions.PowerShell/">PowerShell Gallery</a></li></ul>                                                                                                                                                                                                                                                                                                    |
| Remote Desktop Manager-Aktionen                                            | Sie können ein PowerShell-Skript definieren, das als Stapelaktion gegen einen oder mehrere Hosts ausgeführt wird.                   | <ul><li><a href="/pages/kOf7gZR0IncXY2Vn5Lv5">Benutzerdefinierte PowerShell-Befehle</a></li><li><a href="/pages/NxRlsr6D1c1FUvrXU8uo">Stapelbearbeitung mit PowerShell</a></li><li><a href="/pages/DjxKcAanGPF8iAY0kcYQ">Ändern einer Synchronisierungsquelle</a></li></ul>                                                                                                                                              |
| Remote Desktop Manager-Berichte                                            | Dieser Eintragstyp unterstützt die Ausführung eines PowerShell-Skripts zur Erstellung eines Berichts.                               | <ul><li><a href="/pages/JoxMHQPgTy5xWKqRy2WO">Benutzerdefinierter PowerShell-Bericht</a></li></ul>                                                                                                                                                                                                                                                                                                                       |
| Remote Desktop Manager-Eintragstypen                                       | Sowohl der Eintragstyp PowerShell lokal als auch PowerShell remote unterstützen die Ausführung von Skripten.                        |                                                                                                                                                                                                                                                                                                                                                                                                                          |
| Anbieter für privilegierte Zugriffsverwaltung (PAM) und Passwortweitergabe | In Devolutions Server und Devolutions Cloud betreibt PowerShell benutzerdefinierte PAM-Anbieter und Skripte zur Passwortweitergabe. | <ul><li><a href="https://docs.devolutions.net/pam/de/pam-with-devolutions-server/getting-started/custom-pam-providers/create-a-custom-pam-provider-in-devolutions-server">Benutzerdefinierter PAM-Anbieter für Devolutions Server</a></li><li><a href="https://docs.devolutions.net/pam/de/pam-with-devolutions-server/password-propagation-scripts">Devolutions Server PAM-Skripte zur Passwortweitergabe</a></li></ul> |

### Erste Schritte mit dem Devolutions.PowerShell-Modul

Das Devolutions.PowerShell-Modul erfordert [PowerShell 7.4 oder höher](https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell?view=powershell-7.4) und wird unter den Betriebssystemen Windows, macOS und Linux unterstützt.

{% hint style="warning" %}
Windows PowerShell oder frühere Versionen von PowerShell 7 werden nicht unterstützt, da das Modul auf demselben Kern wie Remote Desktop Manager basiert und daher eine PowerShell-Version erfordert, die eine kompatible Version der .NET-Runtime (.NET 9) verwendet.
{% endhint %}

#### PowerShell Gallery (empfohlen)

Das Devolutions.PowerShell-Modul ist in der [PowerShell Gallery](https://www.powershellgallery.com/packages/Devolutions.PowerShell) verfügbar und dies ist die empfohlene Standardinstallationsmethode:

```powershell
Install-Module Devolutions.PowerShell -Force
```

Da die PowerShell Gallery normalerweise ein als nicht vertrauenswürdig markiertes Repository ist (Pakete werden nicht kuratiert oder überprüft), ist die Verwendung von `-Force` erforderlich, um die Bestätigungsaufforderung zu vermeiden.

#### Cloudsmith

Als Alternative zur PowerShell Gallery bieten wir ein [Devolutions PowerShell-Repository](https://cloudsmith.io/~devolutions/repos/powershell/packages/) an, das von [Cloudsmith](https://cloudsmith.com/) gehostet wird.

1. Registrieren Sie das Devolutions PowerShell-Repository, das als vertrauenswürdig markiert werden kann:

   ```powershell
   Register-PSRepository -Name 'Devolutions' -SourceLocation 'https://nuget.cloudsmith.io/devolutions/powershell/v2/' -InstallationPolicy Trusted
   ```
2. Deinstallieren Sie frühere Versionen des Devolutions.PowerShell-Moduls, die aus der PowerShell Gallery installiert wurden:

   ```powershell
   Uninstall-Module Devolutions.PowerShell -AllVersions
   ```
3. Installieren Sie das Devolutions.PowerShell-Modul explizit aus dem Repository "Devolutions":

   ```powershell
   Install-Module Devolutions.PowerShell -Repository Devolutions
   ```
4. Bestätigen Sie, dass das Installationsquell-Repository für das Devolutions.PowerShell-Modul "Devolutions" und nicht "PSGallery" ist:

   ```powershell
   Get-InstalledModule Devolutions.PowerShell | Select-Object -Property Name, Repository

   Name                   Repository
   ----                   ----------
   Devolutions.PowerShell Devolutions
   ```

{% hint style="info" %}
Da das Devolutions.PowerShell-Modul in mehr als einem registrierten Repository verfügbar ist, wird der Parameter `-Repository` obligatorisch. Wenn Sie jedoch das Repository "Devolutions" als vertrauenswürdig markiert haben, ist `-Force` nicht erforderlich, um die Bestätigungsaufforderung zu vermeiden.
{% endhint %}

#### Offline

Wenn Sie das Devolutions.PowerShell-Modul auf einem System mit eingeschränktem oder ohne Internetzugang installieren müssen, können Sie dies mit den folgenden Schritten tun:

1. Erstellen Sie ein neues PowerShell-Repository namens "local" in dem von Ihnen gewählten Verzeichnis; das folgende Beispiel verwendet `C:\PSRepo`.

   ```powershell
   $RepoPath = "C:\PSRepo"
   New-Item -Path $RepoPath -ItemType 'Directory' -Force | Out-Null
   Register-PSRepository -Name 'local' -SourceLocation $RepoPath -PublishLocation $RepoPath -InstallationPolicy Trusted
   ```
2. Laden Sie die `.nupkg`-Datei für das Devolutions.PowerShell-Modul über die Schaltfläche ***Download the raw nupkg file*** unter ***Manual Download*** in der [PowerShell Gallery](https://www.powershellgallery.com/packages/Devolutions.PowerShell) herunter. Kopieren Sie die `.nupkg`-Datei in das zuvor erstellte, lokale PowerShell-Repository-Verzeichnis.
3. Deinstallieren Sie frühere Versionen des Devolutions.PowerShell-Moduls, die aus anderen Quellen installiert wurden.

   ```powershell
   Uninstall-Module Devolutions.PowerShell -AllVersions
   ```
4. Installieren Sie das Devolutions.PowerShell-Modul explizit aus dem `local`-Repository.

   ```powershell
   Install-Module Devolutions.PowerShell -Repository local
   ```
5. Bestätigen Sie, dass die Installationsquelle für das Devolutions.PowerShell-Modul `local` ist.

   ```powershell
   Get-InstalledModule Devolutions.PowerShell | Select-Object -Property Name, Repository

   Name                   Repository
   ----                   ----------
   Devolutions.PowerShell local
   ```

{% hint style="info" %}
Alternativ kann anstelle eines lokalen Verzeichnisses ein Verzeichnis auf einer Netzwerkfreigabe verwendet werden, was die Verteilung des PowerShell-Moduls in einem lokalen Netzwerk erleichtert.
{% endhint %}

### Beispiele

Um schnell mit einigen gängigen Beispielen für das Devolutions.PowerShell-Modul zu beginnen, lesen Sie weiter unten.

#### Remote Desktop Manager

```powershell
# [Import module]
Import-Module Devolutions.PowerShell

# [Load workspace] Example for a local workspace (SQLite) or SQL Server
$DatasourceLocal = Get-RDMDataSource -Name "Local workspace"; Set-RDMCurrentDataSource $DatasourceLocal

$DatasourceSQL = Get-RDMDataSource -Name "SQL Server"; Set-RDMCurrentDataSource $DatasourceSQL

# [Create vault] Only the SQL Server workspace supports vaults (as do Devolutions Server and Devolutions Cloud)
$Vault = New-RDMRepository -Name 'MyVault' -Description 'My vault description' -SetRepository | Set-RDMCurrentRepository | Update-RDMUI

# [Retrieve vault]
Get-RDMRepository -Name 'MyVault'

# [Create entry] Example to create an RDP and Credential entry
$Entry = New-RDMSession -Host 'MyHost' -Type RDPConfigured -Name 'MyHost'; Set-RDMSession -Session $Entry -Refresh; Update-RDMUI

$Entry = New-RDMSession -Name 'MyCredential' -Type Credential; $Entry.Credentials.Username = 'Administrator'; Set-RDMSession $Entry -Refresh; Set-RDMSessionPassword -ID $Entry.ID -Password (ConvertTo-SecureString 'Test123$' -AsPlainText -Force)

# [Retrieve entries]
Get-RDMSession -GroupName 'MyFolder' -Name 'MyHost'

# [Update entry]
$Entry = Get-RDMSession -Name 'MyHost'; $Entry.Name = 'MyUpdatedHost'; Set-RDMSEssion $Entry | Update-RDMUI

# [Export entries]
$Entries = Get-RDMSession; $Entries | Select-Object * | Export-CSV 'C:\Export\FileName.csv' -NoTypeInformation

# [Remove entry]
Get-RDMSession -Name 'MyUpdatedHost' | Remove-RDMSession; Update-RDMUI
```

#### Devolutions Server

```powershell
# [Import module]
Import-Module Devolutions.PowerShell

# [Load workspace]
New-DSSession -Credential (Get-Credential) -BaseURI 'https://MyServer/devolutions-server/'

# [Create vault]
$Vault = New-DSVault -Name 'MyVault' -Description 'My vault description'

# [Retrieve vault]
Get-DSVault -All | Where-Object DisplayName -EQ 'MyVault'

# [Create entry]
New-DSRDPEntry -Name 'MyHost' -HostName 'MyHost' -Username 'Administrator' -Password 'Test123$' -Domain 'MyDomain' -VaultID 'VaultGUID'

New-DSCredentialEntry -Name 'MyCredential' -Username 'Administrator' -Password 'Test123$' -Domain 'MyDomain' -VaultID 'VaultGUID'

# [Retrieve entries]
Get-DSEntry -FilterBy 'Name' -FilterMatch 'StartsWith' -FilterValue 'MyHost' -SearchAllVaults

# [Update entry]
$Entry = Get-DSEntry -EntryId 'EntryGUID'; $Entry.Name = 'MyUpdatedHost'; Update-DSEntryBase -JsonBody (ConvertTo-JSON -InputObject $Entry -Depth 10)

# [Export entries]
$Entries = Get-DSEntry -SearchAllVaults; $Entries | Select-Object * | Export-CSV 'C:\Export\FileName.csv' -NoTypeInformation

# [Remove entry]
Remove-DSEntry -EntryID 'EntryGUID'
```

#### Devolutions Cloud

```powershell
# [Import module]
Import-Module Devolutions.PowerShell

# [Load workspace]
Connect-HubAccount -Url 'https://mycloud.devolutions.app' -ApplicationKey 'ApplicationKey' -ApplicationSecret 'ApplicationSecret'

# [Create vault]
$Vault = New-HubVault -VaultName 'MyVault' -VaultDescription 'My vault description'

# [Retrieve vault]
Get-HubVault

# [Create entry]
$Entry = [Devolutions.Hub.PowerShell.Entities.Hub.PSDecryptedEntry]@{
    PsMetadata = [Devolutions.Hub.PowerShell.Entities.Hub.PSEntryMetadata]@{
        Name = 'MyHost'
        ConnectionType = [Devolutions.RemoteDesktopManager.ConnectionType]::Credential
    }
    Connection = [Devolutions.RemoteDesktopManager.Business.Connection]@{
        Credentials = [Devolutions.RemoteDesktopManager.Business.CredentialsConnection]@{
            CredentialType = [Devolutions.RemoteDesktopManager.CredentialResolverConnectionType]::Default
            UserName = 'Administrator'
            Password = 'Test123$'
        }
    }
}

New-HubEntry -VaultId 'VaultGUID' -PSDecryptedEntry $Entry

# [Retrieve entries]
Get-HubEntry -VaultId 'VaultGUID' | Where-Object { $PSItem.PSMetaData.Name -EQ 'MyHost' }

# [Update entry]
$Entry = Get-HubEntry -VaultId 'VaultGUID' -EntryId 'EntryGUID'; $Entry.PsMetadata.Name = 'MyUpdatedHost'; Set-HubEntry -VaultId 'VaultGUID' -EntryId $Entry.Entry.ID.Guid -PSDecryptedEntry $Entry

# [Export entries]
$Entries = Get-HubEntry -VaultId 'VaultGUID'; $Entries | Select-Object * | Export-CSV 'C:\Export\FileName.csv' -NoTypeInformation

# [Remove entry]
Remove-HubEntry -VaultId 'VaultGUID' -EntryId 'EntryGUID'
```

### Deinstallieren des Devolutions.PowerShell-Moduls

Deinstallieren Sie alle Versionen des Devolutions.PowerShell-Moduls:

```powershell
Uninstall-Module Devolutions.PowerShell -AllVersions
```

Wenn das Modul über Cloudsmith installiert wurde, können Sie die Registrierung des Repositorys "Devolutions" wie folgt aufheben:

```powershell
Unregister-PSRepository Devolutions
```

Wenn Sie das Modul offline installiert haben, können Sie schließlich die Registrierung des dateibasierten Repositorys "local" aufheben und das zugehörige Verzeichnis löschen (Ihr Verzeichnisname kann abweichen):

```powershell
Unregister-PSRepository local
Remove-Item "C:\PSRepo" -Recurse -ErrorAction SilentlyContinue
```


---

# 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, and the optional `goal` query parameter:

```
GET https://docs.devolutions.net/powershell/de/readme/devolutions-powershell.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
