{"id":121,"date":"2009-12-13T02:11:14","date_gmt":"2009-12-13T01:11:14","guid":{"rendered":"https:\/\/harun.se\/blog\/?p=121"},"modified":"2009-12-13T02:52:46","modified_gmt":"2009-12-13T01:52:46","slug":"exchange-2010-certificate-request-and-installation","status":"publish","type":"post","link":"https:\/\/harun.se\/blog\/?p=121","title":{"rendered":"Exchange 2010 &#8211; Certificate request and Installation"},"content":{"rendered":"<p>I was installing my new Exchange 2010 farm during the weekend and I realized that the certificate installation whitepapers\u00a0on the technet does not work,<\/p>\n<p>\u00a0if you run the\u00a0following command in the exchange shell as it is suggested on the\u00a0technet:<\/p>\n<p><em><span style=\"color: #ffff99;\">Import-ExchangeCertificate -Path c:\\certificates\\filename.cer -friendlyname &#8220;Contoso CAS01&#8221;<\/span><\/em><\/p>\n<p><em><span style=\"color: #ffffff;\">you will get the following error:<\/span><\/em><\/p>\n<p><span style=\"color: #ff6600;\">A positional parameter cannot be found that accepts argument <span style=\"color: #ffff99;\"><strong>&#8216;-Path&#8217;<\/strong><\/span>.<\/span><\/p>\n<p><span style=\"color: #ff6600;\">+ CategoryInfo : InvalidArgument: (:) [Import-ExchangeCertificate], ParameterBindingException<\/span><\/p>\n<p><span style=\"color: #ff6600;\">+ FullyQualifiedErrorId : PositionalParameterNotFound,Import-ExchangeCertificate<\/span><\/p>\n<p><span style=\"color: #ffffff;\">and if you run the following command <\/span><\/p>\n<p><span style=\"color: #ffff99;\"><em>New-ExchangeCertificate -generaterequest -subjectname &#8220;dc=com,dc=contoso,o=Contoso Corporation,cn=exchange.contoso.com&#8221; -domainname CAS01,CAS01.exchange.corp.constoso.com,exchange.contoso.com, ,autodiscover.contoso.com -PrivateKeyExportable:$true -path c:\\certrequest_cas01.txt<\/em><\/span><\/p>\n<p><span style=\"color: #ffffff;\">as it&#8217;s also suggested on the technet you will get the following error:<\/span><\/p>\n<div><span style=\"color: #000000;\"><span style=\"color: #ff0000;\">A positional parameter cannot be found that accepts argument &#8216;<span style=\"color: #ffff99;\">-Path&#8217;<\/span>.<\/span><\/span><\/div>\n<div><span style=\"color: #000000;\"><span style=\"color: #ff0000;\">+ CategoryInfo : InvalidArgument: (:) [New-ExchangeCertificate], ParameterBindingException<\/span><\/span><\/div>\n<div><span style=\"color: #000000;\"><span style=\"color: #ff0000;\">+ FullyQualifiedErrorId : PositionalParameterNotFound,New-ExchangeCertificate<\/span><\/span><span style=\"color: #000000;\">\u00a0<\/span>all because, it is not possible to use the<strong><span style=\"color: #ff0000;\"> -Path<\/span><\/strong> argument without using a\u00a0pipe and Get or Set-content\u00a0commands.<\/p>\n<p>I have decided to write this article\u00a0to help others until the samples on the technet are corrected.\u00a0My examples below\u00a0are tested and working.<\/p>\n<p>Start the Exchange shell as administrator\u00a0from the server where you want to install a certificate, type the following command to create a request file: <em>(Don&#8217;t forget to change <span style=\"color: #00ffff;\">yourdomain.com<\/span> and <span style=\"color: #00ffff;\">yourservername<\/span> with your own names and addresses)<\/em><\/p>\n<p><strong><em>New-ExchangeCertificate -GenerateRequest -Domainname <span style=\"color: #00ffff;\">*.yourdamain.com<\/span>, <span style=\"color: #00ffff;\">YOURSERVERNAME<\/span> -FriendlyName <span style=\"color: #00ffff;\">YOURSERVERNAME.yourdamain.com<\/span> -PrivateKeyExportable $True | Set-Content -Path <span style=\"color: #ff0000;\">c:\\certrequest.txt<\/span><\/em><\/strong><\/p>\n<p>Send the c:\\certreq.txt to your third-party CA that will issue a SAN\u00a0Certificate for you, or if you want to use your own Windows CA, surf to <a href=\"https:\/\/yourCA\/certsrv\">https:\/\/yourCA\/certsrv<\/a> and make an advanced request to request a Web Server certificate using the text file you just created in the previous step.<\/p>\n<p>After Your CA delivers a .cer file for the request that you sent in the previous step run the following command to complete the certificate request and install it at the same time:<\/p>\n<div><strong><em>import-exchangecertificate -FileData ([Byte[]]$(Get-Content -Path <span style=\"color: #ff0000;\">C:\\temp\\certnew.cer<\/span> -Encoding byte -ReadCount 0))<\/em><\/strong><\/div>\n<div><strong><\/strong><\/div>\n<div>Run the following command to see if the certificate is installed on your server<\/div>\n<div><strong><strong><em><span style=\"color: #ffff99;\">Get-ExchangeCertificate<\/span><\/em><\/strong><\/strong><\/div>\n<div>you will see a list of certificates installed on the server, The<strong> <\/strong><span style=\"color: #ffff99;\"><strong>Self-Assigned server cert<\/strong> <\/span>is used for all exchange services as default which is also shown in the list, and you will see<span style=\"color: #ffcc99;\"><strong> the new Server cert <\/strong><\/span>in the list, copy the<strong><span style=\"color: #ffcc99;\"> thumbprint of the new cert<\/span> <\/strong>that you just installed to use it in the next command<\/div>\n<p><strong>Thumbprint Services Subject<\/strong><\/p>\n<p><strong>&#8212;&#8212;&#8212;- &#8212;&#8212;&#8211; &#8212;&#8212;-<\/strong><\/p>\n<div><em><span style=\"color: #ffcc99;\"><strong>BEAADCE41051CB7186A08C51E2503211CA54A22D<\/strong><\/span><\/em><\/div>\n<div><em><span style=\"color: #ffcc99;\">&#8230;.. CN=owa.yourdamain.com, O=Your organization, C=se<\/span><\/em><\/div>\n<div><span style=\"color: #ffff99;\"><strong><em>8499BB03EDBA51F22455244C1003A749D43BBBB7 IP..S. CN=YOURSERVERNAME<\/em><\/strong><\/span><\/div>\n<p>enter the following command by using the new certificates Thumbprint, this will enable the certificate for the\u00a0IIS and SMTP<\/p>\n<p><em><strong>Enable-ExchangeCertificate <\/strong><span style=\"color: #ffcc99;\">BEAADCE41051CB7186A08C51E2503211CA54A22D<\/span><strong> -service iis<\/strong><\/em><\/p>\n<p>That&#8217;s it \ud83d\ude42<\/p>\n<p><strong><em>\u00a0<\/em><\/strong><\/p>\n<p>\u00a0<\/p><\/div>\n","protected":false},"excerpt":{"rendered":"<p>I was installing my new Exchange 2010 farm during the weekend and I realized that the certificate installation whitepapers\u00a0on the technet does not work, \u00a0if you run the\u00a0following command in the exchange shell as it is suggested on the\u00a0technet: Import-ExchangeCertificate -Path c:\\certificates\\filename.cer -friendlyname &#8220;Contoso CAS01&#8221; you will get the following error: A positional parameter cannot [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[8],"tags":[],"_links":{"self":[{"href":"https:\/\/harun.se\/blog\/index.php?rest_route=\/wp\/v2\/posts\/121"}],"collection":[{"href":"https:\/\/harun.se\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/harun.se\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/harun.se\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/harun.se\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=121"}],"version-history":[{"count":6,"href":"https:\/\/harun.se\/blog\/index.php?rest_route=\/wp\/v2\/posts\/121\/revisions"}],"predecessor-version":[{"id":123,"href":"https:\/\/harun.se\/blog\/index.php?rest_route=\/wp\/v2\/posts\/121\/revisions\/123"}],"wp:attachment":[{"href":"https:\/\/harun.se\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=121"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/harun.se\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=121"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/harun.se\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=121"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}