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
/heinrich
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...
Think I'll have to do that.
/Heinrich
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
/heinrich