forked from microsoft/navcontainerhelper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGet-NavContainerNavUser.ps1
38 lines (37 loc) · 1.34 KB
/
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
34
35
36
37
38
<#
.Synopsis
Get list of users from NAV/BC Container
.Description
Retrieve the list of user objects from a tenant in a NAV/BC Container
.Parameter containerName
Name of the container from which you want to get the users
.Parameter tenant
Name of tenant from which you want to get the users
.Example
Get-BcContainerBcUser
.Example
Get-BcContainerBcUser -containerName test -tenant mytenant
#>
function Get-BcContainerBcUser {
Param (
[Parameter(Mandatory=$false)]
[string] $containerName = $bcContainerHelperConfig.defaultContainerName,
[Parameter(Mandatory=$false)]
[string] $tenant = "default"
)
$telemetryScope = InitTelemetryScope -name $MyInvocation.InvocationName -parameterValues $PSBoundParameters -includeParameters @()
try {
Invoke-ScriptInBcContainer -containerName $containerName -ScriptBlock { param($tenant)
Get-NavServerUser -ServerInstance $ServerInstance -tenant $tenant
} -ArgumentList $tenant | Where-Object {$_ -isnot [System.String]}
}
catch {
TrackException -telemetryScope $telemetryScope -errorRecord $_
throw
}
finally {
TrackTrace -telemetryScope $telemetryScope
}
}
Set-Alias -Name Get-NavContainerNavUser -Value Get-BcContainerBcUser
Export-ModuleMember -Function Get-BcContainerBcUser -Alias Get-NavContainerNavUser