How Can I Import Certificate .SST File Into A GPO?

We're in a semi disconnected environment and I need to import an .SST file monthly with current root certificates and import the file into a Group Policy Object for distribution.

​

I've been doing it manually for a few months but thought it'd be a fun little thing to automate as I get started with PoSh.

Here's what I have so far and it seems to work until the last step when I need to import the .SST into the GPO.

#Establish variables
$TodaysDate = Get-Date -Format yyyyMMdd
$FileNameFormat = "roots" + $TodaysDate + ".sst"

#Download certificates using certutil on UpdateServer.fqdn.com
e:\certutil.exe -generateSSTFromWU roots.sst

#Rename SST with today's date
Rename-Item .\roots.sst -NewName $FileNameFormat

#Copy to Certs dir with today's date
Copy-Item .\$FileNameFormat '\\FileServer\certs\'

#Import into 'Certificates root' GPO

Computer Configuration\Policies\Windows Settings\Security Settings\Public Key Policies/Trusted Root Certification Authorities.

​

Is there a way to import the certificates into a GPO with PS?

​

*Edit Code Block instead of Inline Code.

Posted Jul 15, 2020, 1:26 AM UTC · edited

25
krzydoug•
2
MrsVagueOP•

I'm a little new to PS so I'll see if I can understand how to use that.

Thanks for the link!

2
Lee_Dailey[grin]•

howdy MrsVague,

it looks like you used the New.Reddit Inline Code button. it's 4th 5th from the left hidden in the ... "more" menu & looks like </>.

there are a few problems with that ...

  • it's the wrong format [grin]
    the inline code format is for [gasp! arg!] code that is inline with regular text.
  • on Old.Reddit.com, inline code formatted text does NOT line wrap, nor does it side-scroll.
  • on New.Reddit it shows up in that nasty magenta text color

for long-ish single lines OR for multiline code, please, use the ...

Code
Block

... button. it's the 11th 12th one from the left & is just to the left of hidden in the ... "more" menu & looks like an uppercase T in the upper left corner of a square..

that will give you fully functional code formatting that works on both New.Reddit and Old.Reddit ... and aint that fugly magenta color. [grin]

take care,
lee

2
MrsVagueOP•

Not new to Reddit but new to posting code. Thanks for the guidance.

2
Lee_Dailey[grin]•

howdy MrsVague,

you are most welcome! glad to help a little bit ... [grin]

take care,
lee

1