473,624 Members | 2,612 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

AD Octet String

I am trying to update some Active Directory attributes in C#. The C# app creates new computer objects and then populates some attributes. However, I am having problems with one attribute named netbootGUID, which is of type Octet String in AD. I haven't been able to find any working examples on the web. Part of the code follows:

DirectoryEntry entry = new DirectoryEntry( path, m_UserName, m_Password);

DirectoryEntry dChild = entry.Children. Add("CN=" + name, className);

// add attributes
dChild.Properti es["sAMAccountName "].Value = name + "$";
dChild.Properti es["serialNumb er"].Value = serial;

string guid = "4E435220000000 000000054012345 678"

// this doesn't work
dChild.Properti es["netbootGUI D"].Clear();
dChild.Properti es["netbootGUI D"].Add(guid);
// neither does this
dChild.Properti es["netbootGUI D"].Value = guid;

From what I can tell the netbootGUID attribute needs to be set as a byte[]. I tried converting the guid string to a byte[], I tried converting each char in guid to hex and then putting it into a byte[], however none of it has worked.

Does anyone have an example of updating an Octet value in AD with C#?

Thanks for any help.

---
Posted using Wimdows.net Newsgroups - http://www.wimdows.net/newsgroups/
Nov 17 '05 #1
1 7665
For anyone who is interested, I found the solution.

Mandatory attributes need to be written first and then you have to call CommitChanges() . For example:

entry = new DirectoryEntry( path, m_UserName, m_Password);
dChild = entry.Children. Add("CN=" + name, className);

// add attributes
dChild.Properti es["sAMAccountName "].Value = name + "$";
dChild.Properti es["serialNumb er"].Value = serial;
// new security in AD requires a commit here after setting
// the mandatory attributes
dChild.CommitCh anges();

string guid = "4E435220-0000-0000-0000-054012345678"
Guid myGuid1 = new Guid(guid);
dChild.Properti es["netbootGUI D"].Clear();
dChild.Properti es["netbootGUI D"].Add(myGuid1.To ByteArray());
dChild.CommitCh anges();
---
Posted using Wimdows.net Newsgroups - http://www.wimdows.net/newsgroups/
Nov 17 '05 #2

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

Similar topics

5
19479
by: Matthew | last post by:
I am working on some software that uses SNMP to get information from routers and switches. I am using the pysnmp module (v2.0.8) to do the snmp part. The problem that I am having is that when I query a router for mac addresses pysnmp returns octetstrings like this: \000\002\263\254\264\351 \010\000 \301F\021 \010\000 \300\303[ \000\002\263\254\264\241
2
1405
by: darrel | last post by:
Today I got my new XP machine (upgraded from 2k). After spending a day reinstalling all my apps and backups, I almost have things set up. I have put all my files back into wwwroot, but when trying to access localhost, my browser wants to download an octet stream instead. It seems as if it's not understanding what to do with a .aspx file. I have the .net framework installed. Is there another setting/config I'm missing somewhere? -Darrel
2
15473
by: CVerma | last post by:
I'm using an html input control (System.web.UI.HTMLControls.HTMLInputFile) to upload files such as msword, excel, jpg, and pdf. I have the encType property set in the form: encType="multipart/form-data" <INPUT id="UploadFile" type="file" name="UploadFile" runat="server"> Private Sub btnUploadFile_Click(ByVal sender As System.Object, ByVal e
1
2530
by: Guoqi Zheng | last post by:
Dear sir, I am not fully understand the meaning of octet. For example, if I have a string contains unicode data of some Chinese characters, how can I convert it to an array of octet? Thanks in advanced. -- Kind regards
7
19985
by: wenmang | last post by:
Hi all, I have a confusion for representation of hex number: For an unsigned long long number, its max value is: unsigned long long maxNum = 18446744073709551615; if I do: printf("max uint64_t value in hex is %x\n", maxNum); it prints as: "max uint64_t value in hex is ffffffff" but "ffffffff" is the max if I directly input it into MS calculator?
0
4113
by: mylog | last post by:
Hi, I am facing a problem regarding the application/octet-stream.I have written a code that downloads a file stored in the App_Data folder to C:/files/ folder and now what problem I am facing is that when I download the file and open it, it opens from the temporary files folder rather I need it from where I have downloaded the file so that when I click the save button of the opened file it will be saved in the current location. Here's the...
6
22356
by: itgaurav198 | last post by:
Hi, Is it possible to convert a string in "Binary Octet String".?Also, if possible, please make clear what "Binary Octet String" is. Thanks
2
6266
by: miltizem | last post by:
Guys i'm using a software to monitor the signal over noise factor of a traffic ... The result is given under two formats .. First an octet string Second a decibel number my question how can i jumo from the first to the second .. what's the relation ? doesn anyone know ? without progrmming it .. Exemple: In octet string : 31 32 2E 32 30 In Decibel : 12.017 dB
2
9725
by: DragonLord | last post by:
Hi guys, I am curently working with ADAM and AZMAN and I would like to store the users passord in the ADAM database. However it is of type Octet String. Being knew to the world of C# I have no Idea what that is and I tried to convert it t a byte array and then save it but it only errors out. Can anyone help me with. 1. converting a textbox.text to an octet string and 2. converting an octet string value back into a string. Thanks,
0
8246
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
8685
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...
1
8341
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8490
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
7174
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...
1
6112
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4184
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2612
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
1
1796
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.