Protect-MgmtSvcConfiguration

Protect-MgmtSvcConfiguration

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

Syntax

Parameter Set: Default
Protect-MgmtSvcConfiguration [-Namespace] <String> [-Confirm] [-WhatIf] [ <CommonParameters>]


 

Detailed 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.

Parameters

-Namespace<String>

Specifies a namespace.

 

Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

 

-Confirm

Prompts you for confirmation before executing the command.

 

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

 

-WhatIf

Describes what would happen if you executed the command without actually executing the command.

 

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

 

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see about_CommonParameters.

Examples

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

This command encrypts the sections of the web.config file that contains secrets, such as connectionStrings, appSettings, and machineKey, for the namespace AdminSite.

PS C:\> Protect-MgmtSvcConfiguration -Namespace "AdminSite"

 


Related topics

Unprotect-MgmtSvcConfiguration

Test-MgmtSvcProtectedConfiguration

Get-MgmtSvcSetting

Set-MgmtSvcSetting