Public/Set-P1Adapter.ps1
function Set-P1Adapter { <# .Synopsis Configuration of the Microsoft Dynamics NAV Adapter. .Description Configure the Microsoft Dynamics NAV Adapter for PlannerOne. .Parameter Tenant The tenant name. .Parameter ERP The ERP name (NAV, SAGE...) .Parameter Server The tenant Microsoft Dynamics NAV host server name. .Parameter SOAPPort The NAV Web service SOAP port. .Parameter AuthenticationMode The NAV authentication mode (Negotiate, NTLM, Digest, Basic). .Parameter SSL Does the NAV server use SSL. .Parameter ClientPort The port for Microst Dynamics NAV RTC client. .Parameter InstanceName The NAV server instance name. .Parameter ServiceDomain The PlannerOne technical account domain. .Parameter ServiceLogin The PlannerOne technical account login. .Parameter ServicePassword The PlannerOne technical account password. .Example # Configure a NAV adapter Set-P1NavConfiguration -Tenant nodb -ServiceDomain ORTEMS -ServiceLogin PlannerOne -ServicePassword Planner1 -Server locahost -InstanceName DynamicsNAV90 -SOAPPort 9047 #> [cmdletbinding()] param( [Parameter(Mandatory=$true)] [string] $Tenant, [string] $ERP, [string] $Server, [int] $SOAPPort, [string] $AuthenticationMode, [bool] $SSL, [int] $ClientPort, [Parameter(Mandatory=$true)] [string] $InstanceName, [string] $ServiceDomain, [Parameter(Mandatory=$true)] [string] $ServiceLogin, [Parameter(Mandatory=$true)] [string] $ServicePassword ) Process { if ($ERP -eq "NAV") { Write-Section "Configuring NAV Adapter..." Set-NAVParameters $Tenant $Server $SOAPPort $AuthenticationMode $SSL $ClientPort $InstanceName $ServiceDomain $ServiceLogin $ServicePassword $serviceName = Get-ServiceNameFromTenant $Tenant Write-Output "Restarting PlannerOne service $serviceName..." Restart-Service -Name $serviceName Write-OK "Configuration done" } else { Write-Warning "ERP $ERP not recognized" } } } |