편집

다음을 통해 공유


Disable-IISSharedConfig

Disables IIS shared configuration.

Syntax

Disable-IISSharedConfig
       [-DontRestoreBackedUpKeys]
       [-CopyRemoteConfigToLocalFiles]
       [<CommonParameters>]

Description

The Disable-IISSharedConfig cmdlet disables the IIS shared configuration feature, and reverts to the keys that were backed up when shared configuration was enabled. IIS also reverts to the local applicationHost.config file that was used before shared configuration was enabled.

You can enable shared configuration through the IIS Administration Manager UI or the Enable-IISSharedConfig cmdlet.

If there are no backup keys for any reason, the cmdlet fails with a warning. To disable shared configuration in this scenario, you can use the DontRestoreBackedUpKeys parameter.

Examples

Example 1: Disable shared configuration and restore keys

PS C:\> Disable-IISSharedConfig

This command disables shared configuration. IIS subsequently uses the local applicationHost.config file in %WINDIR%\config. The backed up keys are restored to the local key store and deleted.

Example 2: Disable shared configuration without restoring keys

PS C:\> Disable-IISSharedConfig -DontRestoreBackedUpKeys

This command disables shared configuration. IIS subsequently uses the local applicationHost.config file in %WINDIR%\config. The backed up keys are deleted and are not restored.

Example 3: Disable shared configuration and use it locally

PS C:\> Disable-IISSharedConfig -CopyRemoteConfigToLocalFiles

This command disables shared configuration. IIS copies the shared configuration locally and uses it. The backed up keys are deleted and are not restored.

Parameters

-CopyRemoteConfigToLocalFiles

Copies remote configuration over the local version of applicationHost.config before disabling shared configuration.

The version of the applicationHost.config file that was used before enabling shared configuration is overwritten. The backup keys are also deleted, because those keys would only work with the overwritten version of applicationHost.config.

IIS continues to use the active keys that worked with shared configuration, which is now the local configuration.

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

-DontRestoreBackedUpKeys

Indicates that this operation does not restore backed up keys. If you do not specify the CopyRemoteConfigToLocalFiles parameter, IIS reverts to using its local copy of applicationHost.config, and uses the active keys for the shared configuration.

If the local copy of the applicationHost.config file had secrets encrypted with keys other than the currently active ones, IIS will no longer be able to decrypt those secrets. You must re-enter and re-encrypt these secrets for the features that depend on them.

DontRestoreBackedUpKeys is useful in scenarios where backup keys are deleted but the IIS administrator wants to disable shared configuration.

This parameter is ignored if you specify the CopyRemoteConfigToLocalFiles parameter, because the backed up keys are not restored in that case. In any circumstance, backed up keys are deleted when a shared configuration is disabled.

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

Inputs

None

Outputs

Object