Re: Manage User Privileges Programmatically

From: Roger Abell [MVP] (mvpNoSpam_at_asu.edu)
Date: 10/22/05


Date: Sat, 22 Oct 2005 11:20:26 -0700

I am not pointing you at a .h here, but rather commenting on what
you seem to be trying to do, which is fool with the user rights.
As a dev I understand the need to make sure that an account has
the needed rights. As an admin I have disgust at installers that fool
with the user rights settings, which generally I have locked down by
use of group policy. On one of my machines your installer would
result in a non-working install as soon as group policy applied from
the AD level. Worse, as your installed thought all was good, I have
no indication that the service account was granted the right, which
later disappears.
Solution: document in the install docs that your installed expects a
group named "x" that is granted the user right to log on as a service,
and give the admin a way to specify "x" if they do not like your
default. Your installer just makes sure the account is in the group.
Everyone is happy. It works with group policy latch down, your
install works and keeps working, and admins do not feel your install
is being sneeky tweaking critical settings behind the scenes.
<ciuly0@gmail.com> wrote in message
news:1129899960.165326.100260@f14g2000cwb.googlegroups.com...
> Hi all,
>
> I am trying to translate the code from the following article into
> delphi. I mostly succedded but I cannot seem to find the definition of
> 3 constants. I looked in the latest platform sdk and they are simply
> not there.
>
> the article in question:
> http://support.microsoft.com/default.aspx?scid=kb;en-us;132958
>
> the constants:
> ACCOUNT_ADJUST_SYSTEM_ACCESS
> ACCOUNT_VIEW
> ACCOUNT_ADJUST_PRIVILEGES
>
> I did found a file NTSecApi.h but it deosn't contain those definitions.
> I think that since the article relates to win nt and 2000 maybe those
> definitions are present in the nt or 2000 platform sdk. I couldn't get
> a copy of any of the 2 and that is why I am asking for your help.
>
> I also looked into the reactOS and wine sources, but with no luck.
>
> If the above is not possible, then I would like another way of
> programatically manage a users privilege.
> What I am trying to do is programatically grant the "Logon as a
> service" right to a newly created user. I need something that will work
> at least on winxp, and it will be better if it will run on all windows
> nt platforms.
>
> Thanks in advance for your help.
>



Relevant Pages

  • Re: Homepage defaults to MSN at random
    ... In addition to updating and running your AV, download, install and run the programs below in Safe Mode with Hidden Files enabled. ... CastleCops HiJackThis Forum ... The IE start page is locked via group policy, end users cannot change it, ... > rather than at the intranet site specified in Group Policy. ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: Windows Update Error on XP 64bit: update is redirected from v6
    ... I stopped it, did a cold boot, and afterward tried windows update, but still ... This was a fresh install on a new hd and has been extremely stable .. ... Proxycfg settings WORKED. ... Microsoft Windows 2000 Operating System Group Policy Result tool ...
    (microsoft.public.windowsupdate)
  • Re: Windows Update Error on XP 64bit: update is redirected from v6
    ... In order to enable AHCI without reinstalling windows I had to pull ... under 'Reset the default security provider in Windows XP '. ... was this a clean reinstall of XP or a Repair Install? ... Microsoft Windows 2000 Operating System Group Policy Result tool ...
    (microsoft.public.windowsupdate)
  • Re: Advanced Client Installations on Restricted W2K machines
    ... Add the group policy snap in to MMC then choose default domain policy. ... client and will need to re-direct the source file resolution to that source. ... >> user to launch the SMS client installation as an administrative user. ... >>> the equation and install the SMS client via login scripts, ...
    (microsoft.public.sms.admin)
  • Re: Group Policy Failed to Initialize in WXP Pro SP2
    ... possibly have any effect that I haven't got Group Policy in my WXP Pro ... Will it install even if I do find it? ... Once the content has been modified, restart your computer and try to open Group Policy snap-in or to re-register Gpedit.dll again. ...
    (microsoft.public.windowsxp.general)