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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: ash at theleys dot cambs dot sch dot uk
New email:
PHP Version: OS:

 

 [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

Pull Requests

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: Sat Dec 21 15:01:29 2024 UTC