Navision:在容器环境中使用 "New-NAVServerUser" Powershell 命令

Navision: Use "New-NAVServerUser" Powershell command in Container-Enviroment

我想在容器中使用 New-NAVServerUser 命令(参见:https://docs.microsoft.com/en-us/powershell/module/microsoft.dynamics.nav.management/new-navserveruser?view=businesscentral-ps-16)来创建新的导航用户。容器已由 PowerShell 以这种方式构建:

# Path to licence
$licenceFile = 'C:\pathToLicence\Licence.flf'

# Containername and NavImage
$containername = "NewContainer" # Name des Containers
$imagename = "mcr.microsoft.com/businesscentral/onprem:14.7.37609.0-de"

New-NavContainer -accept_eula -licenseFile $licenceFile -containerName $containername -imageName $imagename -doNotExportObjectsToText -includeCSide -TimeZoneId (Get-TimeZone).Id -shortcuts "Desktop" -alwaysPull -updateHosts -useBestContainerOS -accept_outdated

完成后,我尝试使用以下脚本创建新的 NavUser:

[String]$ContiName = "NewContainer";

# Go into the Container to execute the script in it.
Invoke-ScriptInBCContainer -containerName $ContiName -scriptblock {
    #Import Module to create Navuser
    Import-Module "${env:ProgramFiles}\Microsoft Dynamics NAV0\Service\NavAdminTool.ps1"
    New-NavServerUser -WindowsAccount 'NEWCONTAINER\USER' -ServerInstance 'MicrosoftDynamicsNavServer$NAV'
}

如您所想,Windows 容器所在计算机上的帐户 运行 的用户名是“用户”。所以这不会起作用并且会发生此错误:

这是因为 NEWCONTAINER/User 已经存在。现在我想在容器中创建一个新的 Windows 用户来使用 New-NAVServerUser 命令。有谁知道它是如何工作的? 因此,总体目标是在“用户 9800”页面的 Table“用户 2000000120”中获得一个新的 NavUser,并且该用户应基于 Windows 帐户。 谢谢解答!

我正在寻找的 Powershell 命令是“New-NavContainerWindowsUser”或在容器之外:“New-LocalUser”。