0

got a function that links a GPO to an OU:

using Microsoft.GroupPolicy;

private void LinkTheGPO()
{
    GPDomain domain = new GPDomain("city.dom");

    string sOU = "LDAP://city/ou=room,ou=house,DC=city,DC=dom";

    Som som = domain.GetSom(sOU); //ERROR AT THIS LINE

    som.LinkGpo(-1, gpo);
}

it throws this error :

Value does not fall within the expected range

my OU structure is :

City  
|  
|___House  
     |  
     |____Room
Khaled Rakhisi
  • 317
  • 1
  • 4
  • 18

0 Answers0