Q: How do I add test users to a Microsoft Dynamics 365 Business Central Docker Container?
A: You use the Setup-BcContainerTestUsers function in BCContainerHelper to load test users.
You can load either Essential or Premium users with the Setup-BcContainerTestUsers function.
When working with a Business Central Container that has the following Users:
New test users can be added with the Setup-BcContainerTestUsers function:
#set the userName, password and containerName values for your use
$userName = 'admin'
$password = 'password'
$containerName = 'your container'
$securePassword = ConvertTo-SecureString $Password -AsPlainText -Force
$credential = New-Object System.Management.Automation.PSCredential ($userName, $securePassword)
# the $SecurePassword is the password that the new test users will use when logging into Business Central
Setup-BcContainerTestUsers -containerName $containerName -select Essential -Password $securePassword -credential $Credential
Setup-BcContainerTestUsers -containerName $containerName -select Premium -Password $securePassword -credential $Credential
After setting up the test users with the Setup-BcContainerTestUsers function in BCContainerHelper:
The new TestUsers can access the system using the password used in the Password parameter.
Note: You need to specify credentials when not using Windows Authentication.
The code and information discussed in this article are for informational and demonstration purposes only. This content was created referencing Microsoft Dynamics 365 Business Central 2022 Wave 2 online and BCContainerHelper Version 4.0.8.
*This post is locked for comments