Encrypts sections of the web.config file for a namespace.
Syntax
Parameter Set: Default
Protect-MgmtSvcConfiguration [-Namespace] <String> [-Confirm]
[-WhatIf] [ <CommonParameters>]
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.
Specifies a namespace.
Aliases |
none |
Required? |
true |
Position? |
1 |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
Prompts you for confirmation before executing the command.
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
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 |
This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see about_CommonParameters.
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"
Unprotect-MgmtSvcConfiguration
Test-MgmtSvcProtectedConfiguration