How can I import a security template in Windows 7 using command line?

3

I would like to remotely deploy some specific change in Security Policies to several computers via remote console (SSH). This is my just exported security template .inf file, extracted according (mostly) to these instructions :

[Unicode]
Unicode=yes
[Registry Values]
[Privilege Rights]
SeCreateTokenPrivilege = CRON
[Version]
signature="$CHICAGO$"
Revision=1
[Profile Description]
Description=PruebaCRON

It just adds the user "CRON" (homemade) to Local Security Policy snap-in to allow that user to 'Create a token object'.
When I try to import it in another computer (both Windows 7 SP1, 64 bits) doing this:

secedit /import /db secedit.sdb /cfg PruebaCRON.inf /overwrite /log MyLog.txt

... I get a warning message ("overwriting is dangerous, blah blah blah..."), I accept, and there is no error message, but nothing happens. There is no changes at all at secpol.msc.
The log file is a 2 bytes size, with no content (?).
Does anyone know how this command work, or any other method to import this simple change (just adding the user "CRON" to 'Create a token object') to Security Policies in Windows 7 via command line?

Sopalajo de Arrierez

Posted 2014-03-26T01:50:15.520

Reputation: 5 328

@SopalajodeArrierez, I am getting exactly the same issue as you are.. did you figure out what was the problem? – alpha_989 – 2018-06-02T22:41:41.133

Not yet. Sorry, @alpha_989 . – Sopalajo de Arrierez – 2018-06-03T05:18:08.907

1Check the Event viewer to see if there are any errors recorded there. – EliadTech – 2014-03-26T08:27:26.210

No Event Viewer records about this command at all, @EliadTech . I have checked with embedded "eventvwr.msc" and using NirSoft MyEventViewer ( http://www.nirsoft.net/utils/my_event_viewer.html ), that show the full event log in one list, and there is no new entries when I execute the command. Thanks anyway.

– Sopalajo de Arrierez – 2014-03-27T21:36:01.097

>

  • Try running this on a clean Windows VM installation, perhaps something in your system gets in it way.
  • Test this command with slightly different switches, maybe there's something wrong with the syntax.
  • Try monitoring it with ProcMon and see where it falls.
  • < – EliadTech – 2014-03-30T05:25:46.827

    Answers

    1

    You can try method 1 from ibsk8in31's answer over at ServerFault:

    https://serverfault.com/questions/678149/use-script-to-edit-local-group-policy-windows-server-2012

    TLDR:

    secedit /configure /db c:\windows\security\local.sdb /cfg {.\path\to.inf}

    HannesS

    Posted 2014-03-26T01:50:15.520

    Reputation: 153