New-MgmtSvcMachineKey

New-MgmtSvcMachineKey

Creates a machine key element.

Syntax

Parameter Set: Default
New-MgmtSvcMachineKey [-Base64] [-Decryption <String> ] [-DecryptionKeySize <Int32> ] [-Validation <String> ] [ <CommonParameters>]


 

Detailed Description

The New-MachineKey cmdlet creates a <machineKey> configuration element for use in the web.config file. The Initialize-MgmtSvcFeature cmdlet calls this cmdlet to generate the initial keys stored during configuration.

A machine key can be a validation key to confirm the integrity of data, or a decryption key to encrypt or decrypt forms authentication data. This cmdlet generates a value in memory. It is recommended that you periodically rotate the machine keys. For example, once per year.

Parameters

-Base64

Indicates that the validation and decryption values are Base64 encoded.

 

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

 

-Decryption<String>

Specifies an algorithm to encrypt and decrypt forms authentication data.

 

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

 

-DecryptionKeySize<Int32>

Specifies a key size, in bits, of the algorithm used to encrypt and decrypt forms authentication data.

 

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

 

-Validation<String>

Specifies a hash algorithm used to validate data.

 

Aliases

none

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: Create a machine key

This command creates a machine key configuration element by using the Hash-based Message Authentication Code (HMAC) SHA256 (HMACSHA256) for validation and the Advanced Encryption Standard (AES) encryption method for decryption.

PS C:\> ([xml](New-MgmtSvcMachineKey)).OuterXml