#31586 [Fbk->Opn]: Can't enumerate group membership with ADSI
| From: | ash at theleys dot cambs dot sch dot uk | Date: | Tue, 18 Jan 2005 19:05:00 +0000 |
| Subject: | #31586 [Fbk->Opn]: Can't enumerate group membership with ADSI | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-72407@lists.php.net to get a copy of this message | ||
ID: 31586
User updated by: ash at theleys dot cambs dot sch dot uk
Reported By: ash at theleys dot cambs dot sch dot uk
-Status: Feedback
+Status: Open
Bug Type: COM related
Operating System: Win2k or 2k3/IIS5 or 6
PHP Version: 5.0.3
New Comment:
Tried the snapshot, but exactly the same results.
Previous Comments:
------------------------------------------------------------------------
[2005-01-17 23:02:46] 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-17 21:05:32] 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)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=31586&edit=1