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.

Change Home Directory Attribute

 Keywords:  

Question:

Again I'm trying to change an attribute in the NDS with Winbatch and again I can't find the format I have to use. We are going to use a different server for the user-profiles, which are located in the users home-dir. So we have to change the users "Home Directory" attribute.If I look at it with an LDAP browser I see the following format:
ndsHomeDirectory = textattribute

cn=BSCWZ2_DATA,ou=services,o=cwz#4#\Profiles\gerrit
Winbatch gives
CN=BSCWZ2_DATA.OU=services..\\Profiles\gerrit

Simply altering the servername and trying to write it back to NDS with 
nwModifyObject(user,"OVERWRITE_VALUE","Home Directory",newname,0,0,0) 
nwModifyObject(user,'*COMMIT*','','',0,0,0)
gives ill formatted attribute value. Can anyone please point me in the right direction?

Answer:

What function call are you making to obtain the existing value of the home directory attribute? If you're intent is to be able to modify that value and then set it in the attribute via nwModifyObject(), make absolutely certain that you call nwGetObjValue(), and set flag bit #0 [value = 1] to ON in the "flag" parameter value. Failing to specify that bit means that the attribute value that is returned defaults to the format that the older N4 extender returned, which in most cases is not truly representative of the structured fields of data that can exist within certain attribute syntax types.

From the help topic for nwGetObjValue():

(i) flag This is a numeric value that contains set of bit mask flags. The flags alter the way that this function operates. Different flag values can be combined by adding their values together or by bitwise OR'ing them together.
Bit 0: (value = 1 if set)

***IMPORTANT***
If the attribute value returned by nwGetObjValue() is to be used in subsequent calls to nwSearchFilter(), nwModifyObject(), etc...,then this flag bit must be set/enabled. Failing to do so will result in the attribute value returned by this function not being in the proper format to pass in to other nw*() extender functions as an attribute value.

If clear:
Return basic string values in same format as the old n4ObjProps function from the old NetWare extender.

If set:
Return all fields from structure type attribute values in a delimited list. The field delimiter is set by the nwSetOptions function and defaults to a vertical bar "|" character. This causes values to be returned in the same format as the n4ObjGetVal function from the old NetWare extender.

User Reply:

Thank you very much. Making the flag 1 made all the difference.

Answer:

When that extenderwas created we would have loved to have made the new function default to the proper format, but that would potentially have required much more re-coding of existing scripts that were migrating over from the older N4 extender to the new NetWareX extender.
Article ID:   W17431
File Created: 2012:11:26:09:53:22
Last Updated: 2012:11:26:09:53:22