Restore-CARoleService

Restore-CARoleService is accessible with the help of adcsadministration module. To install adcsadministration on your system please refer to this link.

Synopsis
Restores the CA database and private key information.

Description
The Restore-CARoleService cmdlet restores the certification authority (CA) database and private key information.

Parameters

-DatabaseOnly 
         Indicates that the cmdlet restores only the certification authority database.
    Required?                    true
    Position?                    named
    Default value                
    Accept pipeline input?       True (ByPropertyName)
    Accept wildcard characters?  false

-Force <SwitchParameter>
    Forces the command to run without asking for user confirmation.

    Required?                    false
    Position?                    named
    Default value                
    Accept pipeline input?       True (ByValue, ByPropertyName)
    Accept wildcard characters?  false

-KeyOnly <SwitchParameter>
    Indicates that the cmdlet restores only the certification authority private key and certificate.

    Required?                    true
    Position?                    named
    Default value                
    Accept pipeline input?       True (ByPropertyName)
    Accept wildcard characters?  false

-Password <SecureString>
    Specifies a password, as a secure string, to access the private key and certificate information. To obtain a secure string, use the ConvertTo-SecureString cmdlet. For more information, type Get-Help ConvertTo-SecureString.

    Required?                    false
    Position?                    named
    Default value                
    Accept pipeline input?       True (ByPropertyName)
    Accept wildcard characters?  false

-Path <String>
    Specifies the directory from which the cmdlet restores the CA database and private key. The cmdlet restores the database from the subdirectory named Database in the path that you specified when you backed up the CA database. The cmdlet restores the private key from the .p12 file that you backed up in the Database subdirectory in the path that you specify.

    Required?                    true
    Position?                    2
    Default value                
    Accept pipeline input?       True (ByValue, ByPropertyName)
    Accept wildcard characters?  false

-Confirm <SwitchParameter>
    Prompts you for confirmation before running the cmdlet.

    Required?                    false
    Position?                    named
    Default value                false
    Accept pipeline input?       false
    Accept wildcard characters?  false

-WhatIf <SwitchParameter>
    Shows what would happen if the cmdlet runs. The cmdlet is not run.

    Required?                    false
    Position?                    named
    Default value                false
    Accept pipeline input?       false
    Accept wildcard characters?  false

Syntax

Restore-CARoleService [-Path]  [-Force ] -DatabaseOnly  [-Confirm ] [-WhatIf ] []

Restore-CARoleService [-Path] <String> [-Force ] [-Password <SecureString>] -KeyOnly  [-Confirm ] [-WhatIf ] [<CommonParameters>]

Restore-CARoleService [-Path] <String> [-Force ] [-Password <SecureString>] [-Confirm ] [-WhatIf ] [<CommonParameters>]

Example 1: Restore the CA private key and certificate
PS C:> Restore-CARoleService -Path “C:\CABackup”
This command restores the CA private key and certificate from the specified path.

Example 2: Restore the CA database only
PS C:>Restore-CARoleService –Path “C:\CABackup” –DatabaseOnly
This command restores the CA database from the specified path. The command does not restore the CA private key information.

Example 3: Restore the CA key only
PS C:>Restore-CARoleService –Path “C:\CABackup” -KeyOnly
This command restores the CA private key information to the specified path. The command does not restore the CA database.

You can check the Version, CommandType and Source of this cmdlet by giving below command.

Get-Command Restore-CARoleService

Restore-CARoleService powershell script cmdlet

You can also read about
Backup-CARoleService

Click on this Link for an Single place where you get all the PowerShell cmdlet sorted based on the modules.

You can also refer other blogs on PowerShell at link

You can also refer other blogs on Microsoft at link

And also if you required any technology you want to learn, let us know below we will publish them in our site http://tossolution.com/

Like our page in Facebook and follow us for New technical information.

References are taken from Microsoft

Leave a Reply

Your email address will not be published. Required fields are marked *