Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

NWDir given name and surname missing

2 views
Skip to first unread message

heinrich13

unread,
Nov 15, 2006, 7:28:12 AM11/15/06
to
Hi

I'm using NWDir to get information about users located in the eDirectory
and then saves it to a textfile and then the info from the textfile will
be read to a database.

Now one of our customers have the following problem:
Some of the users (in their eDirectory ) given name, surname and fullname
are missing in the textfiles. I've seen the textfiles and some users have
all the information and some have all information except given name,
surname and fullname.
When the customer looks in ConsoleOne all users have given name etc.

Is there anyway to disable the showing of given name etc, for some users?
I'm not so familiar with eDirectory. Can someone please help me?

/Heinrich

heinrich13

unread,
Nov 27, 2006, 3:25:28 AM11/27/06
to
Is there not anyone that uses NWDIR that have experienced this kind of
problem or similar?

/heinrich

Wolfgang Schreiber

unread,
Nov 27, 2006, 7:45:01 AM11/27/06
to
Of course you can apply any trustee assignment or rights filter to any level
of the tree - including filters that restrict access to given name, surname
etc. But in this case that user ID would not be able to see the info in C1,
either.

Guess it's time to debug your app ...

Wolfgang


"heinrich13" <hen...@nilex.se> wrote in message
news:Yhxah.2224$jS4....@prv-forum2.provo.novell.com...

heinrich13

unread,
Nov 27, 2006, 9:45:41 AM11/27/06
to
Ok, thanks for the info.

Think I'll have to do that.

/Heinrich

heinrich13

unread,
Dec 1, 2006, 9:38:00 AM12/1/06
to
Here are the code written in Delphi7
------------------------------------

procedure GetUserInfo(sResultFile, sParameters: String);
var i, j, x, y: Integer;
Entries : NWEntries;
NDSObject : NWEntry;
V : Variant;
strsFields, strsData: TStrings;
stmpContext, sDummy: String;
begin
strsFields := TStringList.Create;
strsData := TStringList.Create;
strsContext := TStringList.Create;

splitstring(RootNDS, '', sDummy ,stmpContext);
splitString(sParameters, '> OU=', sDummy, sContext);
stmpContext := stmpContext + '.' + sContext;

if AnsiContainsText(sContext, '.') then//om context innehåller flera
begin
parseString(sContext, '.', strsContext);
sContext := '';
for x := strsContext.Count -1 downto 0 do
sContext := sContext + ''+ (strsContext[x]);
CutStr(sContext,'');//Blir ett för mycket i början
end;

try
NWDir1.FullName := ('NDS:\'+RootNDS+''+sContext);
except
Result.errorMess := 'app terminated, Could not find Entry: '+
sContext;
Exit;
end;

strsData.Add('Current context: '+stmpContext);
NWDir1.Filters :='USER';

try
Entries := NWDir1.Entries; // store the collection
for i := 1 to Entries.Count do
begin
NDSObject := Entries.Item[i-1]; // store a single object
strsData.Add('USER: '+NDSObject.ShortName);
try // read the attribute into the Variant array V
V := NDSObject.GetFieldValue('', Unassigned, TRUE);
for j := 0 to VarArrayHighBound(V, VarArrayDimCount(V)) do
strsFields.Add(String(V[j]));
except
end;
Application.ProcessMessages;

try // read the attribute into the Variant array V
for y := 0 to strsFields.Count-1 do
begin
V := NDSObject.GetFieldValue(strsFields[y], Unassigned, TRUE);
for x := 0 to VarArrayHighBound(V, VarArrayDimCount(V)) do
strsData.Add(strsFields[y]+':'+String(V[x]));
end;
except
end;
strsData.Add('----------');
strsFields.Clear;

end;//for i:=1 to Entries.Count do
except
on e: Exception do Result.errorMess := 'app terminated, '+ e.Message;
end;

strsData.SaveToFile(ExtractFilePath(Application.ExeName)+sResultFile);
strsFields.Free;
strsData.Free;
strsContext.Free;
end;

-------------------------------
/Heinrich

heinrich13

unread,
Dec 28, 2006, 2:59:10 AM12/28/06
to
I think I've got the solution to my problem. Instead of iterating trough
every attribute there is I just search for the attributes I need. Some
attribute for some user seems to halt the reading of information. When I
just search for the attributes I want, all works fine.

/heinrich

0 new messages