Example #1
0
        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);
        }
Example #2
0
        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);
            }
        }