Problem using PowerShell Create NAVServerInstance in 2013 R2

wjhorngwjhorng Member Posts: 15
edited 2014-02-06 in NAV Three Tier
Hi,
I got problem using PowerShell to Create NAVServerInstance in 2013 R2 for ServicesCertificateThumbprint.
When I use the following PowerShell to create new NAVServerInstance
/***
New-NAVServerInstance -ServerInstance A0031 -DatabaseName A0031 -DatabaseServer NAVLAB03
-ManagementServicesPort 8245 -ClientServicesPort 8246 -ODataServicesPort 8248 -SOAPServicesPort 8247
-ServiceAccount 'User' -ServiceAccountCredential $credential
-ClientServicesCredentialType UserName
-ServicesCertificateThumbprint "9e 4d 60 0c 4d ae 76 42 cb 40 84 a3 01 99 e7 04 94 65 ee cc"
****/
The ServerInstance can not be started due to Powershell remove space in ServicesCertificateThumbprint value (replace from "9e 4d 60 0c 4d ae 76 42 cb 40 84 a3 01 99 e7 04 94 65 ee cc" to "9e4d600c4dae7642cb4084a30199e7049465eecc" )
Can anyone know how can resolve the problem?
Thanks.

Best Regard,
Jin

Comments

  • benrbenr Member Posts: 11
    You don't want any spaces in your thumbprint. You should also be sure there are no hidden Unicode characters within the thumbprint value. That can happen if you copy and paste the value from the certificate. The best way to be sure is to type in the thumbprint manually, but you can also paste it into Notepad and then save the file as ANSI to clear them out that way.

    Ben
  • wjhorngwjhorng Member Posts: 15
    Hi Ben:
    My problem is I need space in thumbprint value. The status is if I type ServicesCertificateThumbprint "9e 4d 60 0c 4d ae 76 42 cb 40 84 a3 01 99 e7 04 94 65 ee cc" manually. It works. But if I use Power Shell command. The space is removed. it does not work. Thanks.

    Best Regard,
    Jin Hung
  • beranberan Member, Microsoft Employee Posts: 80
    If you have the certificate in a file then you shold be able to do the following

    $certificate = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2
    $certificate.Import($CertificateFilePath)

    and added to your code

    New-NAVServerInstance -ServerInstance A0031 -DatabaseName A0031 -DatabaseServer NAVLAB03
    -ManagementServicesPort 8245 -ClientServicesPort 8246 -ODataServicesPort 8248 -SOAPServicesPort 8247
    -ServiceAccount 'User' -ServiceAccountCredential $credential
    -ClientServicesCredentialType UserName
    -ServicesCertificateThumbprint $certificate.Thumbprint
    Eric Beran
    Software Design Engineer II
    Dynamics NAV Office 365
    Microsoft

    This posting is provided "AS IS" with no warranties, and confers no rights.
  • TListTList Member, Microsoft Employee Posts: 7
    You can easily copy the thumbprint from powershell.
    Just run the command
    Get-ChildItem -Path Cert:\localmachine\My
    
    and copy the relevant thumbprint.
  • wjhorngwjhorng Member Posts: 15
    Hi Beran/Tlist:
    I have tried your method. There is no space in the Certificate Thumbprint value.
    Then I can not start the NAV instance.
    If I use NAV Administrator Tools to modify Certificate Thumbprint by add space.
    Then it works. (as the attachment).
    Can anyone help me? How can I do to resolve it?
    Thanks so much.


    Best Regard,
    Jin
    t1.png 66.9K
Sign In or Register to comment.