cannot add a group to another group on an hyper-v Virtual machine.
hi,
i try add group group using below code:
directoryentry hostee = mygetgroup(server, hosteegroup);
directoryentry hoster = mygetgroup (server, hostergroup);
//// begin remove machine name.
//// example, original path winnt://domainname/machinename/testgroup,
//// after fix becomes winnt://domainname/testgroup, can added subgroup successfully.
string machinename = environment.machinename;
string stringtoremove = "/" + machinename + "/";
int machinenamestart = hostee.path.indexof(stringtoremove);
string hosteepath = hostee.path;
if (machinenamestart >= 0)
{
hosteepath = hostee.path.remove(machinenamestart, stringtoremove.length - 1);
}
////end of removing machine name.
hoster.invoke("add", new object[] { hosteepath });
this works fine on physical machine. example, can add testgroup1 testgroup2 on physical machine. however, last line threw exception on virtual machine has joined the domain:
unknown error happened setup component: method:addgrouptogroup, server:., hosteegroup:testgroup1, hostergroup:testgroup2. system.reflection.targetinvocationexception: exception has been thrown target of invocation. ---> system.runtime.interopservices.comexception (0x800706fd): the trust relationship between workstation , primary domain failed.
i executed code using my domain account admin on machine. more specific, nothing difference when executed code on physical machine , on vm.
what difference of physical machine , vm causing such different behavior?
is there way make code work vm or exception design?
appreciate help.
thanks
leon
the message indicates secure channel between target workstation , domain has been broken. 1 approach resolving described in http://support.microsoft.com/kb/216393 - simply removing workstation domain , re-adding afterwards. in case, don't believe has (at least directly) fact workstation running on virtualized platform...
hth
marcin
Windows Server > Directory Services
Comments
Post a Comment