Add multiple certificates in MDT task sequence

Rick 41 Reputation points
2024-11-15T13:47:38.84+00:00

I am using a deployment task sequence to call a Powershell script to install multiple certificates, but it is not installing them.

I am using the following in the Power Shell Script:

Import-Certificate -FilePath "%DeploymentRoot%\Scripts\certs\cert1.cer" -CertStoreLocation Cert:LocalMachine\My

Import-Certificate -FilePath "%DeploymentRoot%\Scripts\certs\cert2.cer" -CertStoreLocation Cert:LocalMachine\My

Import-Certificate -FilePath "%DeploymentRoot%\Scripts\certs\cert3.cer" -CertStoreLocation Cert:LocalMachine\My
```I tested changing to the full path and installs fine on the server.

I tested the following in the PS script, but doesn't seem to work eventhough if I run the same code while in the last stages of the imaging processs does work.

```powershell
Set-ExecutionPolicy Unrestricted 

z: 

cd Scripts\certs 

Import-Certificate -FilePath "cert1.cer" -CertStoreLocation Cert:LocalMachine\My
```I searched the logs in folder C:\windows\temp\Deployment\Logs, but I don't see any filename for that Task Sequence. I did set the task to "Continue on Error".
Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
13,267 questions
Microsoft Configuration Manager Deployment
Microsoft Configuration Manager Deployment
Microsoft Configuration Manager: An integrated solution for for managing large groups of personal computers and servers.Deployment: The process of delivering, assembling, and maintaining a particular version of a software system at a site.
994 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,619 questions
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.