Sunday, March 26, 2017

mongoDB Backup and Restore



Install MongoDB Community Edition on Ubuntu (Optional)

  1. Import the public key used by the package management system.
    sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 0C49F3730359A14518585931BC711F9BA15703C6
  2. Create a list file for MongoDB.
    (Trusty) echo "deb [ arch=amd64 ] http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.4.list
    (Xenial) echo "deb [ arch=amd64,arm64 ] http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.4.list
  3. Reload local package database
    sudo apt-get update
  4. Install the MongoDB packages (Client only)
    sudo apt-get install -y mongodb-org-shell mongodb-org-tools


Backup (Source database from INET Cloud)

mongodump --host=172.17.0.3 --port=27017 \
--username=nutt --password=P@ssw0rd1 \
--authenticationDatabase=admin \
--db=settrade \
--archive=/home/ubuntu/backup/settrade.dmp \
--gzip \
--dumpDbUsersAndRoles \
--verbose=5


Restore (Database on Windows as destination)

mongorestore /host:127.0.0.1 /port:27017 /db:settrade /gzip /drop /restoreDbUsersAndRoles /archive:settrade.dmp
When run montorestore command on Ubuntu, an arguments changes as below:
mongorestore --host=172.17.0.1 --port=27017 --db=settrade --gzip --drop --restoreDbUsersAndRoles --archive=settrade.dmp

Check number of objects in databases (ensure data structure correctly should run db.collection.validate({full: true}) before counting)

use settrade
var collections = db.getCollectionNames();
print('Collections inside the db:');
for(var i = 0,c = 0; i < collections.length; i++){
  var name = collections[i];
  if(name.substr(0, 6) != 'system')
    print(name + ' - ' + db[name].count() + ' records');
    c = c + db[name].count()
}
print("All objects in db: ",c)


Monday, March 13, 2017

Request and install Let's Encrypt certificates to Microsoft IIS



Follow an instruction from orginal site https://github.com/ebekker/ACMESharp/wiki/Quick-Start



Windows PowerShell
Copyright (C) 2014 Microsoft Corporation. All rights reserved.

PS C:\Users\Administrator> Import-Module ACMESharp
PS C:\Users\Administrator> Initialize-ACMEVault
Initialize-ACMEVault : Vault root path contains existing vault data
At line:1 char:1
+ Initialize-ACMEVault
+ ~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Initialize-ACMEVault], Exception
    + FullyQualifiedErrorId : System.Exception,ACMESharp.POSH.InitializeVault

PS C:\Users\Administrator> mkdir c:\Vault


    Directory: C:\


Mode                LastWriteTime     Length Name
----                -------------     ------ ----
d----          3/9/2017   3:59 PM            Vault


PS C:\Users\Administrator> cd C:\Vault
PS C:\Vault> Import-Module ACMEPowerShell
Import-Module : The specified module 'ACMEPowerShell' was not loaded because no valid module file was found in any
module directory.
At line:1 char:1
+ Import-Module ACMEPowerShell
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ResourceUnavailable: (ACMEPowerShell:String) [Import-Module], FileNotFoundException
    + FullyQualifiedErrorId : Modules_ModuleNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand

PS C:\Vault> dir


    Directory: C:\Vault


Mode                LastWriteTime     Length Name
----                -------------     ------ ----
-a---          3/9/2017   4:02 PM        145 ACMEPowerShell-IIS.psd1


PS C:\Vault> .\ACMEPowerShell-IIS.psd1
PS C:\Vault> Import-Module .\ACMEPowerShell-IIS.psd1
Import-Module : The module to process 'ACMEPowerShell-IIS', listed in field 'ModuleToProcess/RootModule' of module
manifest 'C:\Vault\ACMEPowerShell-IIS.psd1' was not processed because no valid module was found in any module
directory.
At line:1 char:1
+ Import-Module .\ACMEPowerShell-IIS.psd1
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ResourceUnavailable: (ACMEPowerShell-IIS:String) [Import-Module], PSInvalidOperationExce
   ption
    + FullyQualifiedErrorId : Modules_ModuleFileNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand

PS C:\Vault> Save-Module -Name ACMESharp -Path C:\ACME
Save-Module : Cannot find the path 'C:\ACME' because it does not exist.
At line:1 char:1
+ Save-Module -Name ACMESharp -Path C:\ACME
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [Save-Module], InvalidOperationException
    + FullyQualifiedErrorId : PathNotFound,Save-Module

PS C:\Vault> Save-Module -Name ACMESharp -Path C:\ACME
PS C:\Vault> Install-Module -Name ACMESharp
PS C:\Vault> Import-Module ACMEPowerShell
Import-Module : The specified module 'ACMEPowerShell' was not loaded because no valid module file was found in any
module directory.
At line:1 char:1
+ Import-Module ACMEPowerShell
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ResourceUnavailable: (ACMEPowerShell:String) [Import-Module], FileNotFoundException
    + FullyQualifiedErrorId : Modules_ModuleNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand

PS C:\Vault> Import-Module ACMESharp
PS C:\Vault> Initialize-ACMEVault -BaseURI https://acme-staging.api.letsencrypt.org/
Initialize-ACMEVault : Vault root path contains existing vault data
At line:1 char:1
+ Initialize-ACMEVault -BaseURI https://acme-staging.api.letsencrypt.org/
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Initialize-ACMEVault], Exception
    + FullyQualifiedErrorId : System.Exception,ACMESharp.POSH.InitializeVault

PS C:\Vault> New-ACMERegistration -Contacts mailto:nutthaphon@gmail.com -AcceptTos


Contacts          : {mailto:nutthaphon@gmail.com}
PublicKey         : { e = AQAB, kty = RSA, n = p0GDxWwNksxnglsbCJxwE6HtfYVTefb1dvsq7YovYlZtadoTqM4sWOzyIxUdBiHm5cqHGjE8
                    BcFbgHm9i1d5RCjRVGGoHQNM_D5LhtPjemXKtMEubbgjVDMinJONoK_COKcTs4L5MqbK20TKzdkGFNND69k29KbZWReXEeA8yVM
                    4H_aGI-FDkLO6ZxSWiuxkPchAgr1Sqj08pJR9X7qhJ2LX35Xgcuj0LkiuAkwnJuELZAhQgagK7_V9iibOBnJ9zwZlQaQ2aJoWlw
                    wJ51xP6enGSMDPZwpx5k4TJGcR46k3-NoFXfbAjv_MqzU6A9EwOmLBO5bhFkPwQ_25eaASPQ }
RecoveryKey       :
RegistrationUri   : https://acme-v01.api.letsencrypt.org/acme/reg/10593295
Links             : {<https://acme-v01.api.letsencrypt.org/acme/new-authz>;rel="next",
                    <https://letsencrypt.org/documents/LE-SA-v1.1.1-August-1-2016.pdf>;rel="terms-of-service"}
TosLinkUri        : https://letsencrypt.org/documents/LE-SA-v1.1.1-August-1-2016.pdf
TosAgreementUri   : https://letsencrypt.org/documents/LE-SA-v1.1.1-August-1-2016.pdf
AuthorizationsUri :
CertificatesUri   :



PS C:\Vault> hostname
mserver1
PS C:\Vault> Import-Module ACMEPowerShell
Import-Module : The specified module 'ACMEPowerShell' was not loaded because no valid module file was found in any
module directory.
At line:1 char:1
+ Import-Module ACMEPowerShell
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ResourceUnavailable: (ACMEPowerShell:String) [Import-Module], FileNotFoundException
    + FullyQualifiedErrorId : Modules_ModuleNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand

PS C:\Vault> Import-Module ACMEPowerShell-IIS
Import-Module : The specified module 'ACMEPowerShell-IIS' was not loaded because no valid module file was found in any
module directory.
At line:1 char:1
+ Import-Module ACMEPowerShell-IIS
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ResourceUnavailable: (ACMEPowerShell-IIS:String) [Import-Module], FileNotFoundException
    + FullyQualifiedErrorId : Modules_ModuleNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand

PS C:\Vault> Install-WindowsFeature "Web-Scripting-Tools" -IncludeAllSubFeature -IncludeManagementTools

Success Restart Needed Exit Code      Feature Result
------- -------------- ---------      --------------
True    No             Success        {IIS Management Scripts and Tools}
WARNING: Windows automatic updating is not enabled. To ensure that your newly-installed role or feature is
automatically updated, turn on Windows Update.


PS C:\Vault> Initialize-ACMEVault -BaseURI https://acme-staging.api.letsencrypt.org/
Initialize-ACMEVault : Vault root path contains existing vault data
At line:1 char:1
+ Initialize-ACMEVault -BaseURI https://acme-staging.api.letsencrypt.org/
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Initialize-ACMEVault], Exception
    + FullyQualifiedErrorId : System.Exception,ACMESharp.POSH.InitializeVault

PS C:\Vault> Initialize-ACMEVault
Initialize-ACMEVault : Vault root path contains existing vault data
At line:1 char:1
+ Initialize-ACMEVault
+ ~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Initialize-ACMEVault], Exception
    + FullyQualifiedErrorId : System.Exception,ACMESharp.POSH.InitializeVault

PS C:\Vault> Initialize-ACMEVault
Initialize-ACMEVault : Vault root path contains existing vault data
At line:1 char:1
+ Initialize-ACMEVault
+ ~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Initialize-ACMEVault], Exception
    + FullyQualifiedErrorId : System.Exception,ACMESharp.POSH.InitializeVault

PS C:\Vault> New-ACMERegistration -Contacts mailto:nutthaphon@gmail.com -AcceptTos


Contacts          : {mailto:nutthaphon@gmail.com}
PublicKey         : { e = AQAB, kty = RSA, n = v9IP2ZkBxDiMmfLkI7qLbloslZDmEMa7JsOKr76ckbaDlXAo5hkt1ddPwJjcU2k-LS6EZyNG
                    ewBwcNbq2F5ILrlYi0PA4h-icWivyjyJeJ-Fi2p2DqlfPVMfMdUVZ-ZZgxMMSj0uoUZvrjWUl16kPVUAoFe-aY9mvXXP3SndFQY
                    j6t4R0Al5AVTFuZw2aYV5rGvTTQRG_cTOrw3UBiMvrSZ_16td1zZCkzuH21E4mNDMS2-cufn34Jc9RCGjItuack81PsaHbUJUbz
                    wXv6KioDj--0xz39s6aX_DWqc9lfDeEaQh-_ZEU7zEZyqF9GarUg9eNHoV2ByOAPh92SfGBQ }
RecoveryKey       :
RegistrationUri   : https://acme-v01.api.letsencrypt.org/acme/reg/10801071
Links             : {<https://acme-v01.api.letsencrypt.org/acme/new-authz>;rel="next",
                    <https://letsencrypt.org/documents/LE-SA-v1.1.1-August-1-2016.pdf>;rel="terms-of-service"}
TosLinkUri        : https://letsencrypt.org/documents/LE-SA-v1.1.1-August-1-2016.pdf
TosAgreementUri   : https://letsencrypt.org/documents/LE-SA-v1.1.1-August-1-2016.pdf
AuthorizationsUri :
CertificatesUri   :



PS C:\Vault> New-ACMEIdentifier -Dns mserver1.dataascii.com -Alias dns1
New-ACMEIdentifier : An item with the same key has already been added.
At line:1 char:1
+ New-ACMEIdentifier -Dns mserver1.dataascii.com -Alias dns1
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [New-ACMEIdentifier], ArgumentException
    + FullyQualifiedErrorId : System.ArgumentException,ACMESharp.POSH.NewIdentifier

PS C:\Vault> New-ACMEIdentifier -Dns mserver1.dataascii.com -Alias mserver1


IdentifierPart : ACMESharp.Messages.IdentifierPart
IdentifierType : dns
Identifier     : mserver1.dataascii.com
Uri            : https://acme-v01.api.letsencrypt.org/acme/authz/pfSORbGt_uujkL5hlZvxFGcO4R5mo_x2tmn9qKcJCA8
Status         : pending
Expires        : 3/20/2017 2:43:13 PM
Challenges     : {, , }
Combinations   : {1, 0, 2}



PS C:\Vault> Complete-ACMEChallenge mserver1 -ChallengeType http-01 -Handler iis -HandlerParameters @{ WebSiteRef = 'Def
ault Web Site' }


IdentifierPart : ACMESharp.Messages.IdentifierPart
IdentifierType : dns
Identifier     : mserver1.dataascii.com
Uri            : https://acme-v01.api.letsencrypt.org/acme/authz/pfSORbGt_uujkL5hlZvxFGcO4R5mo_x2tmn9qKcJCA8
Status         : pending
Expires        : 3/20/2017 2:43:13 PM
Challenges     : {, , iis}
Combinations   : {1, 0, 2}



PS C:\Vault> Submit-ACMEChallenge mserver1 -ChallengeType http-01


IdentifierPart : ACMESharp.Messages.IdentifierPart
IdentifierType : dns
Identifier     : mserver1.dataascii.com
Uri            : https://acme-v01.api.letsencrypt.org/acme/authz/pfSORbGt_uujkL5hlZvxFGcO4R5mo_x2tmn9qKcJCA8
Status         : pending
Expires        : 3/20/2017 2:43:13 PM
Challenges     : {, , iis}
Combinations   : {1, 0, 2}



PS C:\Vault> (Update-ACMEIdentifier mserver1 -ChallengeType http-01).Challenges | Where-Object {$_.Type -eq "http-01"}


ChallengePart          : ACMESharp.Messages.ChallengePart
Challenge              : ACMESharp.ACME.HttpChallenge
Type                   : http-01
Uri                    : https://acme-v01.api.letsencrypt.org/acme/challenge/pfSORbGt_uujkL5hlZvxFGcO4R5mo_x2tmn9qKcJCA
                         8/792581011
Token                  : EQGsWNjNm0Jkcc9-dqetE7cchCzvaY5J6I9_B7DC7Fw
Status                 : invalid
OldChallengeAnswer     : [, ]
ChallengeAnswerMessage :
HandlerName            : iis
HandlerHandleDate      : 3/13/2017 9:44:12 PM
HandlerCleanUpDate     :
SubmitDate             : 3/13/2017 9:45:42 PM
SubmitResponse         : {StatusCode, Headers, Links, RawContent...}



PS C:\Vault> New-ACMEIdentifier -Dns mserver1.dataascii.com -Alias mserver1
New-ACMEIdentifier : An item with the same key has already been added.
At line:1 char:1
+ New-ACMEIdentifier -Dns mserver1.dataascii.com -Alias mserver1
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [New-ACMEIdentifier], ArgumentException
    + FullyQualifiedErrorId : System.ArgumentException,ACMESharp.POSH.NewIdentifier

PS C:\Vault> New-ACMEIdentifier -Dns mserver1.dataascii.com -Alias mserver1
PS C:\Vault> New-ACMEIdentifier -Dns mserver1.dataascii.com -Alias mserver2


IdentifierPart : ACMESharp.Messages.IdentifierPart
IdentifierType : dns
Identifier     : mserver1.dataascii.com
Uri            : https://acme-v01.api.letsencrypt.org/acme/authz/XMBoNhTkW5363As5EcTT4D3ONE0DkRwwWBSVN-4mfZs
Status         : pending
Expires        : 3/20/2017 2:49:00 PM
Challenges     : {, , }
Combinations   : {1, 0, 2}



PS C:\Vault> Complete-ACMEChallenge dns1 -ChallengeType http-01 -Handler manual


IdentifierPart : ACMESharp.Messages.IdentifierPart
IdentifierType : dns
Identifier     : nutthaphon.thddns.net
Uri            : https://acme-v01.api.letsencrypt.org/acme/authz/issiGydOyE8wNHOAa2pCwYCGNGhbt7RiBwTfttrQLdk
Status         : pending
Expires        : 1/31/2017 8:12:51 AM
Challenges     : {, manual, }
Combinations   : {2, 0, 1}



PS C:\Vault> Submit-ACMEChallenge mserver2 -ChallengeType http-01
Submit-ACMEChallenge : challenge has not been decoded
At line:1 char:1
+ Submit-ACMEChallenge mserver2 -ChallengeType http-01
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Submit-ACMEChallenge], InvalidOperationException
    + FullyQualifiedErrorId : System.InvalidOperationException,ACMESharp.POSH.SubmitChallenge

PS C:\Vault> New-ACMEIdentifier -Dns mserver1.dataascii.com -Alias mserver3


IdentifierPart : ACMESharp.Messages.IdentifierPart
IdentifierType : dns
Identifier     : mserver1.dataascii.com
Uri            : https://acme-v01.api.letsencrypt.org/acme/authz/KoKUWptBR61KJWILZObPmZLxsK_nDhhQvKQRYrqMg5w
Status         : pending
Expires        : 3/20/2017 2:51:16 PM
Challenges     : {, , }
Combinations   : {2, 0, 1}



PS C:\Vault> Complete-ACMEChallenge mserver3 -ChallengeType dns-01 -Handler manual
== Manual Challenge Handler - DNS ==
  * Handle Time:      [3/13/2017 9:51:49 PM]
  * Challenge Token:  [PTtQQCNHSfxePANrnalb4uMqayYFQx3RUftr19iHkT4]
To complete this Challenge please create a new Resource
Record (RR) with the following characteristics:
  * RR Type:  [TXT]
  * RR Name:  [_acme-challenge.mserver1.dataascii.com]
  * RR Value: [3x12NeWyGjqZMLOZBMkOv1a39PvhyKbO1O8twroe8qA]
------------------------------------


IdentifierPart : ACMESharp.Messages.IdentifierPart
IdentifierType : dns
Identifier     : mserver1.dataascii.com
Uri            : https://acme-v01.api.letsencrypt.org/acme/authz/KoKUWptBR61KJWILZObPmZLxsK_nDhhQvKQRYrqMg5w
Status         : pending
Expires        : 3/20/2017 2:51:16 PM
Challenges     : {, , manual}
Combinations   : {2, 0, 1}



PS C:\Vault> Submit-ACMEChallenge mserver3 -ChallengeType dns-01


IdentifierPart : ACMESharp.Messages.IdentifierPart
IdentifierType : dns
Identifier     : mserver1.dataascii.com
Uri            : https://acme-v01.api.letsencrypt.org/acme/authz/KoKUWptBR61KJWILZObPmZLxsK_nDhhQvKQRYrqMg5w
Status         : pending
Expires        : 3/20/2017 2:51:16 PM
Challenges     : {, , manual}
Combinations   : {2, 0, 1}



PS C:\Vault> (Update-ACMEIdentifier mserver3 -ChallengeType dns-01).Challenges | Where-Object {$_.Type -eq "dns-01"}


ChallengePart          : ACMESharp.Messages.ChallengePart
Challenge              : ACMESharp.ACME.DnsChallenge
Type                   : dns-01
Uri                    : https://acme-v01.api.letsencrypt.org/acme/challenge/KoKUWptBR61KJWILZObPmZLxsK_nDhhQvKQRYrqMg5
                         w/792616897
Token                  : PTtQQCNHSfxePANrnalb4uMqayYFQx3RUftr19iHkT4
Status                 : valid
OldChallengeAnswer     : [, ]
ChallengeAnswerMessage :
HandlerName            : manual
HandlerHandleDate      : 3/13/2017 9:51:49 PM
HandlerCleanUpDate     :
SubmitDate             : 3/13/2017 9:56:02 PM
SubmitResponse         : {StatusCode, Headers, Links, RawContent...}



PS C:\Vault> Update-ACMEIdentifier mserver3


IdentifierPart : ACMESharp.Messages.IdentifierPart
IdentifierType : dns
Identifier     : mserver1.dataascii.com
Uri            : https://acme-v01.api.letsencrypt.org/acme/authz/KoKUWptBR61KJWILZObPmZLxsK_nDhhQvKQRYrqMg5w
Status         : valid
Expires        : 5/12/2017 2:56:05 PM
Challenges     : {, , }
Combinations   : {2, 0, 1}



PS C:\Vault> New-ACMECertificate mserver3 -Generate -Alias cert3


Id                       : 89f6cf64-62b0-4295-ac77-b0213e11e598
Alias                    : cert3
Label                    :
Memo                     :
IdentifierRef            : 2180716e-74fc-4086-9849-0dfd43654b46
IdentifierDns            : mserver1.dataascii.com
AlternativeIdentifierDns :
KeyPemFile               :
CsrPemFile               :
GenerateDetailsFile      : 89f6cf64-62b0-4295-ac77-b0213e11e598-gen.json
CertificateRequest       :
CrtPemFile               :
CrtDerFile               :
IssuerSerialNumber       :
SerialNumber             :
Thumbprint               :
Signature                :
SignatureAlgorithm       :



PS C:\Vault> Submit-ACMECertificate cert3


Id                       : 89f6cf64-62b0-4295-ac77-b0213e11e598
Alias                    : cert3
Label                    :
Memo                     :
IdentifierRef            : 2180716e-74fc-4086-9849-0dfd43654b46
IdentifierDns            : mserver1.dataascii.com
AlternativeIdentifierDns :
KeyPemFile               : 89f6cf64-62b0-4295-ac77-b0213e11e598-key.pem
CsrPemFile               : 89f6cf64-62b0-4295-ac77-b0213e11e598-csr.pem
GenerateDetailsFile      : 89f6cf64-62b0-4295-ac77-b0213e11e598-gen.json
CertificateRequest       : ACMESharp.CertificateRequest
CrtPemFile               : 89f6cf64-62b0-4295-ac77-b0213e11e598-crt.pem
CrtDerFile               : 89f6cf64-62b0-4295-ac77-b0213e11e598-crt.der
IssuerSerialNumber       :
SerialNumber             : 03822465656D5211595DE8205941A599B322
Thumbprint               : 5A1F028B8EFB83EB79B2246885753B0A0ED34670
Signature                : 5A1F028B8EFB83EB79B2246885753B0A0ED34670
SignatureAlgorithm       : sha256RSA



PS C:\Vault> Get-ACMECertificate cert3 -ExportKeyPEM "c:\Vault\cert3.key.pem"


Id                       : 89f6cf64-62b0-4295-ac77-b0213e11e598
Alias                    : cert3
Label                    :
Memo                     :
IdentifierRef            : 2180716e-74fc-4086-9849-0dfd43654b46
IdentifierDns            : mserver1.dataascii.com
AlternativeIdentifierDns :
KeyPemFile               : 89f6cf64-62b0-4295-ac77-b0213e11e598-key.pem
CsrPemFile               : 89f6cf64-62b0-4295-ac77-b0213e11e598-csr.pem
GenerateDetailsFile      : 89f6cf64-62b0-4295-ac77-b0213e11e598-gen.json
CertificateRequest       : ACMESharp.CertificateRequest
CrtPemFile               : 89f6cf64-62b0-4295-ac77-b0213e11e598-crt.pem
CrtDerFile               : 89f6cf64-62b0-4295-ac77-b0213e11e598-crt.der
IssuerSerialNumber       :
SerialNumber             : 03822465656D5211595DE8205941A599B322
Thumbprint               : 5A1F028B8EFB83EB79B2246885753B0A0ED34670
Signature                : 5A1F028B8EFB83EB79B2246885753B0A0ED34670
SignatureAlgorithm       : sha256RSA



PS C:\Vault> Get-ACMECertificate cert3 -ExportCsrPEM "c:\Vault\cert3.csr.pem"


Id                       : 89f6cf64-62b0-4295-ac77-b0213e11e598
Alias                    : cert3
Label                    :
Memo                     :
IdentifierRef            : 2180716e-74fc-4086-9849-0dfd43654b46
IdentifierDns            : mserver1.dataascii.com
AlternativeIdentifierDns :
KeyPemFile               : 89f6cf64-62b0-4295-ac77-b0213e11e598-key.pem
CsrPemFile               : 89f6cf64-62b0-4295-ac77-b0213e11e598-csr.pem
GenerateDetailsFile      : 89f6cf64-62b0-4295-ac77-b0213e11e598-gen.json
CertificateRequest       : ACMESharp.CertificateRequest
CrtPemFile               : 89f6cf64-62b0-4295-ac77-b0213e11e598-crt.pem
CrtDerFile               : 89f6cf64-62b0-4295-ac77-b0213e11e598-crt.der
IssuerSerialNumber       :
SerialNumber             : 03822465656D5211595DE8205941A599B322
Thumbprint               : 5A1F028B8EFB83EB79B2246885753B0A0ED34670
Signature                : 5A1F028B8EFB83EB79B2246885753B0A0ED34670
SignatureAlgorithm       : sha256RSA



PS C:\Vault> Get-ACMECertificate cert3 -ExportCertificatePEM "c:\Vault\cert3.crt.pem" -ExportCertificateDER "c:\Vault\ce
rt3.crt"


Id                       : 89f6cf64-62b0-4295-ac77-b0213e11e598
Alias                    : cert3
Label                    :
Memo                     :
IdentifierRef            : 2180716e-74fc-4086-9849-0dfd43654b46
IdentifierDns            : mserver1.dataascii.com
AlternativeIdentifierDns :
KeyPemFile               : 89f6cf64-62b0-4295-ac77-b0213e11e598-key.pem
CsrPemFile               : 89f6cf64-62b0-4295-ac77-b0213e11e598-csr.pem
GenerateDetailsFile      : 89f6cf64-62b0-4295-ac77-b0213e11e598-gen.json
CertificateRequest       : ACMESharp.CertificateRequest
CrtPemFile               : 89f6cf64-62b0-4295-ac77-b0213e11e598-crt.pem
CrtDerFile               : 89f6cf64-62b0-4295-ac77-b0213e11e598-crt.der
IssuerSerialNumber       :
SerialNumber             : 03822465656D5211595DE8205941A599B322
Thumbprint               : 5A1F028B8EFB83EB79B2246885753B0A0ED34670
Signature                : 5A1F028B8EFB83EB79B2246885753B0A0ED34670
SignatureAlgorithm       : sha256RSA



PS C:\Vault> Get-ACMECertificate cert3 -ExportIssuerPEM "c:\Vault\cert3-issuer.crt.pem" -ExportIssuerDER "c:\Vault\cert3
-issuer.crt"
Get-ACMECertificate : Issuer certificate hasn't been resolved
At line:1 char:1
+ Get-ACMECertificate cert3 -ExportIssuerPEM "c:\Vault\cert3-issuer.crt.pem" -Expo ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Get-ACMECertificate], InvalidOperationException
    + FullyQualifiedErrorId : System.InvalidOperationException,ACMESharp.POSH.GetCertificate

PS C:\Vault> Update-ACMECertificate cert3


Id                       : 89f6cf64-62b0-4295-ac77-b0213e11e598
Alias                    : cert3
Label                    :
Memo                     :
IdentifierRef            : 2180716e-74fc-4086-9849-0dfd43654b46
IdentifierDns            : mserver1.dataascii.com
AlternativeIdentifierDns :
KeyPemFile               : 89f6cf64-62b0-4295-ac77-b0213e11e598-key.pem
CsrPemFile               : 89f6cf64-62b0-4295-ac77-b0213e11e598-csr.pem
GenerateDetailsFile      : 89f6cf64-62b0-4295-ac77-b0213e11e598-gen.json
CertificateRequest       : ACMESharp.CertificateRequest
CrtPemFile               : 89f6cf64-62b0-4295-ac77-b0213e11e598-crt.pem
CrtDerFile               : 89f6cf64-62b0-4295-ac77-b0213e11e598-crt.der
IssuerSerialNumber       : 0A0141420000015385736A0B85ECA708
SerialNumber             : 03822465656D5211595DE8205941A599B322
Thumbprint               : 5A1F028B8EFB83EB79B2246885753B0A0ED34670
Signature                : 5A1F028B8EFB83EB79B2246885753B0A0ED34670
SignatureAlgorithm       : sha256RSA



PS C:\Vault> Get-ACMECertificate cert3 -ExportIssuerPEM "c:\Vault\cert3-issuer.crt.pem" -ExportIssuerDER "c:\Vault\cert3
-issuer.crt"


Id                       : 89f6cf64-62b0-4295-ac77-b0213e11e598
Alias                    : cert3
Label                    :
Memo                     :
IdentifierRef            : 2180716e-74fc-4086-9849-0dfd43654b46
IdentifierDns            : mserver1.dataascii.com
AlternativeIdentifierDns :
KeyPemFile               : 89f6cf64-62b0-4295-ac77-b0213e11e598-key.pem
CsrPemFile               : 89f6cf64-62b0-4295-ac77-b0213e11e598-csr.pem
GenerateDetailsFile      : 89f6cf64-62b0-4295-ac77-b0213e11e598-gen.json
CertificateRequest       : ACMESharp.CertificateRequest
CrtPemFile               : 89f6cf64-62b0-4295-ac77-b0213e11e598-crt.pem
CrtDerFile               : 89f6cf64-62b0-4295-ac77-b0213e11e598-crt.der
IssuerSerialNumber       : 0A0141420000015385736A0B85ECA708
SerialNumber             : 03822465656D5211595DE8205941A599B322
Thumbprint               : 5A1F028B8EFB83EB79B2246885753B0A0ED34670
Signature                : 5A1F028B8EFB83EB79B2246885753B0A0ED34670
SignatureAlgorithm       : sha256RSA



PS C:\Vault> Get-ACMECertificate cert3 -ExportPkcs12 "c:\Vault\cert3.pfx"


Id                       : 89f6cf64-62b0-4295-ac77-b0213e11e598
Alias                    : cert3
Label                    :
Memo                     :
IdentifierRef            : 2180716e-74fc-4086-9849-0dfd43654b46
IdentifierDns            : mserver1.dataascii.com
AlternativeIdentifierDns :
KeyPemFile               : 89f6cf64-62b0-4295-ac77-b0213e11e598-key.pem
CsrPemFile               : 89f6cf64-62b0-4295-ac77-b0213e11e598-csr.pem
GenerateDetailsFile      : 89f6cf64-62b0-4295-ac77-b0213e11e598-gen.json
CertificateRequest       : ACMESharp.CertificateRequest
CrtPemFile               : 89f6cf64-62b0-4295-ac77-b0213e11e598-crt.pem
CrtDerFile               : 89f6cf64-62b0-4295-ac77-b0213e11e598-crt.der
IssuerSerialNumber       : 0A0141420000015385736A0B85ECA708
SerialNumber             : 03822465656D5211595DE8205941A599B322
Thumbprint               : 5A1F028B8EFB83EB79B2246885753B0A0ED34670
Signature                : 5A1F028B8EFB83EB79B2246885753B0A0ED34670
SignatureAlgorithm       : sha256RSA



PS C:\Vault> Get-ACMECertificate cert3 -ExportPkcs12 "c:\Vault\cert3-hard.pfx" -CertificatePassword 'password'


Id                       : 89f6cf64-62b0-4295-ac77-b0213e11e598
Alias                    : cert3
Label                    :
Memo                     :
IdentifierRef            : 2180716e-74fc-4086-9849-0dfd43654b46
IdentifierDns            : mserver1.dataascii.com
AlternativeIdentifierDns :
KeyPemFile               : 89f6cf64-62b0-4295-ac77-b0213e11e598-key.pem
CsrPemFile               : 89f6cf64-62b0-4295-ac77-b0213e11e598-csr.pem
GenerateDetailsFile      : 89f6cf64-62b0-4295-ac77-b0213e11e598-gen.json
CertificateRequest       : ACMESharp.CertificateRequest
CrtPemFile               : 89f6cf64-62b0-4295-ac77-b0213e11e598-crt.pem
CrtDerFile               : 89f6cf64-62b0-4295-ac77-b0213e11e598-crt.der
IssuerSerialNumber       : 0A0141420000015385736A0B85ECA708
SerialNumber             : 03822465656D5211595DE8205941A599B322
Thumbprint               : 5A1F028B8EFB83EB79B2246885753B0A0ED34670
Signature                : 5A1F028B8EFB83EB79B2246885753B0A0ED34670
SignatureAlgorithm       : sha256RSA



PS C:\Vault>