Click here to get back home

Accessing Local Security Policy Programatically

 HomeNewsGroups | Search | About
 microsoft.public.windows.server.security    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Accessing Local Security Policy Programatically Rupesh 08-03-2006
Posted by Rupesh on August 3, 2006, 11:35 am
Please log in for more thread options
Hi,

I am NOT finding a way to access Local Security Policy settings
programatically.

The Local Security Policy setting which I'm trying to access is:
"Network Access: Allow anonymous SID/Name translation"

Does anybody have an idea about accessing this settting
programmatically?

Regards,
Rupesh


Posted by Roger Abell [MVP] on August 3, 2006, 5:03 pm
Please log in for more thread options
There is not public interface, scriptable or not, for doing so.
Some things can be accessed with older APIs from C++, for
example the User Rights.
If you are only after one or a few settings, then read in the
sceregvl.inf file and find the targetted reg value and read that.
However, be aware that setting that value will not change
what policy tries to make it become, and what you set will
get wiped out as soon as any policy (local or GPO) defines
that setting.

> Hi,
>
> I am NOT finding a way to access Local Security Policy settings
> programatically.
>
> The Local Security Policy setting which I'm trying to access is:
> "Network Access: Allow anonymous SID/Name translation"
>
> Does anybody have an idea about accessing this settting
> programmatically?
>
> Regards,
> Rupesh
>



Posted by Rupesh on August 7, 2006, 11:26 am
Please log in for more thread options
Hi Roger,

Thanks for the reply.

This setting: "Network Access: Allow anonymous SID/Name translation" is
newly added in Windows XP and Windows 2003 and as you rightly said
there is no public interface, function available to access this
setting.

I tried using sceregvl.inf file and other options you specified, but it
did not work for me.

Is there any other workaround or other way to get this setting? If
not, I'm curious to know how Microsoft reads\writes this information.

I've workaround and I'm trying to verify this. Please see if it makes
sense to you.

- Since this setting is related to "Anonymous SID/Name translation", I
(in the code) impersonate caller anonymously and execute
"LookpAccountSid" on target machine with NTAuthorityLocalSystem SID
("S-1-5-18") and see if this API works or fails.

If API work --> means the resgistry setting is "Enabled"
If API fails --> means the registry setting is "Disabled"

I did get the expected result on Windows2003 but not on Windows XP. I'm
trying to find the reason. Lets see.

Please let me know if you know any solution for this.

Thanks a lot.

Regards,
Rupesh



Roger Abell [MVP] wrote:
> There is not public interface, scriptable or not, for doing so.
> Some things can be accessed with older APIs from C++, for
> example the User Rights.
> If you are only after one or a few settings, then read in the
> sceregvl.inf file and find the targetted reg value and read that.
> However, be aware that setting that value will not change
> what policy tries to make it become, and what you set will
> get wiped out as soon as any policy (local or GPO) defines
> that setting.
>
> > Hi,
> >
> > I am NOT finding a way to access Local Security Policy settings
> > programatically.
> >
> > The Local Security Policy setting which I'm trying to access is:
> > "Network Access: Allow anonymous SID/Name translation"
> >
> > Does anybody have an idea about accessing this settting
> > programmatically?
> >
> > Regards,
> > Rupesh
> >


Similar ThreadsPosted
Local Security Policy "Effective Settings" September 1, 2006, 7:24 pm
Unable to Open Local Security Policy September 1, 2006, 7:26 pm
unable to view configuration from Local Security Policy June 21, 2005, 10:07 pm
local security policy on windows 2003 server April 16, 2007, 10:28 am
Password Security Policy for Local on Window 2003 March 14, 2008, 4:10 pm
Local Security Policy MMC secpol.msc error on Windows Server 2003 March 9, 2007, 10:01 am
Local Computer Policy? July 15, 2006, 7:54 pm
Creating and verifying Domain trust programatically July 5, 2005, 7:09 pm
"the local policy of this system does not permit you to logon interactively" April 11, 2007, 5:15 pm
An extended error has occurred. Failed to save Local Policy Database. August 15, 2005, 2:45 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap