WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

NetwareX Extender

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Adding or Removing Groups


Question:

How do i add or remove groups? We have groups like:
.CN=PV_IV-GROEP_DIRGRP.OU=Groups.O=IV-GROUP
.CN=PV_IV-INFRA_BETON.OU=Groups.O=IV-GROUP
etc
I need to add group:
.CN=PV_IV-INFRA_STAAL.OU=Groups.O=IV-GROUP
or to delete an existing group...

I looked at nwAddObjects, but this is not fully clear to me. And what are the "mandatory attributes" when creating a group? Could you give me some hints?

Answer:

Right now, it is necessary to either already know the mandatory attributes, or else figure it out by experimenting with ConsoleOne & the nwGetObjValue() example code or by reading the NDS Schema documentation at Novell's Developer site [http://developer.novell.com/ndk].

Take note of what happens in ConsoleOne when you go to add an object of a specific type. Although the object may be defined to have many attributes of different types, only a few of them are presented in a dialog box at the time you go to add the object. The mandatory attributes will be included among the ones presented on that dialog box.

For all objects of *any* class, there is one mandatory attribute, which is the object's class - "Object Class". You have to add this attribute & its value first before you add any other attribute names & values to the add object buffer.

For an object of class "User", the "Surname" attribute is the only additional mandatory attribute defined for the object class, and you always have to supply a value for this [last name] for every user object that you create.

For an object of class "Group", there are no additional mandatory attributes at all.

The following code will create the group specified above, assuming that you are logged in to eDirectory as a user with rights to create the group. Also, assume that the default tree is being used.

nwAddObject(".CN=PV_IV-INFRA_STAAL.OU=Groups.O=IV-GROUP","ADD_VALUE","Object Class","Group",0,0,0)
nwAddObject(".CN=PV_IV-INFRA_STAAL.OU=Groups.O=IV-GROUP","*COMMIT*","","",0,0,0)
Removing groups is really easy - just call nwRemoveObject() and be sure that you *really* are deleting the correct object. The nwRemoveObject() function is *NOT* going to give you any chance to confirm what you are doing before you do it, so one improperly coded object deletion could cause you more than a bit of grief.
Article ID:   W16536
File Created: 2005:02:18:12:21:20
Last Updated: 2005:02:18:12:21:20