Importing and applying multiple security templates - via script?

cantoris
cantoris used Ask the Experts™
on
I have a number of security templates I have made to fix permissions issues with various legacy apps and I want to be able to import a (varying) selection of them via some VBScript and then apply the end result to the local machine.  I have been intending to use calls to secedit.exe to do this.

For some reason in XP (perhaps only dating from a recent service pack), secedit.exe no longer includes the "/import" feature to import a security template into a database.  It can only import a single one as part of the "/configure" command.  There is nothing I have found on the MS site to even mention this change has occurred but if you try secedit /? on the command line, the helpfile that opens no longer shows the /import switch.
In Vista though, the /import feature has returned again.

I had been using a copy of an older version of secedit.exe that does still import but I am not overly keen on using an older system file in this way since it is probably not supported to do so.  It seems therefore that I am going to have to have multiple import&apply steps using "/configure" but this seems a messy way to do it.

Does anyone have any suggestions as to whether there is a better way around this?  I don't fancy trying to set ACLs directly from vbscript - I'm not that developery and security templates have such a quick and foolproof interface and are easily read by non-scripters too!
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
x-menIT super hero

Commented:
maybe xcacls.vbs will help

more info in:
http://support.microsoft.com/kb/825751

Author

Commented:
I need to use something native to the OS that doesn't need installing separately but I don't want to have to script loads of complex ACL adjustments indiviudally.  The security template system makes them so easy to put together and adjust - for other people too.

Is there any other way of applying security templates from within a script without using secedit?
x-menIT super hero

Commented:
xcacls.vbs is a vbs script provided by Microsoft, it doesn't need intalling. You'll just havo to "adjust" it to your needs

Author

Commented:
I mean from the point of view of it not being a natively-present part of the OS installation.  I want to be able to run whatever script solution I write on any PC without it requiring a non-standard pre-requisite such as the presence of xcacls.
Xcacls is a decent script but is not the type of solution I am looking for in this circumstance.  Thanks for the suggestion though.
Commented:
It appears there's no way around this.  I've coded my script to import and apply templates one at a time.
Thanks for looking.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial