Protect-MgmtSvcConfiguration

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

Syntax

Protect-MgmtSvcConfiguration
       [-Namespace] <String>
       [-WhatIf]
       [-Confirm]
       [<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
Position:Named
Default value:False
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Namespace

Specifies a namespace.

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

-WhatIf

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

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