¿Cómo configuro las políticas de grupo en AD? Puedo crear mi unidad organizativa, pero también necesito adjuntar una política de grupo que vincule a ella. Entonces esto es lo que tengo hasta ahora.Política de grupo de enlaces de C# en AD
string strOU = "OU=test454545,OU=Clients,OU=Clients,DC=domain,DC=net";
GPMGMTLib.GPM gpm = new GPMGMTLib.GPM();
GPMGMTLib.GPMConstants gpc = gpm.GetConstants();
GPMGMTLib.GPMDomain gpd = gpm.GetDomain(Environment.GetEnvironmentVariable("USERDNSDOMAIN"), "", gpc.UseAnyDC);
GPMGMTLib.GPMSOM gpSom = gpd.GetSOM(strOU);
GPMGMTLib.GPMGPO gpo = gpd.CreateGPO();
gpo.DisplayName = "TestOutCome";
gpSom.CreateGPOLink(-1,gpo);
Esto todavía no crea el vínculo de GPO, pero todo lo que quiero hacer es vincular un GPO existente, anyt pensamientos? Y gracias por la ayuda.
bien cada vez más cerca, esto acaba de crear una política de no vincular realidad uno ya existente ...
string strGPO = "Default Security with web access";
string strOU = "OU=test454545,OU=Clients,OU=Clients,DC=domain,DC=net";
GPMGMTLib.GPM gpm = new GPMGMTLib.GPM();
GPMGMTLib.GPMConstants gpc = gpm.GetConstants();
GPMGMTLib.GPMDomain gpd = gpm.GetDomain(Environment.GetEnvironmentVariable("USERDNSDOMAIN"), "", gpc.UseAnyDC);
GPMGMTLib.GPMSearchCriteria searchOBJ = gpm.CreateSearchCriteria();
searchOBJ.Add(gpc.SearchPropertyGPODisplayName, gpc.SearchOpEquals, strGPO);
GPMGMTLib.GPMGPOCollection objGPOlist = gpd.SearchGPOs(searchOBJ);
GPMGMTLib.GPMSOM gpSom = gpd.GetSOM(strOU);
GPMGMTLib.GPMGPO gpo = gpd.CreateGPO();
gpSom.CreateGPOLink(-1,gpo);
de actualización y de Trabajo:
Esto es para la vinculación de GPO existente a la unidad organizativa usando C#
1) instalar http://www.microsoft.com/downloads/en/confirmation.aspx?FamilyID=0a6d4c24-8cbd-4b35-9272-dd3cbfc81887
gpmgmt.dll 2) Referencia (que se encuentra en el directorio de instalación)
3) Es posible que tenga que instalar .Net 1.1
4) Agregue referencias a VS
5) agregue usando GPMGMTLib; usando GPOADMINLib; para proyectar
string strGPO = "Default Security with web access";
string strOU = "OU=test454545,OU=Clients,OU=clients,DC=domainh,DC=net";
GPMGMTLib.GPM gpm = new GPMGMTLib.GPM();
GPMGMTLib.GPMConstants gpc = gpm.GetConstants();
GPMGMTLib.GPMDomain gpd = gpm.GetDomain(Environment.GetEnvironmentVariable("USERDNSDOMAIN"), "", gpc.UseAnyDC);
GPMGMTLib.GPMSearchCriteria searchOBJ = gpm.CreateSearchCriteria();
searchOBJ.Add(gpc.SearchPropertyGPODisplayName, gpc.SearchOpEquals, strGPO);
GPMGMTLib.GPMGPOCollection objGPOlist = gpd.SearchGPOs(searchOBJ);
GPMGMTLib.GPMSOM gpSom = gpd.GetSOM(strOU);
GPMGMTLib.GPMGPO gpo = gpd.CreateGPO();
gpSom.CreateGPOLink(-1,objGPOlist[1]);
alguien? esto no puede ser imposible ... –
preguntaste hace 22 minutos. Se paciente. – Amy
so gpd.GETSOM ("Seguridad predeterminada con acceso web") está creando un NUEVO ou? – kd7