Solved

Novell Network Login id..how do i get it?

Posted on 1998-11-09
5
381 Views
Last Modified: 2010-04-04
Does anyone know how to get the user-id on a novell network using delphi? Is there a function or way i can do that?
I want to use the user-id in my program.  
Also, is there a way i can find out all the valid user on my novell network? not just the ones that are logged on.
Also, how about email groups, can i identify what they are on a novell network? i'm using groupwise i believe.
thanks a lot!
0
Comment
Question by:waipahu
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 4

Expert Comment

by:BoRiS
ID: 1346195
waipahu

I just answered that in the SMTP question...

procedure TForm1.Button1Click(Sender: TObject);
var
Name: array [0..80] of char;
Size: Cardinal;
begin
 WNetGetUser('VWV_FS1', Name, Size);
  Edit1.Text := Name;
end;

Read that question for more info...

Later
BoRiS
0
 
LVL 1

Expert Comment

by:ow
ID: 1346196
 Hi waipahu,

how to find out all the valid users on your novell network depends on what NetWare version you use.
If you use NW 3.x, you must scan the NetWare bindery for user informations, if you use NW 4.x, you have to scan the NDS.

For both you need NetWare SDK, at least the Delphi Import Units for NW SDK.
And you must install NetWare Client32, to have access on the NetWare API routines.

WNetGetUser will only return the (Windows-) loginname, it will not help you, to find a NetWare user-id.

regards
  ow
0
 

Author Comment

by:waipahu
ID: 1346197
Thanks...
I have network 3.11 i believe using Client 32.....later will be moving to 4.11.
How will i do it in 3.11?
any where i can get that info?
Thanks...
also...i am still having problem with my SMTP email program.
I installed it on my co-workers computer and the program came up fine.
it connected to our mail server, but then when i tried to send an email it bombed out.
Why does it work on my computer and not his? this is getting to be so hard
for what seems to be a very simple program.
INPRISE where are you when programmers need help....
bye

0
 
LVL 1

Accepted Solution

by:
ow earned 0 total points
ID: 1346198
 Hi waipahu,

the Novell Libraries for Delphi you find at http://developer.novell.com/ndk/delphilib.htm, size is about 1 MB.
There is a good book from Charles Rose ("Programmer's Guide to Netware"), which describes low level functions in assembler and names the according routines in Client SDK format (now it is called NDK).
The following sorce code is out of this book. The user-IDs you are looking for are retrieved in "Reply.ObjectID".
Instead of "NWCalls" you must use "calwin32" now.

(*                                                                   *)
(* UserInfo - Displays all of the bindery properties for each user   *)
(*                                                                   *)
(* by Charles Rose (adapted to Pascal by Wolfgang Schreiber)         *)
(*                                                                   *)

uses WinCrt, WinDOS, NWCalls;

{$R ROSE.RES}

CONST PSET = 2;


VAR  work                 : Array[1..100] of char ;
     cCode                : WORD;
     connHandle           : NWCONN_HANDLE;
     scanObjectReply      : ScanObjectRep;
     scanPropReply        : ScanPropRep;
     readPropReply        : ReadPropValueRep;

     ScanBinderyResult        : WORD;
     ScanPropertyResult        : WORD;
     ReadPropertyResult   : WORD;
     Reg                  : TRegisters;


Function GetType( ObjectType : Word): String;
BEGIN
   Case Swap( ObjectType ) OF
        0: GetType := 'Unknown';
        1: GetType := 'User';
        2: GetType := 'User Group';
        3: GetType := 'Print Queue';
        4: GetType := 'File Server';
          END;
END;

Function GetSecurity( Security : Byte): String;
VAR   lo, hi   : BYTE ;
      Work     : String;
BEGIN
   lo := Security AND $0F;
   hi := Security AND $F0;
   Case( lo ) of
      $00:         Work := 'Anyone Read, ' ;
      $01:         Work := 'Logged Read, ' ;
      $02:         Work := 'Object Read, ' ;
      $03:         Work := 'Supervisor Read, ' ;
      $04:         Work := 'NetWare Read, ' ;
   END;
   Case( hi ) of
      $00:      Work := Work + 'Anyone Write' ;
      $10:      Work := Work + 'Logged Write' ;
      $20:      Work := Work + 'Object Write' ;
      $30:      Work := Work + 'Supervisor Write' ;
      $40:      Work := Work + 'NetWare Write';
   END;
   GetSecurity := Work
END;

Procedure PrintBinderyScanResults( Reply: scanObjectRep );
BEGIN
   WriteLn;
   WriteLn( 'User : ', ArrayToString(Reply.ObjectName));
   WriteLn( 'ID:    ', hex8(Reply.ObjectID));
   WriteLn( 'Bindery Object Type: ', GetType( Reply.ObjectType ) );
   Write(   'Static/Dynamic Flag: ');
   IF Reply.ObjectFlag > 0 THEN WriteLn( 'Dynamic')
                           else WriteLn( 'Static ' );
   WriteLn( 'Object Security    : ', GetSecurity( Reply.ObjectSecurity ) );
END;

Procedure PrintPropertyScanResults( Reply : scanPropRep );
BEGIN
   Write( '   ', ArrayToString(Reply.PropertyName[1]), '  -- ' );
   IF (Reply.PropertyFlags AND 1)>0 THEN Write( '(Dynamic ')
                                    else Write( '(Static ');
   IF (Reply.PropertyFlags AND 2)>0 THEN Write( 'Set  / ')
                                    else Write( 'Item / ');
   WriteLn( GetSecurity( Reply.PropertySecurity ), ')' );
END;

Procedure PrintSetValues( VAR data );
VAR
   objectID    : NWOBJ_ID;
   ObjType     : NWOBJ_TYPE;
   i           : Byte;
   name        : NWObjectName;
   ID          : Array[1..32] of LongInt absolute data;
   result      : Integer;
BEGIN
   for i := 1 to 32 DO
      if ( ID[i]>0 ) THEN BEGIN
         result := NWGetObjectName(connHandle, ID[i], name, ObjType);
         if result =0 THEN
            WriteLn('         ', hex8(ID[i]), ': ', ArrayToString(name) )
         END;
END;

Procedure PrintPropertyValueReadResults( VAR PropertyName;  Reply :     readPropValueRep);
BEGIN
   if ( Reply.PropertyFlags AND PSET )>0
      THEN PrintSetValues( Reply.data )
      else if ( ArrayToString(PropertyName) = 'IDENTIFICATION' ) THEN
                WriteLn('         ', ArrayToString(Reply.data) );
END;


BEGIN
   cCode := NWGetDefaultConnectionID(ConnHandle);
   ShowError(cCode, 'Get Conn ID', TRUE);

   ScanObjectReply.ObjectID    := $FFFFFFFF;
   repeat
      ScanBinderyResult := NWScanObject(connHandle, '*', OT_USER,
                                ScanObjectReply.ObjectID,
                                ScanObjectReply.ObjectName,
                                ScanObjectReply.ObjectType,
                                ScanObjectReply.ObjectHasProperties,
                                ScanObjectReply.ObjectFlag,
                                ScanObjectReply.ObjectSecurity);
      IF ( ScanBinderyResult = 0 ) THEN
         BEGIN
         PrintBinderyScanResults( ScanObjectReply );

         if ( ScanObjectReply.ObjectHasProperties>0 ) THEN
            BEGIN
            WriteLn( '   Properties:' );
            ScanPropReply.SequenceNumber  := $FFFFFFFF;
            repeat
               ScanPropertyResult := NWScanProperty(connHandle,
                              Addr(ScanObjectReply.ObjectName),
                              ScanObjectReply.objectType, '*',
                              ScanPropReply.sequenceNumber,
                              ScanPropReply.propertyName,
                              ScanPropReply.propertyFlags,
                              ScanPropReply.propertySecurity,
                              ScanPropReply.hasValueFlag,
                              ScanPropReply.moreFlag);
               if ( ScanPropertyResult = 0 ) THEN
                  BEGIN
                  PrintPropertyScanResults( ScanPropReply );
                  if ( ScanPropReply.hasValueFlag > 0 ) THEN
                     BEGIN
                     WriteLn( '      Values:' );
                     ReadPropReply.dataSetIndex := 1;

                     Repeat
                        ReadPropertyResult := NWReadPropertyValue(connHandle,
                               Addr(ScanObjectReply.ObjectName),
                               ScanObjectReply.objectType,
                               Addr(ScanPropReply.propertyName),
                               ReadPropReply.dataSetIndex,
                               ReadPropReply.data,
                               ReadPropReply.moreFlag,
                               ReadPropReply.propertyFlags);

                        if ( ReadPropertyResult = 0 ) THEN
                           BEGIN
                           PrintPropertyValueReadResults( ScanPropReply.PropertyName,                                 ReadPropReply );
                           Inc(ReadPropReply.dataSetIndex)
                           END
                           else
                        if (ReadPropertyResult <> $89EC) THEN
                           ShowError(ReadPropertyResult, 'Reading property', TRUE);
                        Until (ReadPropertyResult > 0) or (ReadPropReply.moreFlag = 0);

                     END;
                  END
                  else
               if ( ScanPropertyResult <> $89FB ) THEN
                  ShowError(ScanPropertyResult, 'Scanning property', TRUE);
              until ( ScanPropertyResult > 0 );
              END
           END
         else
             if ( ScanBinderyResult <> $89FC ) THEN
               ShowError(ScanBinderyResult, 'Scanning bindery object', TRUE);
         PressAnyKeyToContinue;
         until (ScanBinderyResult > 0)
END.

You also may subscribe to Novell DeveloperNet (http://developer.novell.com) to get more information.

Hope this helps.
Regards
  ow
0
 

Expert Comment

by:espeterson
ID: 4158201
If this is a Windows machine, I think you can use the following for just about any type of network:

Var   NetUser : String;
        BufLen: DWORD;
        Buffer: PChar;
begin
    // Get the User name
    BufLen := 255;
    GetMem(Buffer, BufLen);
    try
      if GetUserName(Buffer, BufLen) then
         NetUser := String(Buffer)
      else NetUser := 'none';
    Except
    end;

NetUser will be set with your user name.
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question