
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Install Certificate to Certificate Store Using PowerShell
To install the certificate using PowerShell, we need to use the Import-Certificate command. For example, we have a certificate stored at the location C:\temp\Mycert.cer and we need to install it in the Personal store of the local machine.
Example
Import-Certificate -FilePath C:\Temp\Mycert.cer ` -CertStoreLocation Cert:\LocalMachine\My\
You can also use the below method.
PS C:\> Set-Location Cert:\LocalMachine\My\ PS Cert:\LocalMachine\My\> Import-Certificate -FilePath C:\Temp\Mycert.cer
To install a certificate on the remote computer, use the Invoke-Command method.
Syntax
Invoke-Command -ComputerName RemoteServer1 -ScriptBlock {Import-Certificate -FilePath C:\Temp\Mycert.cer ` -CertStoreLocation Cert:\LocalMachine\My\ }
The above command will install the certificate on RemoteServer1 from the path C:\temp of the remote server to the personal store of the remote machine.
Advertisements