This topic is about all authentication commands and handles for PSHubContext.
The Devolutions.PowerShell module needs to be installed to use these commands.
Proper permissions are also required to perform some of these commands. Please refer to Application Users.
PSHubContext is an object that specifies your authentication information. You will need a valid PSHubContext to connect to your Devolutions Hub Business. You can have many PSHubContext connected in your PowerShell session, but only one is used when you use Hub cmdlets.
In this object, you have the following:
- Name: Name of the application user
- URL: Devolutions Hub Business URL
- Application secret: Application secret given after the application user creation
- Application key: Application key given after the application user creation
- To check all available commands:
Get-Command-Module <ModuleName>
- To check all potential arguments and parameters set for a command:
Show-Command <CommandName>
Connection
Command |
Arguments | Description | Code Example |
---|---|---|---|
Connect-HubAccount |
|
If PSHubContext is provided, tries to connect to Hub with it. or If PSHubContext is not provided, creates a PSHubContext with information received and tries to connect to Hub afterward. |
$PSHubContext = [Devolutions.Hub.PowerShell.Entities.PowerShell.PSHubContext]@{ApplicationKey=“24526a88-7f18-4356-95bd-11690f7bc59b;468ce2d5-ea4b-42ff-bc02-d93c71b4e554“; ApplicationSecret=“U4nmdOjqPAcL0GfbvNC2u8e0FCZjhEJFTnn6YHpIZDY=“; Url=“https<area>://<YourPasswordHubUrl>.devolutions.app“}
or
|
Disconnect-HubAccount |
|
If ApplicationKey is provided, disconnects and removes PSHubContext from the PowerShell session.
or If All is provided, disconnects and removes all PSHubContext from the PowerShell session. |
Context
Command |
Arguments | Description | Code Example |
---|---|---|---|
Get-HubContext |
|
If ListAvailable is provided, lists all PSHubContext set the in PowerShell session. If ListAvailable is not provided, retrieves the current PSHubContext which will be used for all other Hub commands. |
|
Set-HubContext |
|
Sets the current PSHubContext to the one provided. | |
Select-HubContext |
|
Selects another PSHubContext to change the current PSHubContext which will be used for all Hub commands. | |
Save-HubContext |
|
Saves the current PSHubContext to a .json file at the received path. If PSHubContext is provided, saves it to a .json file. If Force is provided, overwrites the file if the path already exists. If SecurePassword is provided, prompts the user to enter a password to encrypt the .json file. or If Password is provided, encrypts the .json file with the received password. |
Save a standard PSHubContext.
If you want to securely save a PSHubContext with a password, you can do it in 2 ways: With a password passed by arguments.
or With a SecurePassword argument that will prompt the secure password input.
|
Import-HubContext |
|
Imports a PSHubContext from a .json file at the received path. If SecurePassword is provided, prompts the user to enter a password to decrypt the .json file. If Password is provided, decrypts the .json file with the received password. |
Import a standard PSHubContext.
If you want to import a file protected by a password, you can do it in 2 ways: With a password passed by arguments.
or With a SecurePassword argument that will prompt the secure password input.
|
System Settings
This section is about commands used to handle system settings.
Command | Arguments | Description | Code Example |
---|---|---|---|
Get-HubSystemSettings | Gets the PSSystemSettings object. | ||
Set-HubSystemSettings |
|
Sets the provided system settings to Hub. |
Change system settings information and save these modifications.
|
New-HubSystemVaultPermission |
|
Adds the provided system vault permission to system settings. If a user or group already exists, the permission will be overwritten. If UserId is provided, sets a predefined role or a custom system vault permission to this user. or If GroupId is provided, sets a predefined role or a custom system vault permission to this group. |
$newSystemVaultPermission = [Devolutions.Hub.Clients.VaultPermission]@{ AddEntries = $true }
|
Remove-HubSystemVaultPermission |
|
If UserId is provided, removes this user's system vault permission from system settings. or If GroupId is provided, removes this group's system vault permission from system settings. |
|
Get-HubSystemVaultPermission |
|
If UserId is provided, retrieves this user's system permission from system settings. or If GroupId is provided, retrieves this group's system permission from system settings. |
Get a systemVaultPermission from a user to create a new systemVaultPermission with the same permissions (values).
|
Set-HubSystemVaultPermission |
|
Sets a provided system vault permission. If UserId is provided, sets a predefined PSVaultRole or a custom system vault permission to this user. or If GroupId is provided, sets a predefined PSVaultRole or a custom system vault permission to this group. |
$systemVaultPermission = Get-HubSystemVaultPermission -UserId 2d9221d6-3cbe-4161-b3aa-387f18a7f8c4
|
New-HubSystemPermission |
|
Adds the provided system permission to system settings If UserId is provided, sets the system permission to this user. or If GroupId is provided, sets the system permission to this group. |
|
Remove-HubSystemPermission |
|
If UserId is provided, removes this user's system permission from system settings. or If GroupId is provided, removes this group's system permission from system settings. |
|
Get-HubSystemPermission |
|
If UserId is provided, retrieves this user's system permission from system settings. or If GroupId is provided, retrieves this group's system permission from system settings. |
Get a systemPermission from a user to create a new systemPermission with the same permissions (values).
|
Set-HubSystemPermission |
|
Sets a provided system permission. If UserId is provided, sets the system permission to this user. or If GroupId is provided, sets the system permission to this group. |
$systemPermission = Get-HubSystemPermission -UserId 2d9221d6-3cbe-4161-b3aa-387f18a7f8c4
|
Devolutions Gateway
This section is about commands to handle Devolutions Gateway.
Command |
Arguments | Description | Code Example |
---|---|---|---|
New-HubGateway |
|
Adds a new Devolutions Gateway to Hub. |
$newDevolutionsGateway = [Devolutions.Hub.PowerShell.Entities.Hub.PSDecryptedGateway]@{ PsMetadata = [Devolutions.Hub.PowerShell.Entities.Hub.PSGatewayMetadata]@{ Name = 'Test Gateway From PS ' }}
|
Remove-HubGateway |
|
Removes the Devolutions Gateway with the provided ID. | |
Set-HubGateway |
|
Sets the provided Devolutions Gateway. |
$psDecrpytedGateway = Get-HubGateway -GatewayId 4c6fb2dc-f7ba-4089-8bc2-b46b3bdcd1d0
|
Get-HubGateway |
|
Retrieves the Devolutions Gateway with the providsed ID. | |
New-HubGatewaySettings |
Creates new Devolutions Gateway settings. If settings already exist, they will be overwritten. | ||
Set-HubGatewaySettings | Sets the provided Devolutions Gateway settings. | ||
Get-HubGatewaySettings | Retrieves the Devolutions Gateway settings. |
Vaults
This section is about commands to handle vaults.
Command | Arguments | Description | Code Example |
---|---|---|---|
New-HubVault |
|
Adds a new vault. | Have the permission to create vault and put a name. |
Remove-HubVault |
|
Removes this vault from Hub. | |
Get-HubVault |
|
If VaultId is provided, retrieves the vault by ID. If VaultId is not provided, retrieves all vaults you have access to. |
|
Set-HubVault |
|
Sets the provided vault to the mentioned vault ID. |
Change information about a vault and save these modifications.
|
New-HubVaultPermission |
|
Adds the provided vault permission to a specific vault. If a user or group already exists, the permission will be overwritten. If UserId is provided, sets a predefined PSVaultRole or a custom vault permission to this user. If GroupId is provided, sets a predefined PSVaultRole or a custom vault permission to this group. |
With a custom vaultPermission:
or With a predefined role:
|
Remove-HubVaultPermission |
|
If UserId is provided, removes this user's vault permission from the specific vault. If GroupId is provided, removes this group's vault permission from the specific vault. |
|
Get-HubVaultPermission |
|
If UserId is provided, retrieves this user's vault permission from the specific vault. If GroupId is provided, retrieves this group's vault permission from the specific vault. |
Get a vaultPermission from a user to create a new vaultPermission with the same permissions (values).
|
Set-HubVaultPermission |
|
Sets a provided vault permission to a specific vault. If UserId is provided, sets a predefined role or a custom vault permission to this user. If GroupId is provided, sets a predefined role or a custom vault permission to this group. |
With a custom vaultPermission:
or With a predefined role:
|
Get-HubVaultRole |
|
If RoleId is provided, retrieves the vault role by ID. If RoleId is not provided, retrieves all vault roles. |
Users
This section is about commands to handle users.
Command |
Arguments | Description | Code Example |
---|---|---|---|
New-HubUser |
|
Adds a new Devolutions user or invites an existing Devolutions user. If IsTemporaryPasswordSendByEmail is provided, the temporary password for the new Devolutions user will be sent by email. Otherwise, the temporary password is returned. |
|
New-HubOrganizationUser |
|
Invites a user from a Devolutions Account Organization set in your Hub. If Email, AllowOfflineInRDM and UserSendMessageConfiguration are provided. A single email will be sent. If PSInvitation is provided, you can manually set more than one email and assign groups. This command will only work if Enable SSO with Devolutions Account Organization has been enabled in your Hub and a valid Devolutions Account Organization has been selected. |
Add with a PSInvitation.
|
Remove-HubUser |
|
Removes this user from Hub. | |
Get-HubUser |
|
If UserId is provided, retrieves the user by ID.
If UserId is not provided, retrieves all users. |
|
Set-HubUser |
|
Sets the provided user to the mentioned user ID. |
Disable a user and save.
|
Groups
This section is about commands to handle groups.
Command | Arguments | Description | Code Example |
---|---|---|---|
New-HubGroup |
|
Adds a new group to the Hub with users, if provided. | |
Remove-HubGroup |
|
Removes this group from the Hub. | |
Get-HubGroup |
|
If GroupId is provided, retrieves the group by ID. If GroupId is not provided, retrieves all groups. |
|
Set-HubGroup |
|
Sets the provided group to the received group ID. |
Change the name, add a user, and save the group.
|
Add-HubGroupUser |
|
Adds one or more users to a specific group. | |
Remove-HubGroupUser |
|
Removes one or more users from a specific group. |
Entries
This section is about commands to handle entries.
Command | Arguments | Description | Code Example |
---|---|---|---|
New-HubEntry |
|
Adds a new entry to a specific Hub vault with the provided PSDecryptedEntry entry. |
|
Remove-HubEntry |
|
Removes this entry from a specific vault. | |
Get-HubEntry |
|
If EntryId is provided, retrieves this entry from a specific vault.
If EntryId is not provided, retrieves all entries from a specific vault. Entry(ies) will have sensitive passwords if you have the permission. |
|
Set-HubEntry |
|
Sets the provided PSDecryptedEntry to the mentioned vault and entry. |
Change information about an entry and save these modifications.
|
New-HubEntryPermission |
|
Adds a provided entry permission to a specific entry. If a user or group already exists, the permission will be overwritten. If UserId is provided, sets a predefined role or a custom entry permission to this user. or If GroupId is provided, sets a predefined role or a custom entry permission to this group. |
With a custom entryPermission:
With a predefined role:
|
Remove-HubEntryPermission |
|
If UserId is provided, removes this user's entry permission from a specific entry. or If GroupId is provided, removes this group's entry permission from a specific entry. |
|
Get-HubEntryPermission |
|
If UserId is provided, retrieves this user's entry permission from a specific entry. or If GroupId is provided, retrieves this group's entry permission from a specific entry. |
Get an entryPermission from a user to create a new entryPermission with the same permissions (values).
|
Set-HubEntryPermission |
|
Sets a provided entry permission to a specific entry. If UserId is provided, sets a predefined role or a custom entry permission to this user. or If GroupId is provided, sets a predefined role or a custom entry permission to this group. |
With a custom entryPermission:
With a predefined role:
|
Get-HubEntryRole |
|
If RoleID is provided, retrieves the entry role by ID. If RoleID is not provided, retrieves all entry roles. |