Unknown error (0x80005000) When getting the memeber of local computer group


i have wcf service has function members of local pc groups. works fine couple of days, reason start getting above error message. recycle app pool , works ok again little bit. not sure have wrong.

here code:

  public shared function getmembersoflocalgroup(byval computername as string, byval groupname as string) as groupmemberslist    dim returnvalue as new groupmemberslist      'set username , password    const username as string = "domain\user"    const password as string = "somepassword"        if not (string.isnullorempty(computername)) then     if not (string.isnullorempty(groupname)) then        'clear characters      computername = computername.trim      groupname = groupname.trim        try          'connect local pc information provided        using localcomputer as new directoryentry("winnt://" & computername & ",computer", username, password)         using localcomputergroup as directoryentry = localcomputer.children.find(groupname, "group")            'connect local pc group          if (localcomputergroup isnot nothing) then             'get members of group           dim members as object = localcomputergroup.invoke("members")             if (members isnot nothing) then              'add each member return list groupmember class            for each member as object in ctype(members, ienumerable)               'convert object directory entry             using objmember as directoryentry = new directoryentry(member)                'check see if domain account or local              if not (objmember.path.tolower.contains(computername.tolower)) then                 'create new groupmember class               dim newmember as new groupmember                 'set values new groupmember               newmember.samaccount = objmember.name                 if (objmember.schemaclassname.tostring = "user") then                newmember.membertype = membertype.user               else                newmember.membertype = membertype.group               end if                 returnvalue.memberlist.add(newmember)                end if               end using              next            end using        end using      

 

i not sure why code work short period fine , stop. did searching on error code , thing found was referenced double hop issue , said fix pass username , password in constructor of directory entry object. have done that, still error time time.

thanks!

 

i think better post question in "the official scripting guys forum!".

 


posting provided "as is" no warranties or guarantees , , confers no rights.

microsoft student partner
microsoft certified professional
microsoft certified systems administrator: security
microsoft certified systems engineer: security
microsoft certified technology specialist: windows server 2008 active directory, configuration
microsoft certified technology specialist: windows server 2008 network infrastructure, configuration



Windows Server  >  Directory Services



Comments

Popular posts from this blog

Motherboard replacement

Cannot create Full Text Search catalog after upgrading to V12 - Database is not fully started up or it is not in an ONLINE state

Remote Desktop App - Error 0x207 or 0x607