UserHandling/Get-NavContainerNavUser.ps1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<#
 .Synopsis
  Get list of users from container
 .Description
  Retrieve the list of user objects from a tenant in a container
 .Parameter containerName
  Name of the container from which you want to get the users (default navserver)
 .Parameter tenant
  Name of tenant from which you want to get the users
 .Example
  Get-NavContainerNavUser
 .Example
  Get-NavContainerNavUser -containerName test -tenant mytenant
#>

function Get-NavContainerNavUser {
Param
    (
        [Parameter(Mandatory=$false)]
        [string]$containerName = "navserver",
        [Parameter(Mandatory=$false)]
        [string]$tenant = "default"
    )

    PROCESS
    {
        Invoke-ScriptInNavContainer -containerName $containerName -ScriptBlock { param($tenant)

            Get-NavServerUser -ServerInstance NAV -tenant $tenant
        } -ArgumentList $tenant
    }
}
Export-ModuleMember -Function Get-NavContainerNavUser