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 void ProcessRecord() { using (var policy = new LsaPolicy(this.ComputerName, LsaPolicyAccessMask.ViewLocalInformation)) { var policyInfo = new LsaPolicyInformation() { DnsDomain = policy.QueryDnsDomainInformation(), Domain = policy.QueryAccountDomainInformation(), LocalDomain = policy.QueryLocalAccountDomainInformation(), MachineAccountSid = policy.QueryMachineAccountInformation() }; this.WriteObject(policyInfo); } }