Protect-MgmtSvcConfiguration

Encrypts sections of the web.config file for a namespace.

Syntax

Protect-MgmtSvcConfiguration [-Namespace] <String> [-Confirm] [-WhatIf] [<CommonParameters>]

Description

The Protect-MgmtSvcConfiguration cmdlet encrypts sections of the web.config file for a specified namespace.
The cmdlet encrypts the sections of the web.config file that contain secrets, such as connectionStrings, appSettings, and machineKey.
To access these settings, use the passphrase parameters described in the Get-MgmtSvcSetting and Set-MgmtSvcSetting cmdlets.
However, you do not need to access the settings by using the cmdlets to unprotect the configuration.
This is only necessary to access the web.config file in an editor.

Run this cmdlet on the computer that hosts the web.config file.

Examples

Example 1: Encrypt the config.web file for a namespace

PS C:\> Protect-MgmtSvcConfiguration -Namespace "AdminSite"
This command encrypts the sections of the web.config file that contains secrets, such as connectionStrings, appSettings, and machineKey, for the namespace AdminSite.

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Required:False
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False

-Namespace

Specifies a namespace.

Type:String
Required:True
Position:0
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False

-WhatIf

Shows what would happen if the cmdlet runs.
The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Required:False
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False