473,398 Members | 2,403 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Lookup computer in Active Directory using VB.Net

Hi

I need a little help with some VB.Net code..
I am pulling my computer's GUID out using WMI
Dim wmiObj As New System.Management.ManagementObjectSearcher("SELECT UUID FROM Win32_ComputerSystemProduct"
Dim objMgmt As System.Management.ManagementObjec
Dim MyByteGuid As Byte(
Dim MyStringGuid As Strin
Dim MyGuid As Gui
For Each objMgmt In wmiObj.Ge
MyStringGuid = objMgmt("UUID").ToString(
Nex
MyGuid = New Guid(MyStringGuid

This gives me a GUID like: DD5FE69B-2523-11D6-AB9B-FE9338A908D

Now what I need to do i lookup this GUID in the Active Directory, I now that this precise value can be found in the netbootGUID property of my computer account, so I thought it would be like
objSrch.Filter = "(&(objectClass=computer)(netbootGUID=" & MyGuid.ToString() & "))"
This does not work, and the things I've tried with MyGuid.ToByteArray has not worked either..
Does anybody know how I can make the Active Directory lookup on the netbootGUID property ?
I need to find the computers name based on the GUID I get using WMI

All the best
Henning Kristensen
Nov 22 '05 #1
1 6370
Okay, the answer was to flip it around...
So: DD5FE69B-2523-11D6-AB9B-FE9338A908DA
Becomes: \9B\E6\5F\DD\23\25\D6\11\AB\9B\FE\93\38\A9\08\DA (or something like that, haven't got the solution open at the moment)
"Henning Kristensen" wrote:
Hi,

I need a little help with some VB.Net code...
I am pulling my computer's GUID out using WMI:
Dim wmiObj As New System.Management.ManagementObjectSearcher("SELECT UUID FROM Win32_ComputerSystemProduct")
Dim objMgmt As System.Management.ManagementObject
Dim MyByteGuid As Byte()
Dim MyStringGuid As String
Dim MyGuid As Guid
For Each objMgmt In wmiObj.Get
MyStringGuid = objMgmt("UUID").ToString()
Next
MyGuid = New Guid(MyStringGuid)

This gives me a GUID like: DD5FE69B-2523-11D6-AB9B-FE9338A908DA

Now what I need to do i lookup this GUID in the Active Directory, I now that this precise value can be found in the netbootGUID property of my computer account, so I thought it would be like:
objSrch.Filter = "(&(objectClass=computer)(netbootGUID=" & MyGuid.ToString() & "))"
This does not work, and the things I've tried with MyGuid.ToByteArray has not worked either...
Does anybody know how I can make the Active Directory lookup on the netbootGUID property ??
I need to find the computers name based on the GUID I get using WMI.

All the best,
Henning Kristensen

Nov 22 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Henning Kristensen | last post by:
Hi I need a little help with some VB.Net code.. I am pulling my computer's GUID out using WMI Dim wmiObj As New System.Management.ManagementObjectSearcher("SELECT UUID FROM...
0
by: Henning Kristensen | last post by:
Hi I need a little help with some VB.Net code.. I am pulling my computer's GUID out using WMI Dim wmiObj As New System.Management.ManagementObjectSearcher("SELECT UUID FROM...
2
by: CoreyWhite | last post by:
The future of computer architecture will use lookup tables. Currently computer processor speed outweighs the benefits of using computer memory for lookup tables, except in some cases. As computer...
0
by: Kenneth Keeley | last post by:
Hi, I have been working on a Login page that uses ADSI to authenicate the users. I had this all working on my test system and on a second system connected to the live domain. Now it will only work...
4
by: ptran123 | last post by:
I want to do an AD lookup of the current logged on user. From ASP.NET I can get the identity name of the user in the form of "<domain>\<user>". How do I perform an AD search based on that...
0
by: mjsterz | last post by:
I've been working with VB .NET for less than a year and this is the first time I've posted on one of these groups, so let me apologize beforehand if I'm being unclear, not posting my issue...
1
by: Grant Merwitz | last post by:
Is it possible to do an anonymous lookup in active directory through a web page? I am running a site with Domain Authentication activated. I am looking up a users email address in Active...
1
maxamis4
by: maxamis4 | last post by:
Hello folks, Here is the backgroup. I am creating an agent that can find a user in LDAP and return the last logon date. Now i am not sure if with active directory you can user the...
0
by: Zetten | last post by:
I'm trying to develop a page which will grab a few details for the currently logged-in Windows user from the Active Directory controller. I can get the full name of the user from their username...
2
by: brett | last post by:
ok, it appears that i have run into a spot that i am not able to figure out on my own. Let me first say that i have hobbled together this SUB from things i found on the internet and tutorials....
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.