Import D365AadUser - FH-Inway/d365fo.tools GitHub Wiki
Used to import Aad users into D365FO
Import-D365AadUser [-Users] <String[]> [[-StartupCompany] <String>] [[-DatabaseServer] <String>]
[[-DatabaseName] <String>] [[-SqlUser] <String>] [[-SqlPwd] <String>] [[-IdPrefix] <String>]
[[-NameSuffix] <String>] [[-IdValue] <String>] [[-NameValue] <String>] [[-AzureAdCredential] <PSCredential>]
[-SkipAzureAd] [<CommonParameters>]
Import-D365AadUser [-AadGroupName] <String> [[-StartupCompany] <String>] [[-DatabaseServer] <String>]
[[-DatabaseName] <String>] [[-SqlUser] <String>] [[-SqlPwd] <String>] [[-IdPrefix] <String>]
[[-NameSuffix] <String>] [[-IdValue] <String>] [[-NameValue] <String>] [[-AzureAdCredential] <PSCredential>]
[-ForceExactAadGroupName] [<CommonParameters>]
Import-D365AadUser [[-StartupCompany] <String>] [[-DatabaseServer] <String>] [[-DatabaseName] <String>]
[[-SqlUser] <String>] [[-SqlPwd] <String>] [[-IdPrefix] <String>] [[-NameSuffix] <String>]
[[-IdValue] <String>] [[-NameValue] <String>] [[-AzureAdCredential] <PSCredential>] [-AadGroupId] <String>
[<CommonParameters>]
Provides a method for importing a AAD UserGroup or a comma separated list of AadUsers into D365FO.
Import-D365AadUser -Users "[email protected]","[email protected]"
Imports Claire and Allen as users
$myPassword = ConvertTo-SecureString "MyPasswordIsSecret" -AsPlainText -Force
PS C:\> $myCredentials = New-Object System.Management.Automation.PSCredential ("MyEmailIsAlso", $myPassword)
PS C:\> Import-D365AadUser -Users "[email protected]","[email protected]" -AzureAdCredential $myCredentials
This will import Claire and Allen as users.
Import-D365AadUser -AadGroupName "CustomerTeam1"
if more than one group match the AadGroupName, you can use the ExactAadGroupName parameter Import-D365AadUser -AadGroupName "CustomerTeam1" -ForceExactAadGroupName
Import-D365AadUser -AadGroupName "CustomerTeam1" -ForceExactAadGroupName
This is used to force the cmdlet to find the exact named group in Azure Active Directory.
Import-D365AadUser -AadGroupId "99999999-aaaa-bbbb-cccc-9999999999"
Imports all the users that is present in the AAD Group called CustomerTeam1
Import-D365AadUser -Users "[email protected]","[email protected]" -SkipAzureAd
Imports Claire and Allen as users. Will NOT make you connect to the Azure Active Directory(AAD). The needed details will be based on the e-mail address only, and the rest will be blanked.
Azure Active directory user group containing users to be imported
Type: String
Parameter Sets: GroupNameImport
Aliases:
Required: True
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Array of users that you want to import into the D365FO environment
Type: String[]
Parameter Sets: UserListImport
Aliases:
Required: True
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Startup company of users imported.
Default is DAT
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 3
Default value: DAT
Accept pipeline input: False
Accept wildcard characters: False
The name of the database server
If on-premises or classic SQL Server, use either short name og Fully Qualified Domain Name (FQDN)
If Azure use the full address to the database server, e.g. server.database.windows.net
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 4
Default value: $Script:DatabaseServer
Accept pipeline input: False
Accept wildcard characters: False
The name of the database
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 5
Default value: $Script:DatabaseName
Accept pipeline input: False
Accept wildcard characters: False
The login name for the SQL Server instance
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 6
Default value: $Script:DatabaseUserName
Accept pipeline input: False
Accept wildcard characters: False
The password for the SQL Server user
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 7
Default value: $Script:DatabaseUserPassword
Accept pipeline input: False
Accept wildcard characters: False
A text that will be prefixed into the ID field. E.g. -IdPrefix "EXT-" will import users and set ID starting with "EXT-..."
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 8
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
A text that will be suffixed into the NAME field. E.g. -NameSuffix "(Contoso)" will import users and append "(Contoso)"" to the NAME
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 9
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Specify which field to use as ID value when importing the users. Available options 'Login' / 'FirstName' / 'UserPrincipalName'
Default is 'Login'
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 10
Default value: Login
Accept pipeline input: False
Accept wildcard characters: False
Specify which field to use as NAME value when importing the users. Available options 'FirstName' / 'DisplayName'
Default is 'DisplayName'
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 11
Default value: DisplayName
Accept pipeline input: False
Accept wildcard characters: False
Use a PSCredential object for connecting with AzureAd
Type: PSCredential
Parameter Sets: (All)
Aliases:
Required: False
Position: 12
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Switch to instruct the cmdlet to skip validating against the Azure Active Directory
Type: SwitchParameter
Parameter Sets: UserListImport
Aliases:
Required: False
Position: 13
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
Force to find the exact name of the Azure Active Directory Group
Type: SwitchParameter
Parameter Sets: GroupNameImport
Aliases:
Required: False
Position: 14
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
Azure Active directory user group ID containing users to be imported
Type: String
Parameter Sets: GroupIdImport
Aliases:
Required: True
Position: 15
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
Tags: User, Users, Security, Configuration, Permission, AAD, Azure Active Directory, Group, Groups
Author: Rasmus Andersen (@ITRasmus) Author: Charles Colombel (@dropshind) Author: Mötz Jensen (@Splaxi) Author: Miklós Molnár (@scifimiki)
At no circumstances can this cmdlet be used to import users into a PROD environment.
Only users from an Azure Active Directory that you have access to, can be imported. Use AAD B2B implementation if you want to support external people.
Every imported users will get the System Administration / Administrator role assigned on import