views:

33

answers:

2

Uisng this code

ArrayList myItems = new ArrayList();
UserPrincipal oUserPrincipal = GetUser(sUserName);

PrincipalSearchResult<Principal> oPrincipalSearchResult = oUserPrincipal.GetGroups(GetPrincipalContext(sOU));

foreach (Principal oResult in oPrincipalSearchResult)
{
    myItems.Add(oResult.Name);
}
return myItems;

I am getting an error -2147016672 "An operations error occured", tried to google it and I cannot find any answer. It happens on this line oUserPrincipal.GetGroups(GetPrincipalContext(sOU)) but it continues on to the foreach and does not throw any error and continues but if you dont place try and catch then it shows you the exception. Any ideas?

ADDITIONAL INFO

TO add into it if I use oUserPrincipal.GetGroups() without passing an OU, everything works fine.

A: 

You couldn't find any info, because the real error code to google was 0x80072020 (which is -2147016672 converted to hex). Basically it has to do with running under the iUSR_ServerTips account which does not have the access rights needed for the operation you are trying to perform. You can find more info at this link:

http://www.tek-tips.com/viewthread.cfm?qid=1192370&amp;page=1

Michael Goldshteyn
does not make sense as it only happens on certain users on a specific OU. So i guess this is not the answer as it can still perfoem normal operation on other users.
Mondyak