Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Windows NT Users and Groups
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00409329
Message ID:
00411014
Vues:
23
>>>>oUser = GETOBJECT("WinNT://SOMEDOMAIN/someusername,User")
>>
>>>I tried this, and there was about a 20 second delay before it found the groups. I suspect it was searching the network for other servers in the domain (I used a server name for SOMEDOMAIN, was this OK?) before it returned an answer. Subsequent requests were nearly instantaneous.
>>
>>You can narrow the search for the computer by qualifying it with a domain or workgroup:
>>
>>oUser = GETOBJECT("WinNT://MYDOMAIN/MYCOMPUTER/someusername,User")
>
>Cool. Is there a way to determine what domain my computer is in? I'm writing a web app, and I can get the computer name from the system variables on the web server, but I don't know how to get the domain.

If you have the WSH, the Wscript.Network object has a Domain property; ADSI and the Win32 API also have ways to query the Domain. You may not see the expected domain in complex domain trusts, where the domain you access for resources might not be the domain that authenticates you.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform