Powershell Script to create a “Self-Signed Certificate” that works on Dynamics NAV iPad App

Powershell Script to create a “Self-Signed Certificate” that works on Dynamics NAV iPad App

** https://robertostefanettinavblog.files.wordpress.com/2015/07/start.png?w=264&h=214**

PURPOSE

Automated scripts (with Powershell) to create a self-signed certificate usable for Dynamics NAV App on iPad (if you haven’t a Real Commercial Verified Certificate)

This “Powershell automation Script” is based on manual procedure existing in this post “How to get Microsoft Dynamics NAV for tablets to connect using a self-signed certificate” by NAV Team Blog and also based on some scripts by Duilio Tacconi of Microsoft Support Emea. http://blogs.msdn.com/b/nav/archive/2014/10/09/how-to-get-microsoft-dynamics-nav-for-tablets-to-connect-using-a-self-signed-certificate.aspx

**
STEP** 1: REQUIREMENTS FOR USE PRE-USE CERTIFICATE “SELF-SIGNED” – Best Practice Microsoft  suggest  to use a **valid certificate **(ex: Purchased from Verisign) – Suggested (but not mandatory) is to install at least the cumulative NAV Update 8 2015 (CU8), it needs to use better management of self-signed certificate (unofficial, not from Vendor).

**

STEP 2:** ELIMINATION OF CERTIFICATES NOT ALREADY WORKING AND IMPORTED ON IPAD

– First, if you have already created certificates for use with App and these don’t work, remove them all using the console:

https://robertostefanettinavblog.files.wordpress.com/2015/07/step2.png?w=627&h=314

**

STEP 3:** PROCEDURE FOR CREATING A NEW SELF-SIGNED CERTIFICATE – This procedure must be used after the installation of Navision Server. CREATION (BUILD) OF NEW CERTIFICATE – This procedure creates / uses a new self-signed certificate – Unzip the file with everything you need (KIT PRE-EXISTING available to Deploy NAV on AZURE), put in the default example “C:\Certificates\Initialize\Initialize\

** Initialize Standard.ZIP File**

https://robertostefanettinavblog.files.wordpress.com/2015/07/initalize.png?w=295&h=317

https://robertostefanettinavblog.files.wordpress.com/2015/07/cert2.png?w=339&h=161

This file has been modified to the case: “Self-Signed Certificate tested on iPad App” (was commented on what is not needed in our test case environment and changed the parameters)   Open the file with PowerShell ISE as administrator (Run as administrator) and check the settings and make changes if necessary.

SCRIPT:  InstallCert.ps1 , SCRIPT :Certificate.Ps1

Download Scripts Form here:  POWERSHELL FILES CERTIFICATE > Powershell Certificate

** “POWERSHELL ISE” SAMPLES SCREENS**

https://robertostefanettinavblog.files.wordpress.com/2015/07/pw1.png?w=639&h=266

https://robertostefanettinavblog.files.wordpress.com/2015/07/pw2.png?w=640&h=216

https://robertostefanettinavblog.files.wordpress.com/2015/07/pw3.png?w=649&h=266

**

STEP 4:  Running the** file “InstallCert.ps1”

– From line to line with F8 (debug) in powershell ISE so if there are errors you can understand and correct, or run the entire script with F5 if you are unsure.

**

STEP 5:** INPUT PARAMETERS Two parameters are requested:

– The first (Default Login)

https://robertostefanettinavblog.files.wordpress.com/2015/07/step51.png?w=625

-The second: (NAV Server: press enter taking one proposed)

https://robertostefanettinavblog.files.wordpress.com/2015/07/step5-2.png?w=625

The script stops and restarts the services, once finished, take the certificate and send it on iPad (example à send to email) STEP 6: INSTALLATION CERTIFICATE ON IPAD -Click on the file in the mail and follow the installation procedure on iPad. STEP 7: LAUNCH DYNAMICS NAV APP -Finished open “Dynamics NAV App” and enter the address

“To Run” Dynamics NAV Ipad App

  • Download Ipad App : Dynamics NAV from App Store
  • **Install Certificate on iPad (Double Click on .CER File) **
  • Run Ipad App and set NAV Server Link : EXAMPLE https://navserver.cloudapp.net/DynamicsNAV80/WebClient
  • Insert username e password User: NAV (DOMAIN\User) PWD:  PasswordBINGO !