The New-HgsGuardian cmdlet creates a cryptographic entity called a Host Guardian Service guardian.
A guardian is a principal that you can grant access to the key that is contained in a key protector.
This command creates a Host Guardian Service guardian named Guardian11.
This guardian can act as owner for a key protector.
Because this command specifies the GenerateCertificates parameter, it generates signing and encryption certificates.
Example 2: Create a guardian by using existing certificates
The first two commands create passwords, as secure strings, by using the ConvertTo-SecureString cmdlet.
For more information, type Get-Help ConvertTo-SecureString.
The commands store the passwords in two variables.
The final command creates a guardian named Guardian21.
The command specifies the necessary signing and encryption certificates as password protected .pfx files.
The passwords stored in the $SecureStringPassword01 and $SecureStringPassword02 must match the passwords used to generate the .pfx files.
Parameters
-AllowExpired
Indicates that this cmdlet can create a guardian by using certificates that are expired.
Specifies the path of a .pfx file that contains a password protected encryption certificate for the guardian.
This .pfx file contains the public and private keys.
Parameter properties
Type:
String
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
AcceptCertificates
Position:
Named
Mandatory:
True
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-EncryptionCertificatePassword
Specifies the password to decrypt the .pfx file that contains the encryption certificate.
Parameter properties
Type:
SecureString
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
AcceptCertificates
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-EncryptionCertificateThumbprint
Specifies the encryption certificate thumbprint.
Parameter properties
Type:
String
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
ByThumbprints
Position:
Named
Mandatory:
True
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-GenerateCertificates
Indicates that this cmdlet generates self-signed signing and encryption certificates for the guardian.
The certificates contain the public and private keys.
If you specify this parameter, the new guardian does not have a trusted root.
Therefore, you must also specify the AllowUntrustedRoot parameter.
Specifies the path of a .pfx file that contains a password protected signing certificate for the guardian.
This .pfx file contains the public and private keys.
Parameter properties
Type:
String
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
AcceptCertificates
Position:
Named
Mandatory:
True
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-SigningCertificatePassword
Specifies the password necessary to decrypt the signing certificate .pfx file.
Parameter properties
Type:
SecureString
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
AcceptCertificates
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-SigningCertificateThumbprint
Specifies the thumbprint of a signing certificate located in the local computer certificate store.
Parameter properties
Type:
String
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
ByThumbprints
Position:
Named
Mandatory:
True
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-WhatIf
Shows what would happen if the cmdlet runs.
The cmdlet is not run.
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable,
-ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see
about_CommonParameters.
Outputs
CimInstance
The Microsoft.Management.Infrastructure.CimInstance object is a wrapper class that displays Windows Management Instrumentation (WMI) objects.
The path after the pound sign (#) provides the namespace and class name for the underlying WMI object.