Named and Positional Parameters for NAV 2013 Powershell API

ReedbergReedberg Member Posts: 68
edited 2014-07-01 in NAV Three Tier
Hello experts,
I have two questions regarding NAV 2013 Powershell API.

1. Microsoft Preparing Materials for 'Installation & Configuration' states that there are two types of parameters: named and positional.
Named parameters are parameters that always have to be specified as a “Name – Value” pair. Named parameters can typivally be entered in any order.
The example: New-NAVServerInstance –ServerInstance ‘ABC’ –ManagementServicesPort 7045 – ClientServicesPort 7046 –SOAPServicesPort 7047 –OdataServicesPort -7048
Positional parameters are parameters that have a fixed position in the syntax. Positional parameters can be entered as a “Name – Value” pair, but you can omit the parameter name. Positional parameters must be entered in a fixed order.
The example: Export-NAVServerLicenseInformation –ServerInstance ‘DynamicsNAV70’
So, in first example –ServerInstance ‘ABC’ is a named parameter and in a second example –ServerInstance ‘DynamicsNAV70’ is a positional parameter. But Get-Help New-NAVServerInstance and Get-Help Export-NAVServerLicenseInformation do not specify which parameter is named and which is positional. How am I supposed to understand which type does the parameter have and whether I am allowed to change the parameters order and omit the parameter name?

2. There is a command Get-NAVServerPermissionSet. As help states:
Use the Get-NAVServerPermissionSet cmdlet to return a list of permission sets for the specified Microsoft Dynamics NAV Server instance.

The example: Get-NAVServerPermissionSet DynamicsNAV71
This example returns all permission sets in the current Microsoft Dynamics NAV database.

How am I supposed to get permission sets for the specific NAV Server Inctance, not for all permission sets in DB?
Another question: how can I assign different permission sets to different NAV Server instances?

Any advices will be appreciated!

Answers

  • matsnmatsn Member Posts: 10
    Hey,

    you should check msdn for these topics, the documentation found there is usally pretty helpful.

    1) You can look for the cmdlets here: http://msdn.microsoft.com/en-us/library/jj672916(v=nav.71).aspx
    For each parameter the position and this stuff is listed.

    2) Not sure what you mean by not all permission sets, you specify the instance in the parameter. In your example it was "DynamicsNAV71".
    For importing permission sets check New-NAVServerPermissionSet and New-NAVServerPermission

    Regards,
    Mats
  • ReedbergReedberg Member Posts: 68
    Dear matsn,
    1. Thanks for the link, it answerred my question.

    2. I will try to explain myself in more clear way. The command says:
    Use the Get-NAVServerPermissionSet cmdlet to return a list of permission sets for the specified Microsoft Dynamics NAV Server instance.

    Suppose I have two NAV Server instances: DynamicsNAV71 and DynamicsNAV72. Can it be the case that these two instances have two different permission sets? How do I set different permission sets to different NAV server instances?
  • matsnmatsn Member Posts: 10
    Yes two different Services can have different permission sets if they belong to different databases. If they belong to the same database they will have the same permission sets. Not sure if Multi Tenancy could change that though, but I would not expect it since I can't choose a tenant id when getting the permission sets.
  • ReedbergReedberg Member Posts: 68
    Dear matsn,
    Thank you for your valuable replies, you answered all my questions!
Sign In or Register to comment.