Lookup computer in Active Directory using VB.Net

G

Guest

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
 
G

Guest

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top