コード例 #1
0
ファイル: GroupPolicy.cs プロジェクト: xxfcz/SecureMe
        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;
        }
コード例 #2
0
ファイル: GroupPolicy.cs プロジェクト: xxfcz/SecureMe
        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;
        }