On Thu, 15 Jul 2004 23:30:15 -0700, Mark Hollander <ma**@atcom.co.za> wrote:
¤ The problem with this function is that it returns the domain name that
¤ the user logged onto.
¤
¤ Scenario
¤
¤ Computer is registered in DomainA
¤ User is registered in DomainB
¤
¤ I want the DomainA name but I get DomainB as the domain name when I use
¤ System.Environment.UserDomainName.
¤
¤ It is important that I get DomainA
I can't test this in a multiple domain environment but see if the following works for you:
Dim WMIComputerSystem As New System.Management.ManagementObjectSearcher("select * from
Win32_ComputerSystem")
Dim WMIInfo As System.Management.ManagementObject
For Each WMIInfo In WMIComputerSystem.Get
Console.WriteLine(WMIInfo("Domain").ToString)
Next WMIInfo
Paul ~~~
pc******@ameritech.net
Microsoft MVP (Visual Basic)