DSInternals/Src/DSInternals.PowerShell/Commands/LSA/GetLsaBackupKeyCommand.cs
2018-12-30 18:23:49 +01:00

24 lines
735 B
C#

namespace DSInternals.PowerShell.Commands
{
using DSInternals.Common.Data;
using DSInternals.SAM.Interop;
using System.Management.Automation;
[Cmdlet(VerbsCommon.Get, "LsaBackupKey")]
[OutputType(typeof(DPAPIBackupKey))]
public class GetLsaBackupKeyCommand : LsaPolicyCommandBase
{
#region Cmdlet Overrides
protected override void ProcessRecord()
{
var keys = this.LsaPolicy.GetDPAPIBackupKeys();
foreach(var key in keys)
{
this.WriteObject(key);
}
}
protected override LsaPolicyAccessMask RequiredAccessMask => LsaPolicyAccessMask.GetPrivateInformation;
#endregion Cmdlet Overrides
}
}