Ejemplo n.º 1
0
        private static string GetExistingGPOPath(Guid gpoGuid, bool computer)
        {
            Domain domain = Domain.GetCurrentDomain();

            using (GroupPolicyObject existGPO = new GroupPolicyObject())
            {
                try
                {
                    existGPO.OpenDSGpo(domain, gpoGuid, false, false);
                }
                catch (ActiveDirectoryObjectNotFoundException ex)
                {
                    //Tracer.WriteInformation(ex.ToString());
                    return(String.Empty);
                }

                if (computer)
                {
                    return(existGPO.GetFileSystemPath(GpoSection.Computer));
                }
                else
                {
                    return(existGPO.GetFileSystemPath(GpoSection.User));
                }
            }
        }
Ejemplo n.º 2
0
        private static string GetExistingGPOPath(Guid gpoGuid, bool computer)
        {
            Domain domain = Domain.GetCurrentDomain();
            using (GroupPolicyObject existGPO = new GroupPolicyObject())
            {
                try
                {
                    existGPO.OpenDSGpo(domain, gpoGuid, false, false);
                }
                catch (ActiveDirectoryObjectNotFoundException ex)
                {
                    //Tracer.WriteInformation(ex.ToString());
                    return String.Empty;
                }

                if (computer)
                {
                    return existGPO.GetFileSystemPath(GpoSection.Computer);
                }
                else
                {
                    return existGPO.GetFileSystemPath(GpoSection.User);
                }
            }
        }