DSInternals/Src/DSInternals.PowerShell/Commands/Datastore/GetADDBKdsRootKeyCommand.cs
2016-10-02 20:29:16 +02:00

28 lines
851 B
C#

namespace DSInternals.PowerShell.Commands
{
using System;
using System.Management.Automation;
using DSInternals.Common;
using DSInternals.Common.Cryptography;
using DSInternals.DataStore;
[Cmdlet(VerbsCommon.Get, "ADDBKdsRootKey")]
[OutputType(typeof(DSInternals.Common.Data.KdsRootKey))]
public class GetADDBKdsRootKeyCommand : ADDBCommandBase
{
// TODO: Add optional Guid parameter
protected override void BeginProcessing()
{
base.BeginProcessing();
using(var directoryAgent = new DirectoryAgent(this.DirectoryContext))
{
foreach(var rootKey in directoryAgent.GetKdsRootKeys())
{
this.WriteObject(rootKey);
}
}
// TODO: Exception handling
}
}
}