Click to See Complete Forum and Search --> : Domain
tcompe
March 1st, 2000, 09:33 AM
Can someone tell me how I can retrieve the domain name a machine belongs to???
Is there a specfic NET API that I could use
I really need this badly so if someone has any suggestions it would be greatly appreciated...
Thanks
tcompe
Kyle Burns
March 1st, 2000, 09:48 AM
What's your platform? NT has API functions available to do this, but Win9x does not.
tcompe
March 1st, 2000, 09:52 AM
Sorry...forgot to mention that
NT
Kyle Burns
March 1st, 2000, 10:33 AM
NetAPI32.dll has a function called NetWkstaUserGetInfo which, when called with the parameter "level" set to 1101 return a space seperated list of domains accessed by the workstation. This may work for you. I've never used it in VB, so maybe someone who has can help you with the call.
Kyle Burns
March 1st, 2000, 10:38 AM
Almost forgot...
take a look at HKEY_LOCAL_MACHINE\Security\Provider
Johnny101
March 1st, 2000, 11:05 AM
i'm running Win NT workstation 4 (sp3). i don't have a provider hive under the security hive. In fact, my security folder is empty. could it be permissions? I'm not sure how that could be, I am in the admin group on the local machine.
oh well.
John
John Pirkey
MCSD
www.ShallowWaterSystems.com
Kyle Burns
March 1st, 2000, 11:14 AM
Maybe do an Edit...Find on your registry for the name of your domain?
Johnny101
March 1st, 2000, 11:30 AM
I found it in these two places:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\DefaultDomainName
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\CachePrimaryDomain
Just FYI.
Thanks,
john
John Pirkey
MCSD
www.ShallowWaterSystems.com
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.