Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

SFB project experience-31-bulk import PFX certificates for n servers

2025-01-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Project background:

Use a public network certificate in the test, which needs to be updated every 3 months, reapply, reissue, re-import, and redistribute.

But when re-importing, if ten or twenty units are imported, it is very tedious and it also takes time.

The test took me 2 days, from Wednesday, February 14, 2018 to Thursday, February 15, 2018.

1. Prepare the certificate file

two。 Prepare CSV-For-All Computers

3. Prepare PowerShell-For-All Computers

# param ([string] $importfile = $(Read-Host-prompt "Please enter a file name"))

# $importedComputers = Import-CSV $importfile

$importedComputers = Import-CSV.\ ComputerNames.csv

Foreach ($importedComputer in $importedComputers)

{

Enter-PSSession-ComputerName $importedComputer.nComputerName

$pfxpath ='C:\ Cert\ iMurray Cloud.com.pfx'

$password01 ='1'

Add-Type-AssemblyName System.Security

$cred01 = ConvertTo-SecureString "1"-AsPlainText-Force

$Username = 'i-x-Cloud\ administrator'

$Password = 'Aa123456'

$pass = ConvertTo-SecureString-AsPlainText $Password-Force

$Cred = New-Object System.Management.Automation.PSCredential-ArgumentList $Username,$pass

Invoke-Command-ComputerName $importedComputer.nComputerName-ScriptBlock {Import-PfxCertificate-Exportable-FilePath'C:\ Cert\ iMurxMuCloud.com.pfx' Cert:\ LocalMachine\ my-Password (ConvertTo-SecureString-String'1'-AsPlainText-Force)}-credential $Cred

}

Note:

B.$importedComputer.nComputerName reads the columns in nComputerName in CSV.

C.$pfxpath ='C:\ Cert\ iMurxmurCloud.com.pfx' reads the local PFX certificate

D.-Password (ConvertTo-SecureString-String'1'-AsPlainText-Force) reads the password of PFX's certificate

E. Invoke-Command-ComputerName $importedComputer.nComputerName executes PowerShell scripts on a remote server

4. Run PowerShell

Execution

5. For rookies, there are several difficulties:

How to import a PFX certificate to any Windows Server 2012 R2 plus domain server.

How to transfer the password of the PFX certificate to the remote server for execution.

Put the PFX certificate on the local C disk, such as C:\ Cert\ i-x-Cloud.com.pfx, for easy reading. Put it in\\ 011-DC01.i-x-Cloud.com\ Cert\ i-x-Cloud.com.pfx, there will be a problem, read through the network, need to solve the problem of user name and password. Do not consider how to solve it, and then solve it later if you have the opportunity. If you solve the problem, you can give it to me, and I will update it to this blog for your convenience.

If you have any questions, please contact the QQ group:

Enterprise unified communication platform actual combat 65235615

This lecturer's offline video course: (consultation: 3313395633 (QQ))

Course 1:

"large Enterprise Skype for Business Server 2015/Lync Server 2013 deployment practice"

Course 2:

"large Enterprise Cloud Desktop deployment practice"

Course 3:

"learn from Cainiao in Cisco UC deployment."

Other video courses for this instructor:

Set meal:

* * *

"Private Cloud deployment practice"-5 cloud computing products (including: Mircrosoft,Linux) (package)

Http://edu.51cto.com/pack/view/id-516.html

* * *

"Private Cloud-deployment practice-1-Microsoft-first Generation-SSP20"

"Private Cloud-deployment practice-2-Microsoft-Generation 2-SC2012R2"

"Private Cloud-deployment practice-3-Microsoft-3rd Generation-WAP"

"Private Cloud-deployment engagement-4-Linux-Cloudstack 4.3"

"Private Cloud-deployment practice-5-Linux-OpenStack-juno"

* * *

* * *

"Private Cloud-basic Features-PK- Microsoft-And-Linux"

* * *

Http://edu.51cto.com/course/course_id-4875.html

* * *

* * *

Learn Lync Server 2013 step by step from scratch (package)

Http://edu.51cto.com/pack/view/id-65.html

* * *

These include:

Phase 01-Plannin

Phase 02-Automation-Management-Virtual Machine

Phase 03-preparation-Foundation-Architecture

Phase 04-deployment-Foundation-Environment

Phase 05-deployment-Enterprise Voice

Phase 06-deployment-call Management Featur

* * *

Deploy Lync Server 2013 in a multi-forest environment

Http://edu.51cto.com/course/course_id-5896.html

* * *

* * *

"Skype for Business Server 2015-on-premises-deployment"

Http://edu.51cto.com/course/course_id-4158.html

"Skype for Business Server 2015-external to the enterprise-deployment"

Http://edu.51cto.com/course/course_id-5890.html

* * *

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report