Sync Users
Audience:
Low-code EngineersSkill Prerequisites:
Actions,User management,Portals
Shares users between portals, so the same account can log in to each of them. Each selected user is added to every other selected portal, and gets the roles with the same names there.
It only adds. It never removes a user from a portal or takes roles away.
Typical Use Cases
- Give users of one portal access to a new portal created with Create Portal
- Run as a scheduled job in Automation to keep users shared across a group of portals
- Share a single user, for example a support account, with every portal
Don't use it to
- Create users. Use User Registration instead.
- Copy profile data such as names or phone numbers. Only portal membership and roles are copied.
- Give a user a role that doesn't exist on the other portal. Create it first with Create Role.
Related Actions
| Action Name | Description |
|---|---|
| Create Portal | Creates a new portal that users can be shared with. |
| Load Portal | Loads a portal, for example to get its ID. |
| Create Role | Creates a role, so a matching role exists on each portal. |
| Grant User Role | Grants roles to a user on the current portal. |
| Clear Cache Item | Clears DNN's cache, so the changes show up straight away. |
Input Parameter Reference
The parameters unique to this action are listed below. Review the common parameters for all actions here.
| Parameter | Description | Supports Tokens | Default | Required |
|---|---|---|---|---|
| Sync Users | The users to share, as user IDs separated by commas, for example 12, 45. Use * for all users of the selected portals. Usernames and emails aren't accepted. | Yes | * | Yes |
| Sync Portals | The portals to share users between, as portal IDs separated by commas, for example 0, 3. Use * for all portals. | Yes | * | Yes |
Output Parameters Reference
This action doesn't create any tokens.
How it works
- The action finds the portals in Sync Portals. Values that aren't numbers, or don't match a portal, are ignored. If no portal is found, it fails with
No tenants could be found. Maybe check the Ids? - It finds the users in Sync Users on each of those portals. A user only counts if they already belong to one of the selected portals. If no user is found, it fails with
No users could be found. Maybe check the Ids? - For each selected portal, each user found on another selected portal is added to it, if they aren't there already. The user gets the same authorized and deleted state they have on their other portal.
- The user's roles are copied to roles with the same name on that portal, with the same start date, expiry date and status. Roles the user already has there are left alone. Roles with no matching name are skipped.
Nothing is copied back or removed, so there are no conflicts. A user who's already on a portal keeps their existing roles and state there.
Considerations
- Roles follow by name. A user in
Administratorson one portal becomes anAdministratorsmember on every selected portal. Check who you're syncing before using*. - Keep it for trusted users. The action doesn't check who's running it. Don't run it from a public form, or with IDs that come from a form field, the URL or an API request.
- All users on all portals is the default. On a large installation, that can take a long time. Limit Sync Users and Sync Portals where you can.
- Cache. The action writes to the database directly and doesn't clear DNN's cache. The new portals and roles might not show up until the cache is cleared or expires. See Clear Cache Item.
- Deleted users. A user marked as deleted on their portal is added as deleted on the other portals too.
Examples
To understand how to use the below examples, please see Running Examples.
1. Share all users between two portals
This action shares every user of portal 0 with portal 3, and every user of portal 3 with portal 0, with their matching roles.
{
"Title": "Sync Users",
"ActionType": "UserManagement_SyncUsers",
"Description": "Share users between portals 0 and 3",
"Parameters": {
"Users": "*",
"Portals": "0, 3"
}
}
2. Share one user with every portal
This action shares the user with the ID in the UserId token with all portals. It only runs when UserId has a value.
{
"Title": "Sync Users",
"ActionType": "UserManagement_SyncUsers",
"Description": "Share one user with all portals",
"Condition": "[UserId] != \"\"",
"Parameters": {
"Users": "[UserId]",
"Portals": "*"
}
}
Revised 09/28/2026