-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathAdd-D365FOUsers.ps1
More file actions
17 lines (14 loc) · 798 Bytes
/
Add-D365FOUsers.ps1
File metadata and controls
17 lines (14 loc) · 798 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# https://github.com/valerymoskalenko/D365FFO-PowerShell-scripts/blob/master/Add-D365FOUsers.ps1
$AccountList = @("john.doe@ciellos.com", "Maria.Ivanova@ciellos.com", "test@ciellos.com") #Add more emails to the list
$DefaultDataAreaId = 'USMF' #Update default company if it necessary
foreach($account in $AccountList)
{
Write-Host "Working on account email is" $account -ForegroundColor Yellow
$UserId = $account.Split("@")[0]
$UserName = $UserId.Replace("."," ")
$UserName = (Get-Culture).TextInfo.ToTitleCase($UserName)
Write-Host " Id =" $UserId -ForegroundColor Yellow
Write-Host " Name=" $UserName -ForegroundColor Yellow
Import-D365ExternalUser -Id $UserId -Name $UserName -Email $account -Company $DefaultDataAreaId
#Remove-D365User -Email $account
}