GPO链接,值不在预期范围内

时间:2017-11-23 10:58:54

标签: c# gpo som

有一个将GPO链接到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);
}

它会抛出此错误:

Value does not fall within the expected range

我的OU结构是:

City  
|  
|___House  
     |  
     |____Room

0 个答案:

没有答案