Solved

Rights information for Domain user

Posted on 2000-03-26
17
236 Views
Last Modified: 2010-05-18

Is it possible to get all the rights that user have on a domain ?

Share
FileShare
Groups
etc..

Palli
0
Comment
Question by:palli011000
[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
  • 10
  • 3
  • 3
  • +1
17 Comments
 

Author Comment

by:palli011000
ID: 2658506
I have Delphi 5, is it possible to fix this component ?
http://www.jgsoftware.com/files/accessrights.zip
0
 
LVL 17

Expert Comment

by:inthe
ID: 2658627
what error are you getting with component?
(and what code or line number gives error)

0
 

Author Comment

by:palli011000
ID: 2658851
I install first - cmpComputerAccessRights.pas -

Line: 68.

  if LookupPrivilegeDisplayName (PChar   (Computer), PChar (privilege), buffer, bufSize,    languageID) then

Error :

Types Of Actual And Formal Var Parameters
Must Be Identical

Palli.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:palli011000
ID: 2658855
Barry do you know what this component do ?

Palli.
0
 
LVL 17

Expert Comment

by:inthe
ID: 2659025
to compile  try change the integer vars to cardinal so it look like:

var
  languageID : Cardinal;
  buffer : array [0..256] of char;
  bufSize : Cardinal;
begin
  bufSize := sizeof (buffer);
  if LookupPrivilegeDisplayName (PChar (Computer), PChar (privilege), buffer, bufSize, languageID) then
    result := buffer
  else


if you get that error again on other procedures/functions do the same for their vars if they are type integer and they give error change to cardinal..

btw.
i think this component will do what your after
0
 

Author Comment

by:palli011000
ID: 2659087
it works, but i don't know anything about this component. Do you have any solutions?
( demo etc.. ).

Many thanks
Palli.
0
 
LVL 17

Expert Comment

by:inthe
ID: 2659151
sorry dont have nt here with delphi installed on to install component to test any examples on.

(you cant install this component on win9* only compile it.)
0
 

Author Comment

by:palli011000
ID: 2659180
I have NT4,

this component is to hard for me,

Palli
0
 
LVL 1

Expert Comment

by:yk030299
ID: 2659396
listen
0
 
LVL 20

Expert Comment

by:Madshi
ID: 2660194
I don't know this component. You can use GetFileSecurity/GetNamedObjectSecurity to get a security descriptor for files/shares. Then use GetSecurityDescriptorDacl to get the dacl of this security descriptor. Then you can use GetEffectiveRightsFromAcl to ask what rights your user has in this dacl. This is quite complicated stuff...   :-(

For user info you can use NetUserGetInfo or NetUserGetGroups.

Regards, Madshi.
0
 

Author Comment

by:palli011000
ID: 2662211
Madshi
do you have any examples of this functions?

Palli
0
 
LVL 20

Expert Comment

by:Madshi
ID: 2662988
Only for some, and those examples are deeply integrated in my private components collection (not published yet). So nothing I could offer you right now...   :-(

Sorry.

But you can look on this homepage for C++ knowledge:

http://www.wsb.poznan.pl/~pawel/vb/www.mvps.org/win32/network/nt95.html
0
 

Author Comment

by:palli011000
ID: 2663928
Madshi

If i want to use this function in my Delphi, what uses clause do i use to get it in the list

Uses Windows..........etc....

Palli
0
 

Author Comment

by:palli011000
ID: 2663936

HOW CAN I USE API FUNCTION THAT ARE IN DLL.
0
 

Author Comment

by:palli011000
ID: 2663955

HOW CAN I USE API FUNCTION THAT ARE IN DLL.
0
 
LVL 20

Accepted Solution

by:
Madshi earned 100 total points
ID: 2664043
Most of these functions are not declared anywhere. You have to declare them yourself, either statically or dynamically. This is an example for dynamic linking (extract from my components):

type
  // type for ISecurityObject.Type_, must be 4 byte long (needed by NT security APIs)
  {$minenumsize 4}
    TSecurityObjectType = (seUnknown, seFile, seService, sePrinter, seRegistry,
                                      seShare, seKernelObject, seWindowObject);
  {$minenumsize 1}

type
  // internal types for winNT security functions
  TSecurityInfo    = (siOwner, siGroup, siDAcl, siSAcl);
  TSecurityInfoSet = set of TSecurityInfo;
  PPAcl            = ^PAcl;
  PPSid            = ^PSid;

var
  // winNT security function variables
  GetNamedSecurityInfoW : function (objectName   : PWideChar;
                                    objectType   : TSecurityObjectType;
                                    securityInfo : cardinal;
                                    sidOwner     : PPSid;
                                    sidGroup     : PPSid;
                                    dacl         : PPAcl;
                                    sacl         : PPAcl;
                                    var sd       : PSecurityDescriptor) : cardinal; stdcall = nil;
  SetNamedSecurityInfoW : function (objectName   : PWideChar;
                                    objectType   : TSecurityObjectType;
                                    securityInfo : cardinal;
                                    sidOwner     : PSid;
                                    sidGroup     : PSid;
                                    dacl         : PAcl;
                                    sacl         : PAcl               ) : cardinal; stdcall = nil;
  GetSecurityInfoW      : function (handle       : cardinal;
                                    objectType   : TSecurityObjectType;
                                    securityInfo : cardinal;
                                    sidOwner     : PPSid;
                                    sidGroup     : PPSid;
                                    dacl         : PPAcl;
                                    sacl         : PPAcl;
                                    var sd       : PSecurityDescriptor) : cardinal; stdcall = nil;
  SetSecurityInfoW      : function (handle       : cardinal;
                                    objectType   : TSecurityObjectType;
                                    securityInfo : cardinal;
                                    sidOwner     : PSid;
                                    sidGroup     : PSid;
                                    dacl         : PAcl;
                                    sacl         : PAcl               ) : cardinal; stdcall = nil;

var dll : cardinal;
initialization
  dll := LoadLibrary(advapi32);
  // Windows unloads the library automatically when our program terminates...
  GetNamedSecurityInfoW := GetProcAddress(dll, 'GetNamedSecurityInfoW');
  SetNamedSecurityInfoW := GetProcAddress(dll, 'SetNamedSecurityInfoW');
  GetSecurityInfoW := GetProcAddress(dll,      'GetSecurityInfoW');
  SetSecurityInfoW := GetProcAddress(dll,      'SetSecurityInfoW');

Regards, Madshi.
0
 

Author Comment

by:palli011000
ID: 2664436
thanks
Palli
0

Featured Post

Want Experts Exchange at your fingertips?

With Experts Exchange’s latest app release, you can now experience our most recent features, updates, and the same community interface while on-the-go. Download our latest app release at the Android or Apple stores today!

Question has a verified solution.

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

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses
Course of the Month9 days, 8 hours left to enroll

624 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