473,594 Members | 2,757 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.Manageme nt.ManagementOb jectSearcher("S ELECT UUID FROM Win32_ComputerS ystemProduct"
Dim objMgmt As System.Manageme nt.ManagementOb jec
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(MyStringGu id

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)(netb ootGUID=" & MyGuid.ToString () & "))"
This does not work, and the things I've tried with MyGuid.ToByteAr ray 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 6392
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.Manageme nt.ManagementOb jectSearcher("S ELECT UUID FROM Win32_ComputerS ystemProduct")
Dim objMgmt As System.Manageme nt.ManagementOb ject
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(MyStringGu id)

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)(netb ootGUID=" & MyGuid.ToString () & "))"
This does not work, and the things I've tried with MyGuid.ToByteAr ray 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
634
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 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
0
352
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 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
2
5607
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 memory increases, new ROM chips will be built with lookup tables hardcoded into them. Here is an example of what using a lookup table can do for you. The following program divides to integers from 0 to 4 using lookup tables and times itself...
0
1838
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 on my test system which is a win2K Server running as a domain controller and web server. The second system is a win2K workstation connected to the live win2K domain controller, This computer was able to run the code in the past and now all I keep...
4
3793
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 information using the syntax "LDAP://"?
0
2207
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 correctly, posting to the wrong forum, or committing some other sort of faux pas. My team is developing a Windows Forms application using VS 2005 with SQL Server 2005 on the back end and we're having a problem using ComboBoxes data bound to lookup...
1
2462
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 Directory. This is how i'm accessing AD new DirectoryEntry(LDAP://DomainController, Domain\Username, password) Now for this method I am specifying a Domain\Username and password, there is an overload that only requires a path, but this returns the...
1
4094
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 SAMAccountName to retrieve the last computer the users logged on to. But i am looking for a place where i can learn this information. I was hoping someone out there could point me in the right direction. Below is my code which i have been working on. It can...
0
2402
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 without any problems. What I can't do is find out which groups the user belongs to. The end result will hopefully be a method to ascertain whether the current user is a member of the 'mod' group, the 'admin' group, or neither. I've tried a few...
2
6580
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. Here is my issue...I can search AD for the description of the computer and display it out but am unable to figure out if the " If dirEntry.Properties.Contains("description") Then dirEntry.Properties("description")(0) = "Turek, Brett - Dell...
0
7947
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
7880
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8255
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8242
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6665
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5413
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3868
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2389
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1217
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.