Update one or all license files without restarting the servicetier

Again this week I met consultants that didn't know that it is possible to update the license-file in a servicetier without restarting the servicetier and thereby kicking all users off.

I have blogged about that in a previous post: Tips for Wizards in Dynamics NAV and 365 Business Central, but most surprisingly, not everybody has read that post 

So, here it is again, but this time with a twist.

If I want to update the license file in my BC140 servicetier, I can use PowerShell to do that:

Notice that the warning says that all OTHER servicetiers that utilizes the database need to be restarted.

So is there a way to change the license files for all servicetiers in one go?

Well, PowerShell is a powerful tool, so, of course there is:

 The script can be downloaded here:

https://ba-consult.dk/downloads/ImportLicense.zip

And yes, it has always been like that, ever since the Import-License command came in PowerShell 

  

Anonymous
  • HI Matthias,

    Good point, but I like to take things step by step to check the result of each stem.

    Also my machine have servicetiers in 12 different versions of NAV and BC running and the Import-License is version specific.

    So, if you only have one version on your server, then you are absolutely right. But if you have more, then you need to add the Where-Object command as well.

    And yes, the $_.State -eq "Running" could be added if you have inactive servicetiers on the server.

  • Hi Peik,
    great post but why are you using such a complicated script?

    get-navserverinstance | where-object { $_.Version -Match $pattern } | import-navserverlicense -LicenseFile $license

    Best you also add a filter for $_.State -eq "Running".

Related