Hi,
I am in the process of creating a NAV test enviroment using PowerShell and need to run several codeunits with PowerShell.
However when I run Invoke-NAVCodeunit I get an error message saying "The server has rejected the client credentials". As far as I can see Invoke-NAVCodeunit doesn't accept any credential parameters.
The ClientServicesCredentialType on the server instance is set to NavUserPassword. If I delete all users in the database then I am able to run Invoke-NAVCodeunit without any errors however I cannot delete the users as the codeunits I am running requires users to be present.
Any ideas how to solve this?
Thanks,
Morten
0
Answers
First, you need to make sure you can login RTC use that user(with user created in NAV), if so, then I think the way you pass user id and password to NAV through powershell is not correct.
You can paste the command here, someone else can help you with that.
I can logon with RTC without any problems.
To run the codeunit from PowerShell I use the command below.
Invoke-NAVCodeunit -CompanyName "CRONUS International Ltd." -CodeunitId 50000 -ServerInstance NAV
If you do not pass anyting explicitely then I'd assume that Invoke-NAVCodeunit uses your windows credentials to log in, an in order to make it work you need to have a separate NST handling Windows authentication, as NST does not support mixed authentication types.
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03