Skip to content

Instantly share code, notes, and snippets.

@FH-Inway
Created June 22, 2024 16:29
Show Gist options
  • Save FH-Inway/baf5932f9dc8deba94faf24de7d7de75 to your computer and use it in GitHub Desktop.
Save FH-Inway/baf5932f9dc8deba94faf24de7d7de75 to your computer and use it in GitHub Desktop.
Example output from first draft of Import-D365EntraIdUser
PS K:\Repositories\GitHub\d365fo.tools> import-D365EntraIdUser -Users $user -TenantId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -ClientId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -CertificateName "CHEAuth"
[18:20:21][Connect-MicrosoftGraph] Connecting to Microsoft Graph
VERBOSE: [18:20:21][Import-UserList] Getting tenant from user@example.com.
VERBOSE: [18:20:21][Import-UserList] Getting domain from user@example.com.
VERBOSE: [18:20:21][Get-InstanceIdentityProvider] The found instance identity provider is: https://sts.windows.net/example.com/
VERBOSE: [18:20:21][Get-CanonicalIdentityProvider] Loading dll files to do some work against the CanonicalIdentityProvider.
VERBOSE: [18:20:21][Get-CanonicalIdentityProvider] Executing the CanonicalIdentityProvider lookup logic.
VERBOSE: [18:20:21][Get-CanonicalIdentityProvider] CanonicalIdentityProvider is: https://sts.windows.net/
VERBOSE: [18:20:21][Import-UserList] InstanceProvider : https://sts.windows.net/example.com/
VERBOSE: [18:20:21][Import-UserList] Tenant : example.com
VERBOSE: [18:20:21][Import-UserList] Getting sid from user@example.com and identity provider : https://sts.windows.net/.
VERBOSE: [18:20:21][Get-UserSIDFromAad] Generated SID: S-1-xx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx
VERBOSE: [18:20:21][Import-UserList] Generated SID : S-1-xx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx
VERBOSE: [18:20:21][Import-UserList] Id for user user@example.com : User
VERBOSE: [18:20:21][Import-UserList] Importing user@example.com - SID
S-1-xx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx - Provider https://sts.windows.net/
VERBOSE: [18:20:21][Import-AadUserIntoD365FO] Testing the Email user@example.com
VERBOSE: [18:20:21][Test-AadUserInD365FO] Number of user rows found in database 0
VERBOSE: [18:20:21][Import-AadUserIntoD365FO] Testing the userid User
VERBOSE: [18:20:21][Test-AadUserIdInD365FO] Number of user rows found in database 0
VERBOSE: [18:20:21][New-D365FOUser] Adding User :
user@example.com,User,User,S-1-xx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx,DAT,https://sts.windows
.net/,https://sts.windows.net/
VERBOSE: [18:20:21][New-D365FOUser] Creating the user in database
VERBOSE: [18:20:21][New-D365FOUser] Rows inserted 1 for user user@example.com
VERBOSE: [18:20:21][Add-AadUserSecurity] Setting security roles in D365FO database
VERBOSE: [18:20:21][Add-AadUserSecurity] Difference between new user and admin security roles 0
[18:20:21][Import-AadUserIntoD365FO] User user@example.com Imported
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment