php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #31586 Can't enumerate group membership with ADSI
Submitted: 2005-01-17 21:05 UTC Modified: 2005-01-26 22:07 UTC
From: ash at theleys dot cambs dot sch dot uk Assigned:
Status: Not a bug Package: COM related
PHP Version: 5.0.3 OS: Win2k or 2k3/IIS5 or 6
Private report: No CVE-ID: None
 [2005-01-17 21:05 UTC] ash at theleys dot cambs dot sch dot uk
Description:
------------
Can't iterate through list of NT Group memberships.
Same code (as VBScript) works in asp page (lists group names.)

Reproduce code:
---------------
try {
 $objUser = new COM("WinNT://myDomain/aUserAccountName");
 foreach ($objUser->Groups as $grp) { 
  echo $grp->Name; 
 }
 $objUser = null;

} catch (Exception $e) {
   echo 'Caught exception: ',  $e->getMessage(), "\n";
}


Expected result:
----------------
List of groups that the account is a member of.

Actual result:
--------------
Caught exception: Error Member not found.  

But ->Groups _is_ the collection of groups...

(Have looked at Bug #25759 COM Instantiation causes Script to fail silently)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-01-17 23:02 UTC] derick@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5-STABLE-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5.0-win32-latest.zip
 [2005-01-18 20:04 UTC] ash at theleys dot cambs dot sch dot uk
Tried the snapshot, but exactly the same results.
 [2005-01-26 22:07 UTC] ash at theleys dot cambs dot sch dot uk
Played a lot more, and used () on the end of the method/enumeration object... Worked.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 18:01:31 2024 UTC