Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > PowerShell

Vista - Signing Powershell Scripts with Microsoft Certificate Authority

Reply
 
Old 06-04-2007   #1 (permalink)
Sandy Wood


 
 

Signing Powershell Scripts with Microsoft Certificate Authority

I'd like to sign my Powershell scripts and we have a Microsoft Certificate
Authority root server in our AD domain. Doesn't this mean that all domain
systems have the root certificate automatically installed on them?

That said, I'd like to sign my scripts, somehow, with this script. Most of
the information on certs for Powershell code focus on the steps for a
self-created cert. I'm having a problem applying the steps to a cert that is
created by our own server. Has anyone done this?
--
Sandy Wood
Orange County District Attorney

My System SpecsSystem Spec
Old 06-04-2007   #2 (permalink)
Neil Chambers


 
 

Re: Signing Powershell Scripts with Microsoft Certificate Authority

On 2007-06-04 19:09:03 +0100, Sandy Wood <sandy.wood@nospam.com> said:

> I'd like to sign my Powershell scripts and we have a Microsoft
> Certificate Authority root server in our AD domain. Doesn't this mean
> that all domain systems have the root certificate automatically
> installed on them?
>
> That said, I'd like to sign my scripts, somehow, with this script. Most
> of the information on certs for Powershell code focus on the steps for
> a self-created cert. I'm having a problem applying the steps to a cert
> that is created by our own server. Has anyone done this?


I'm not up to speed on MS Certificate Authority so I can't say if your
clients will have the RootCA Cert.

As for getting a certificate - you need to create a request using the
Certificates MMC snap-in (you will be prompted as to whether you want a
cert for your user id or the machine). Make sure the request type is
for code signing. Send the request to the MS RootCA admin and get them
to sign it and send the completed certificate back. Once imported on
your keychain you should be good to go.

n

My System SpecsSystem Spec
Old 06-04-2007   #3 (permalink)
Sandy Wood


 
 

Re: Signing Powershell Scripts with Microsoft Certificate Authorit

So once I have the cert, do I put it in the Trusted Certs folder?
--
Sandy Wood
Orange County District Attorney


"Neil Chambers" wrote:

> On 2007-06-04 19:09:03 +0100, Sandy Wood <sandy.wood@nospam.com> said:
>
> > I'd like to sign my Powershell scripts and we have a Microsoft
> > Certificate Authority root server in our AD domain. Doesn't this mean
> > that all domain systems have the root certificate automatically
> > installed on them?
> >
> > That said, I'd like to sign my scripts, somehow, with this script. Most
> > of the information on certs for Powershell code focus on the steps for
> > a self-created cert. I'm having a problem applying the steps to a cert
> > that is created by our own server. Has anyone done this?

>
> I'm not up to speed on MS Certificate Authority so I can't say if your
> clients will have the RootCA Cert.
>
> As for getting a certificate - you need to create a request using the
> Certificates MMC snap-in (you will be prompted as to whether you want a
> cert for your user id or the machine). Make sure the request type is
> for code signing. Send the request to the MS RootCA admin and get them
> to sign it and send the completed certificate back. Once imported on
> your keychain you should be good to go.
>
> n
>
>

My System SpecsSystem Spec
Old 06-05-2007   #4 (permalink)
Neil Chambers


 
 

Re: Signing Powershell Scripts with Microsoft Certificate Authorit

On 2007-06-04 21:26:00 +0100, Sandy Wood <sandy.wood@nospam.com> said:

> So once I have the cert, do I put it in the Trusted Certs folder?


I have mine installed under the Current User context in Personal/Certificates

My System SpecsSystem Spec
Old 06-05-2007   #5 (permalink)
Sandy Wood


 
 

Re: Signing Powershell Scripts with Microsoft Certificate Authorit

OK, I see. So I would imagine if I was running a script under some other
credentials, say a service account, I should really get a cert for that user
on the specific system that the script was going to be run on?
--
Sandy Wood
Orange County District Attorney


"Neil Chambers" wrote:

> On 2007-06-04 21:26:00 +0100, Sandy Wood <sandy.wood@nospam.com> said:
>
> > So once I have the cert, do I put it in the Trusted Certs folder?

>
> I have mine installed under the Current User context in Personal/Certificates
>
>

My System SpecsSystem Spec
Old 06-05-2007   #6 (permalink)
Neil Chambers


 
 

Re: Signing Powershell Scripts with Microsoft Certificate Authorit

On 2007-06-05 15:16:01 +0100, Sandy Wood <sandy.wood@nospam.com> said:

> OK, I see. So I would imagine if I was running a script under some
> other credentials, say a service account, I should really get a cert
> for that user on the specific system that the script was going to be
> run on?


The creds you run the script under won't have any baring on the
signature of the script. All you are trying to do when you sign a
script is supply some form of identification. As long as the computer
running the script has a suitable (PoSH) execution policy and is
configured to trust your RootCA, then script execution should run
smoothly.

All I'm interested in when signing a script is how someone can further
identify the source of the script so that they know it to be legitimate
and who's wrists to slap if it causes havock ;-)

n

My System SpecsSystem Spec
Old 06-05-2007   #7 (permalink)
Sandy Wood


 
 

Re: Signing Powershell Scripts with Microsoft Certificate Authorit

OK, I see. That makes sense.
--
Sandy Wood
Orange County District Attorney


"Neil Chambers" wrote:

> On 2007-06-05 15:16:01 +0100, Sandy Wood <sandy.wood@nospam.com> said:
>
> > OK, I see. So I would imagine if I was running a script under some
> > other credentials, say a service account, I should really get a cert
> > for that user on the specific system that the script was going to be
> > run on?

>
> The creds you run the script under won't have any baring on the
> signature of the script. All you are trying to do when you sign a
> script is supply some form of identification. As long as the computer
> running the script has a suitable (PoSH) execution policy and is
> configured to trust your RootCA, then script execution should run
> smoothly.
>
> All I'm interested in when signing a script is how someone can further
> identify the source of the script so that they know it to be legitimate
> and who's wrists to slap if it causes havock ;-)
>
> n
>
>

My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Managing issued certificates on a Certificate Authority PowerShell
Signing Scripts PowerShell
Signing scripts PowerShell
Adding certificate to trusted root authority Vista security
certificate signing request PowerShell


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46