mirror of
https://github.com/MichaelGrafnetter/DSInternals
synced 2025-04-22 06:56:38 +00:00
- Added the UserPrincipalName parameter to Get-ADReplAccount cmdlet - Improved DRS_MSG_GETCHGREQ_V8 delete - Fixed Set-ADDBBootKey cmdlet output type - Fixed some formatting inconsistencies
53 lines
1.4 KiB
C#
53 lines
1.4 KiB
C#
namespace DSInternals.PowerShell.Commands
|
|
{
|
|
using System.Management.Automation;
|
|
using DSInternals.DataStore;
|
|
|
|
[Cmdlet(VerbsCommon.Set, "ADDBBootKey")]
|
|
[OutputType("None")]
|
|
public class SetADDBBootKeyCommand : ADDBCommandBase
|
|
{
|
|
[Parameter(Mandatory = true)]
|
|
[ValidateNotNull]
|
|
[ValidateCount(BootKeyRetriever.BootKeyLength, BootKeyRetriever.BootKeyLength)]
|
|
[AcceptHexString]
|
|
[Alias("OldKey", "Old", "OldSysKey")]
|
|
public byte[] OldBootKey
|
|
{
|
|
get;
|
|
set;
|
|
}
|
|
|
|
[Parameter(Mandatory = false)]
|
|
[ValidateNotNull]
|
|
[ValidateCount(BootKeyRetriever.BootKeyLength, BootKeyRetriever.BootKeyLength)]
|
|
[AcceptHexString]
|
|
[Alias("NewKey", "New", "NewSysKey")]
|
|
public byte[] NewBootKey
|
|
{
|
|
get;
|
|
set;
|
|
}
|
|
|
|
protected override void BeginProcessing()
|
|
{
|
|
base.BeginProcessing();
|
|
using(var directoryAgent = new DirectoryAgent(this.DirectoryContext))
|
|
{
|
|
directoryAgent.ChangeBootKey(this.OldBootKey, this.NewBootKey);
|
|
}
|
|
// TODO: Verbosity
|
|
// TODO: Exception handling
|
|
}
|
|
|
|
protected override bool ReadOnly
|
|
{
|
|
get
|
|
{
|
|
// We need to modify the PEK List attribute.
|
|
return false;
|
|
}
|
|
}
|
|
}
|
|
}
|