Esempio n. 1
0
        public ComputerGroupPolicyObject(string computerName, GroupPolicyObjectSettings options = null)
        {
            options = options ?? new GroupPolicyObjectSettings();
            var result = Instance.OpenRemoteMachineGPO(computerName, options.Flag);

            if (result != 0)
            {
                throw new Exception(string.Format("Unable to open GPO on remote machine '{0}'", computerName));
            }
            IsLocal = false;
        }
Esempio n. 2
0
        public ComputerGroupPolicyObject(GroupPolicyObjectSettings options = null)
        {
            options = options ?? new GroupPolicyObjectSettings();
            var result = Instance.OpenLocalMachineGPO(options.Flag);

            if (result != 0)
            {
                throw new Exception("Unable to open local machine GPO");
            }
            IsLocal = true;
        }