-
Notifications
You must be signed in to change notification settings - Fork 1
Block CertificateAccess
Denies a user or an IIS app pool access to a certificate's private key.
Block-CertificateAccess [-UserName] <String> [-Certificate] <X509Certificate2>
[-ProgressAction <ActionPreference>] [-WhatIf] [-Confirm] [<CommonParameters>]
Block-CertificateAccess -AppPool <String> [-Certificate] <X509Certificate2>
[-ProgressAction <ActionPreference>] [-WhatIf] [-Confirm] [<CommonParameters>]
This will explicitly block access to a certificate's private key file, in case you want to test a user or app pool's dependence on it, or aggressively protect it.
PS C:\> Block-CertificateAccess -AppPool ExampleAppPool -Certificate $cert
Denies the ExampleAppPool app pool access to read the cert in $cert.
PS C:\> Find-Certificate -FindValue ExampleCert -FindType FindBySubjectName -StoreName TrustedPeople -StoreLocation LocalMachine |Block-CertificateAccess ExampleAppPool
Denies the ExampleAppPool app pool access to read the found ExampleCert.
The name of an IIS app pool.
Type: String
Parameter Sets: AppPool
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseA certificate from the Windows Certificate Store.
Type: X509Certificate2
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: FalsePrompts you for confirmation before running the cmdlet.
Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseA Windows domain account.
Type: String
Parameter Sets: UserName
Aliases:
Required: True
Position: 0
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseShows what would happen if the cmdlet runs. The cmdlet is not run.
Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False{{ Fill ProgressAction Description }}
Type: ActionPreference
Parameter Sets: (All)
Aliases: proga
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThis cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.