Adding properties (attributes) to existing objects... help!

Adding properties (attributes) to existing objects... help!

Post by Michael Dub » Tue, 18 Feb 2003 11:50:06



Hi,

I am new to ADSI and need some help :).

I am using VB and am writing a very basic entry manager.  I am able to Add
new entries, Delete existing entries, and search just fine.  The problem
comes when I try to modify existing entries that don't already use all of
the attributes that I am using.  It appears that I am not able to add new
properties (attributes) to an entry.  I am able to modify properties that
exist, but when I try to use the setinfo method after I put a property that
did not already exist in the entries property cache, I get an error.  So...
how the heck do I add a new property to an entry?  A code snippet would be
very useful.  All of the examples I have been able to find only discuss
adding values to existing properties.  Even the ADSI control code
enumerations give the impression that you can't 'add' a property
(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/netd...
i/ads_property_operation_enum.asp).  They only have Clear, Update, Append
and Delete... what about Add?

Thanks,

Mike

 
 
 

Adding properties (attributes) to existing objects... help!

Post by Michael Dub » Tue, 18 Feb 2003 12:13:58


Nevermind.  I seem my mistake and have corrected it.

Mike


Quote:> Hi,

> I am new to ADSI and need some help :).

> I am using VB and am writing a very basic entry manager.  I am able to Add
> new entries, Delete existing entries, and search just fine.  The problem
> comes when I try to modify existing entries that don't already use all of
> the attributes that I am using.  It appears that I am not able to add new
> properties (attributes) to an entry.  I am able to modify properties that
> exist, but when I try to use the setinfo method after I put a property
that
> did not already exist in the entries property cache, I get an error.
So...
> how the heck do I add a new property to an entry?  A code snippet would be
> very useful.  All of the examples I have been able to find only discuss
> adding values to existing properties.  Even the ADSI control code
> enumerations give the impression that you can't 'add' a property

(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/netd...

- Show quoted text -

Quote:> i/ads_property_operation_enum.asp).  They only have Clear, Update, Append
> and Delete... what about Add?

> Thanks,

> Mike


 
 
 

1. Add new attributes to existing Hardware Inventory objects

Hi there,

I'm using MIF files to extend the Hardware inventory.
For client machines I can add more groups to the Hardware Inventory as in
this example:

Start Component
 Name = "Workstation"
 Start Group
  Name = "System"
  ID = 1
  Class = "System"
  Key = 2
  Pragma = "sms:add"
  Start Attribute Name = "Name" ID = 1 Type = String Value = "MyName" End
Attribute
 End Group

 Start Group
  Name = "My Group"
  ID = 2
  Class = "userInformation"
  Pragma = "sms:add"
  Key = 1
  Start Attribute Name = "My information 1" ID = 1 Type = String Value =
"Some info" End Attribute
  Start Attribute Name = "My information 2" ID = 2 Type = String Value =
"Another info" End Attribute
 End Group
End Component

This will add "My Group" group into Hardware Inventory.

However I want for existing groups (objects) in the Hardware Inventory to
add more attributes.
E.g. for Operating System group I want to add a new Attribute "Vendor". This
MIF file will not
be processed by SMS:

Start Component
 Name = "Workstation"
 Start Group
  Name = "System"
  ID = 1
  Class = "System"
  Key = 2
  Pragma = "sms:add"
  Start Attribute Name = "Name" ID = 1 Type = String Value = "My name" End
Attribute
 End Group

 Start Group
  Name = "Operating System"
  ID = 2
  Class = "MICROSOFT|OPERATING_SYSTEM|1.0"
  Pragma = "sms:add"
  Start Attribute Name = "Name" ID =1 Type = String Value = "MacOS" End
Attribute
  Start Attribute Name = "Version" ID =17 Type = String Value = "8.6" End
Attribute
  Start Attribute Name = "Manufacturer" ID =11 Type = String Value =
"Microsoft Corporation" End Attribute
  Start Attribute Name = "Vendor" ID = 100 Type = Strig Value = "ABC
Software" End Attribute
 End Group
End Component

Can anybody tell me how do I add new attributes to existing objects in
Hardware Inventory using MIF files?
 Thanks.

---------------------------------------------------------------
Dorel Sturm
Germany

2. How to ctrl. MoBO chipset in OS/2 or WPCREDIT like soft for OS/2 ?

3. get GUID for object attribute/property

4. Sound Card Questions

5. Adding Properties to an AD Object

6. PBX Interface Help Needed

7. How add properties to an object (user, organization unit, etc)

8. SBS 4.5 & OWA

9. Can user-defined property been added to a user object in win2k

10. Help With User Object - Getting Attributes

11. ways to access properties using ADSI IADsUser object properties like telephoneno

12. Binding AD only for spesific object attributes returns more than specified......