Re: NT User info using COM...ASP getObject() alternative
| From: | J Wynia | Date: | Thu, 28 Mar 2002 21:07:54 +0000 |
| Subject: | Re: NT User info using COM...ASP getObject() alternative | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-12809@lists.php.net to get a copy of this message | ||
You can grab some of those variables automatically.
$network = new COM("WScript.Network");
$computername = $network->ComputerName;
$username = $network->UserName;
"Court Shrock" <ShrockC@inhs.org> wrote in message
news:25E1EA6CA52DD311A525009027725B5504142625@exchange1.inhs.org...
> Was searching through the groups and thought I would share this code:
>
> <?php
> // set this to your NT domain
> $DomainName = "domain";
>
> // set this to the username you want info on
> $UserAccount = "username";
>
> // Binds to the user account
> $ADSIObject = new COM("WinNT://" . $DomainName . "/" . $UserAccount);
>
> //Returns full name
> echo $ADSIObject->FullName . '<br>';
>
> //Returns Account Name
> echo $ADSIObject->Name . '<br>';
>
> //Returns Account Description
> echo $ADSIObject->Description . '<br>';
> ?>