กิจกรรม
9 เม.ย. 15 - 10 เม.ย. 12
JDConf 2025 เขียนโค้ดอนาคตด้วย AI และเชื่อมต่อกับ Java peers และผู้เชี่ยวชาญที่ JDConf 2025
ลงทะเบียนทันทีเบราว์เซอร์นี้ไม่ได้รับการสนับสนุนอีกต่อไป
อัปเกรดเป็น Microsoft Edge เพื่อใช้ประโยชน์จากคุณลักษณะล่าสุด เช่น การอัปเดตความปลอดภัยและการสนับสนุนด้านเทคนิค
The following documentation provides configuration and tutorial information. It demonstrates how the generic PowerShell connector and the Extensible Connectivity (ECMA) Connector host are used to integrate Microsoft Entra ID with external systems that offer Windows PowerShell-based APIs.
For additional information, see Windows PowerShell Connector technical reference
The following sections detail the prerequisites for this tutorial.
Download the PowerShell setup files from our GitHub repository. The setup files consist of the configuration file, the input file, schema file and the scripts used.
The connector provides a bridge between the capabilities of the ECMA Connector Host and Windows PowerShell. Before you use the Connector, make sure you have the following on the server hosting the connector
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned
If you've downloaded the provisioning agent and configured it for another on-premises application, then continue reading in the next section.
Select Download on-premises agent, review the terms of service, then select Accept terms & download.
หมายเหตุ
Please use different provisioning agents for on-premises application provisioning and Microsoft Entra Connect cloud sync / HR-driven provisioning. All three scenarios should not be managed on the same agent.
Open the provisioning agent installer, agree to the terms of service, and select Install.
When the Microsoft Entra provisioning agent configuration wizard opens, continue to the Select Extension tab and select On-premises application provisioning when prompted for the extension you want to enable.
The provisioning agent uses the operating system's web browser to display a popup window for you to authenticate to Microsoft Entra ID, and potentially also your organization's identity provider. If you're using Internet Explorer as the browser on Windows Server, then you may need to add Microsoft web sites to your browser's trusted site list to allow JavaScript to run correctly.
Provide credentials for a Microsoft Entra administrator when you're prompted to authorize. The user is required to have at least the Hybrid Identity Administrator role.
Select Confirm to confirm the setting. Once installation is successful, you can select Exit, and also close the Provisioning Agent Package installer.
Before you can create the PowerShell connector for this tutorial, you need to copy the InputFile.txt and Schema.xml file into the correct locations. These files are the ones you needed to download in section Download the PowerShell setup files.
File | location |
---|---|
InputFile.txt | C:\Program Files\Microsoft ECMA2Host\Service\ECMA\MAData |
Schema.xml | C:\Program Files\Microsoft ECMA2Host\Service\ECMA |
Launch the Microsoft ECMA2Host Configuration Wizard from the start menu.
At the top, select Import and select the configuration.xml file from step 1.
The new connector should be created and appear in red. Select Edit.
Generate a secret token used for authenticating Microsoft Entra ID to the connector. It should be 12 characters minimum and unique for each application. If you don't already have a secret generator, you can use a PowerShell command such as the following to generate an example random string.
-join (((48..90) + (96..122)) * 16 | Get-Random -Count 16 | % {[char]$_})
On the Properties page, all of the information should be populated. The table is provided as reference. Select Next.
Property | Value |
---|---|
Name | The name you chose for the connector, which should be unique across all connectors in your environment. For example, PowerShell . |
Autosync timer (minutes) | 120 |
Secret Token | Enter your secret token here. It should be 12 characters minimum. |
Extension DLL | For the PowerShell connector, select Microsoft.IAM.Connector.PowerShell.dll. |
The connectivity tab allows you to supply configuration parameters for connecting to a remote system. Configure the connectivity tab with the information provided in the table.
Parameter | Value | Purpose |
---|---|---|
Server | <Blank> | Server name that the connector should connect to. |
Domain | <Blank> | Domain of the credential to store for use when the connector is run. |
User | <Blank> | Username of the credential to store for use when the connector is run. |
Password | <Blank> | Password of the credential to store for use when the connector is run. |
Impersonate Connector Account | Unchecked | When true, the synchronization service runs the Windows PowerShell scripts in the context of the credentials supplied. When possible, it's recommended that the $Credentials parameter is passed to each script is used instead of impersonation. |
Load User Profile When Impersonating | Unchecked | Instructs Windows to load the user profile of the connector’s credentials during impersonation. If the impersonated user has a roaming profile, the connector doesn't load the roaming profile. |
Logon Type When Impersonating | None | Logon type during impersonation. For more information, see the dwLogonType documentation. |
Signed Scripts Only | Unchecked | If true, the Windows PowerShell connector validates that each script has a valid digital signature. If false, ensure that the Synchronization Service server’s Windows PowerShell execution policy is RemoteSigned or Unrestricted. |
Common Module Script Name (with extension) | xADSyncPSConnectorModule.psm1 | The connector allows you to store a shared Windows PowerShell module in the configuration. When the connector runs a script, it extracts the Windows PowerShell module to the file system so that each script can import it. |
Common Module Script | AD Sync PowerShell Connector Module code as value. This module will be automatically created by the ECMA2Host when the connector is running. | |
Validation Script | <Blank> | The Validation Script is an optional Windows PowerShell script that can be used to ensure that connector configuration parameters supplied by the administrator are valid. |
Schema Script | GetSchema code as value. | |
Additional Config Parameter Names | FileName,Delimiter,Encoding | In addition to the standard configuration settings, you can define additional custom configuration settings that are specific to the instance of the Connector. These parameters can be specified at the connector, partition, or run step levels and accessed from the relevant Windows PowerShell script. |
Additional Encrypted Config Parameter Names | <Blank> |
The capabilities tab defines the behavior and functionality of the connector. The selections made on this tab can't be modified when the connector is created. Configure the capabilities tab with the information provided in the table.
Parameter | Value | Purpose |
---|---|---|
Distinguished Name Style | None | Indicates if the connector supports distinguished names and if so, what style. |
Export Type | ObjectReplace | Determines the type of objects that are presented to the Export script. |
Data Normalization | None | Instructs the Synchronization Service to normalize anchor attributes before they are provided to scripts. |
Object Confirmation | Normal | This is ignored. |
Use DN as Anchor | Unchecked | If the Distinguished Name Style is set to LDAP, the anchor attribute for the connector space is also the distinguished name. |
Concurrent Operations of Several Connectors | Checked | When checked, multiple Windows PowerShell connectors can run simultaneously. |
Partitions | Unchecked | When checked, the connector supports multiple partitions and partition discovery. |
Hierarchy | Unchecked | When checked, the connector supports an LDAP style hierarchical structure. |
Enable Import | Checked | When checked, the connector imports data via import scripts. |
Enable Delta Import | Unchecked | When checked, the connector can request deltas from the import scripts. |
Enable Export | Checked | When checked, the connector exports data via export scripts. |
Enable Full Export | Checked | Not supported. This will be ignored. |
No Reference Values In First Export Pass | Unchecked | When checked, reference attributes are exported in a second export pass. |
Enable Object Rename | Unchecked | When checked, distinguished names can be modified. |
Delete-Add As Replace | Checked | Not supported. This will be ignored. |
Enable Export Password in First Pass | Unchecked | Not supported. This will be ignored. |
The Global Parameters tab enables you to configure the Windows PowerShell scripts the connector runs. You can also configure global values for custom configuration settings defined on the Connectivity tab. Configure the global parameters tab with the information provided in the table.
Parameter | Value |
---|---|
Partition Script | <Blank> |
Hierarchy Script | <Blank> |
Begin Import Script | <Blank> |
Import Script | Paste the import script as the value |
End Import Script | <Blank> |
Begin Export Script | <Blank> |
Export Script | Paste the import script as the value |
End Export Script | <Blank> |
Begin Password Script | <Blank> |
Password Extension Script | <Blank> |
End Password Script | <Blank> |
FileName_Global | InputFile.txt |
Delimiter_Global | ; |
Encoding_Global | <Blank> (defaults to UTF8) |
Keep the defaults and select next.
Configure the object types tab with the information provided in the table.
Parameter | Value |
---|---|
Target Object | Person |
Anchor | AzureObjectID |
Query Attribute | AzureObjectID |
DN | AzureObjectID |
Ensure that the following attributes are selected:
On the Select Attributes page, all of the information should be populated. The table is provided as reference. Select Next.
AzureObjectID
IsActive
DisplayName
EmployeeId
Title
UserName
On the Deprovisioning page, you can specify if you wish to have Microsoft Entra ID remove users from the directory when they go out of scope of the application. If so, under Disable flow, select Delete, and under Delete flow, select Delete. If Set attribute value is chosen, the attributes selected on the previous page won't be available to select on the Deprovisioning page.
Follow these steps to confirm the connector host is started and has identified any existing users from the target system.
C:\Program Files\Microsoft ECMA2Host
.Troubleshooting
.TestECMA2HostConnection.ps1
in the directory as shown, and provide as arguments the connector name and the ObjectTypePath
value cache
. If your connector host is not listening on TCP port 8585, then you may also need to provide the -Port
argument as well. When prompted, type the secret token configured for that connector.
PS C:\Program Files\Microsoft ECMA2Host\Troubleshooting> $cout = .\TestECMA2HostConnection.ps1 -ConnectorName PowerShell -ObjectTypePath cache; $cout.length -gt 9
Supply values for the following parameters:
SecretToken: ************
False
, then the connector hasn't seen any entries in the source target system for existing users. If this is a new target system installation, then this behavior is to be expected, and you can continue at the next section.False
, then this status indicates the connector couldn't read from the target system. If you attempt to provision, then Microsoft Entra ID may not correctly match users in that source directory with users in Microsoft Entra ID. Wait several minutes for the connector host to finish reading objects from the existing target system, and then rerun the script. If the output continues to be False
, then check the configuration of your connector and the permissions in the target system are allowing the connector to read existing users.Return to the web browser window where you were configuring the application provisioning in the portal.
หมายเหตุ
If the window had timed out, then you need to re-select the agent.
Under the Admin credentials section, enter the following URL. Replace the connectorName
portion with the name of the connector on the ECMA host, such as PowerShell
. If you provided a certificate from your certificate authority for the ECMA host, then replace localhost
with the host name of the server where the ECMA host is installed.
Property | Value |
---|---|
Tenant URL | https://localhost:8585/ecma2host_connectorName/scim |
Enter the Secret Token value that you defined when you created the connector.
หมายเหตุ
If you just assigned the agent to the application, please wait 10 minutes for the registration to complete. The connectivity test won't work until the registration completes. Forcing the agent registration to complete by restarting the provisioning agent on your server can speed up the registration process. Go to your server, search for services in the Windows search bar, identify the Microsoft Entra Connect Provisioning Agent service, right-select the service, and restart.
Select Test Connection, and wait one minute.
After the connection test is successful and indicates that the supplied credentials are authorized to enable provisioning, select Save.
Return to the web browser window where you were configuring the application provisioning.
หมายเหตุ
If the window had timed out, then you need to re-select the agent.
Sign in to the Microsoft Entra admin center as at least an Application Administrator.
Browse to Identity > Applications > Enterprise applications.
Select the On-premises ECMA app application.
Select Provisioning.
If Get started appears, then change the mode to Automatic, on the On-Premises Connectivity section, select the agent that you deployed and select Assign Agent(s). Otherwise go to Edit Provisioning.
Under the Admin credentials section, enter the following URL. Replace the {connectorName}
portion with the name of the connector on the ECMA connector host, such as CSV. The connector name is case sensitive and should be the same case as was configured in the wizard. You can also replace localhost
with your machine hostname.
Property | Value |
---|---|
Tenant URL | https://localhost:8585/ecma2host_CSV/scim |
Enter the Secret Token value that you defined when you created the connector.
หมายเหตุ
If you just assigned the agent to the application, please wait 10 minutes for the registration to complete. The connectivity test won't work until the registration completes. Forcing the agent registration to complete by restarting the provisioning agent on your server can speed up the registration process. Go to your server, search for services in the Windows search bar, identify the Microsoft Entra Connect Provisioning Agent Service, right-select the service, and restart.
Select Test Connection, and wait one minute.
After the connection test is successful and indicates that the supplied credentials are authorized to enable provisioning, select Save.
Now you need to map attributes between the representation of the user in Microsoft Entra ID and the representation of a user in the on-premises InputFile.txt.
You'll use the Azure portal to configure the mapping between the Microsoft Entra user's attributes and the attributes that you previously selected in the ECMA Host configuration wizard.
Sign in to the Microsoft Entra admin center as at least an Application Administrator.
Browse to Identity > Applications > Enterprise applications.
Select the On-premises ECMA app application.
Select Provisioning.
Select Edit provisioning, and wait 10 seconds.
Expand Mappings and select Provision Microsoft Entra users. If this is the first time you've configured the attribute mappings for this application, there will be only one mapping present, for a placeholder.
To confirm that the schema is available in Microsoft Entra ID, select the Show advanced options checkbox and select Edit attribute list for ScimOnPremises. Ensure that all the attributes selected in the configuration wizard are listed. If not, then wait several minutes for the schema to refresh, and then reload the page. Once you see the attributes listed, then cancel from this page to return to the mappings list.
Now, on the select on the userPrincipalName PLACEHOLDER mapping. This mapping is added by default when you first configure on-premises provisioning. Change the value to match the following:
Mapping type | Source attribute | Target attribute |
---|---|---|
Direct | userPrincipalName | urn:ietf:params:scim:schemas:extension:ECMA2Host:2.0:User:UserName |
Now select Add New Mapping, and repeat the next step for each mapping.
Specify the source and target attributes for each of the mappings in the following table.
Mapping type | Source attribute | Target attribute |
---|---|---|
Direct | objectId | urn:ietf:params:scim:schemas:extension:ECMA2Host:2.0:User:AzureObjectID |
Direct | userPrincipalName | urn:ietf:params:scim:schemas:extension:ECMA2Host:2.0:User:UserName |
Direct | displayName | urn:ietf:params:scim:schemas:extension:ECMA2Host:2.0:User:DisplayName |
Direct | employeeId | urn:ietf:params:scim:schemas:extension:ECMA2Host:2.0:User:EmployeeId |
Direct | jobTitle | urn:ietf:params:scim:schemas:extension:ECMA2Host:2.0:User:Title |
Direct | urn:ietf:params:scim:schemas:extension:ECMA2Host:2.0:User:Email | |
Expression | Switch([IsSoftDeleted],, "False", "True", "True", "False") | urn:ietf:params:scim:schemas:extension:ECMA2Host:2.0:User:IsActive |
Once all of the mappings have been added, select Save.
Now that you have the Microsoft Entra ECMA Connector Host talking with Microsoft Entra ID, and the attribute mapping configured, you can move on to configuring who's in scope for provisioning.
ข้อสำคัญ
If you were signed in using a Hybrid Identity Administrator role, you need to sign-out and sign-in with an account that's at least the Application Administrator role for this section. The Hybrid Identity Administrator role doesn't have permissions to assign users to applications.
If there are existing users in the InputFile.txt, then you should create application role assignments for those existing users. To learn more about how to create application role assignments in bulk, see governing an application's existing users in Microsoft Entra ID.
Otherwise, if there are no current users of the application, then select a test user from Microsoft Entra who will be provisioned to the application.
Now that your attributes are mapped and users are assigned, you can test on-demand provisioning with one of your users.
กิจกรรม
9 เม.ย. 15 - 10 เม.ย. 12
JDConf 2025 เขียนโค้ดอนาคตด้วย AI และเชื่อมต่อกับ Java peers และผู้เชี่ยวชาญที่ JDConf 2025
ลงทะเบียนทันทีการฝึกอบรม
เส้นทางการเรียนรู้
Solution Architect: Design Microsoft Power Platform solutions - Training
Learn how a solution architect designs solutions.
ใบรับรอง
รับรองโดย Microsoft: การเชื่อมโยงผู้ดูแลระบบข้อมูลประจําตัวและการเข้าถึง - Certifications
แสดงให้เห็นถึงคุณลักษณะของ Microsoft Entra ID เพื่อปรับโซลูชันข้อมูลประจําตัวให้ทันสมัย ใช้โซลูชันแบบไฮบริด และใช้การกํากับดูแลข้อมูลประจําตัว