Уреди

Делите путем


Set-SPMachineKey

Configures the ASP.NET view state decryption and validation keys of a web application.

Syntax

Set-SPMachineKey
   -WebApplication <SPWebApplicationPipeBind>
   [-DecryptionKey <String>]
   [-ValidationKey <String>]
   [-Local]
   [-AssignmentCollection <SPAssignmentCollection>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

The `Set-SPMachineKey` cmdlet configures the ASP.NET view state decryption and validation keys of a web application.

Examples

-------------EXAMPLE 1-------------

Set-SPMachineKey -WebApplication http://sitename

This example sets the ASP.NET view state decryption and validation keys for web application 'http://sitename' to new randomly generated keys. The new keys are deployed to all servers in the farm.

-------------EXAMPLE 2-------------

Set-SPMachineKey -WebApplication http://sitename -DecryptionKey '509EEEE0709AE3EA2690017D174648075D3E7659FB7CBC65F08661F737610501' -ValidationKey '988EAEF669CC691E420C3887F54BDD7D0741C84CBA36406FCA5250B780771469' -Local

This example sets the ASP.NET view state decryption and validation keys for web application 'http://sitename' to new keys specified by the DecryptionKey and ValidationKey parameters. The new keys are only deployed to the local server. Other servers in the farm will continue to use the previous keys.

Parameters

-AssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Type:SPAssignmentCollection
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-DecryptionKey

Specifies the new ASP.NET view state decryption key. The key should be represented as a 64-character long hexadecimal string (0-9 and A-F).

If this parameter is not specified, a random decryption key will be generated and used.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-Local

Deploy the new decryption and validation keys only to the local server. Other servers in the farm will continue to use the previous decryption and validation keys. Web sessions that are load balanced across multiple servers in the farm will fail if these keys are not synchronized on every server in the farm. Use the Update-SPMachineKey cmdlet to deploy the keys to additional servers in the farm.

If this parameter is not specified, the new decryption and validation keys will be deployed to all servers in the farm.

Type:SwitchParameter
Position:Named
Default value:False
Required:False
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-ValidationKey

Specifies the new ASP.NET view state validation key. The key should be represented as a 64-character long hexadecimal string (0-9 and A-F).

If this parameter is not specified, a random decryption key will be generated and used.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-WebApplication

Specifies the name, URL, or GUID of the Web application.

Type:SPWebApplicationPipeBind
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-WhatIf

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

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition