This is an archive version of the document. To get the most up-to-date information, see the current version.

Set-VBREPPermission

Short Description

Applies user access permissions to backup repositories used by Veeam Agent operating in a standalone mode.

Syntax

Set-VBREPPermission -Repository <CBackupRepository> [-Type <VBREPPermissionType> {Everyone | NoOne | OnlySelectedUsers}] [-User <string[]>] [-EnableEncryption] [-EncryptionKey <VBREncryptionKey>] [-PassThru] [<CommonParameters>]

Detailed Description

This cmdlet applies user access permissions to a selected repository that is used as a target by Veeam Agent operating in a standalone mode.

By default, the backup repositories are configured to have no permissions for writing backups created by a Veeam Agent. To start using a Veeam backup repository as target for backups created by a Veeam Agent, you need to change the access permissions to Everyone or OnlySelectedUsers.

Parameters

Parameter

Description

Required

Position

Accept
Pipeline
Input

Accept
Wildcard
Characters

Repository

Specifies the repository for which you want to set permissions.

Accepts the backup repository object or string (repository name) type.

NOTE: You cannot use cloud repositories for backups created by a Veeam Agent.

True

Named

True (ByValue,
ByProperty
Name)

False

Type

Specifies the permission type:

  • Everyone: everyone has permissions.
  • NoOne: no one has permissions.
  • OnlySelectedUsers: the selected users have permissions. Use the User parameter to specify the users.

Default: the permissions type that is currently set for the selected repository.

False

Named

False

False

User

Used to set users for OnlySelectedUsers option.

Specifies names of users allowed to use the repository for backups created by a Veeam Agent.

You can specify user names or names of Active Directory groups.

False

Named

False

False

EnableEncryption

Indicates that the repository must encrypt the backups created by a Veeam Agent.

Use the EncryptionKey parameter to specify the encryption key.

False

Named

False

False

EncryptionKey

Used to specify the encryption key for the EnableEncryption parameter.

Accepts the VBREncryptionKey type.

False

Named

False

False

PassThru

Indicates that the command returns the output object to the Windows PowerShell console.

False

Named

False

False

<CommonParameters>

This cmdlet supports Microsoft PowerShell common parameters. For more information on common parameters, see the About CommonParameters section of Microsoft Docs.

Return Type

VBREPPermission

Example 1

This command grants permission to access the WinLocal repository to Administrator.

  1. Run Get-VBRBackupRepository to get the repository. Save it to the $repository variable.
  2. Run Set-VBREPPermission with the $repository variable.

$repository = Get-VBRBackupRepository -Name "WinLocal"

Set-VBREPPermission -Repository $repository -Type OnlySelectedUsers -User "VEEAM\Administrator"

RepositoryId        : 88788f9e-d8f5-4eb4-bc4f-9b3f5403bcec
PermissionType      : OnlySelectedUsers
Users               : {VEEAM\Administrator1, VEEAM\Administrator2}
IsEncryptionEnabled : False
EncryptionKey       :

Example 2

This command enables encryption for WinLocal repository.

  1. Run Get-VBREncryptionKey to get the encryption key. Save it to the $encryptionkey variable.
  2. Run Get-VBRBackupRepository to get the repository. Save it to the $repository variable
  3. Run Set-VBREPPermission with the $encryptionkey and $repository variables.

$encryptionkey = Get-VBREncryptionKey -Description "Veeam Administrator"

$repository = Get-VBRBackupRepository -Name "WinLocal"

Set-VBREPPermission -Repository $repository -EnableEncryption -EncryptionKey $encryptionkey

RepositoryId        : 88788f9e-d8f5-4eb4-bc4f-9b3f5403bcec
PermissionType      : OnlySelectedUsers
Users               : {VEEAM\Administrator}
IsEncryptionEnabled : True
EncryptionKey       : ac87709d-b1a9-4c2e-8d55-557f8e49f639

Example 3

This example shows how to grant user access permissions to everyone and enable encryption for the WinLocal repository.

  1. Run Get-VBREncryptionKey to get the encryption key. Save it to the $encryptionkey variable.
  2. Run Get-VBRBackupRepository to get the repository. Save it to the $repository variable
  3. Run Set-VBREPPermission with the $encryptionkey and $repository variables.

$encryptionkey = Get-VBREncryptionKey -Description "Veeam Administrator"

$repository = Get-VBRBackupRepository -Name "WinLocal"

Set-VBREPPermission -Repository $repository -Type Everyone -EnableEncryption -EncryptionKey $encryptionkey

RepositoryId        : 88788f9e-d8f5-4eb4-bc4f-9b3f5403bcec
PermissionType      : Everyone
Users               : {VEEAM\Administrator}
IsEncryptionEnabled : True
EncryptionKey       : ac87709d-b1a9-4c2e-8d55-557f8e49f639

Related Commands

Get-VBRBackupRepository

Get-VBREncryptionKey