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

27 lines
997 B
C#

namespace DSInternals.PowerShell.Commands
{
using DSInternals.SAM.Interop;
using System.Management.Automation;
[Cmdlet(VerbsCommon.Get, "LsaPolicyInformation")]
[OutputType(typeof(LsaPolicyInformation))]
public class GetLsaPolicyInformationCommand : LsaPolicyCommandBase
{
#region Cmdlet Overrides
protected override void ProcessRecord()
{
var policyInfo = new LsaPolicyInformation()
{
DnsDomain = this.LsaPolicy.QueryDnsDomainInformation(),
Domain = this.LsaPolicy.QueryAccountDomainInformation(),
LocalDomain = this.LsaPolicy.QueryLocalAccountDomainInformation(),
MachineAccountSid = this.LsaPolicy.QueryMachineAccountInformation()
};
this.WriteObject(policyInfo);
}
protected override LsaPolicyAccessMask RequiredAccessMask => LsaPolicyAccessMask.ViewLocalInformation;
#endregion Cmdlet Overrides
}
}