Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X
Article cs366586 refers to creating 2 mapping xml files. When I run the windchill wt.org.util.ReconnectPrincipalsUtility command below, it errors with mapping file not found. I assume that both the dnMapping and adapterMapping files need to be placed in a $WT_HOME directory before running the windchill comand. Can someone give advice on where these should be placed and if any wt.properties need to be set
Thanks in advance TJ
<dnMapping>\n
<reconnect>\n
<sourceDN>uid=$email,ou=<>,cn=<>,cn=<>,o=ptc<sourceDN>\n";
<targetDN>uid=$email,ou=users,dc=xxxxxxx=,dc=okta,dc=com</targetDN>\n";
<reconnect>\n
<dnMapping>\n
<adapterMapping>
<sourceAdapter>net.company.InternalLdap</sourceAdapter>
<targetAdapter>net.company.EnterpriseLdap</targetAdapter>
</adapterMapping>
windchill wt.org.util.ReconnectPrincipalsUtility [-u "wc_admin" ] [-p "xxxxxxxxx" ] [-f "/home/xxxx/mapping.xml"] [-d] [-h]
Solved! Go to Solution.
The fun part is mapping source to target DNs for hundreds or thousands of users.
I put the values in Excel and align old and new values. Sometimes user's name or email attributes match or follow a consistent pattern between LDAP servers. Sometimes it gets very tedious. There is a way to export Excel to structured XML. I did it once, but can't find my template file now.
In most cases I've found it quicker and easier to just update all the users with a DB query. The <dnMapping> just updates the RemoteObjectId.remoteObjectId value. Each sourceDN/targetDN pair is equivalent to this database update line.
-- Update one entry at a time.
update RemoteObjectId set remoteObjectId='uid=$email,ou=users,dc=xxxxxxx=,dc=okta,dc=com' where remoteObjectId='uid={userPrincipalName},ou=<>,cn=<>,cn=<>,o=ptc';
Or, when the DN structure changes are consistent...
-- Replace 'ou=<>,cn=<>,cn=<>,o=ptc' with 'ou=<>,cn=<>,cn=<>,o=ptc','ou=users,dc=xxxxxxx=,dc=okta,dc=com'
update RemoteObjectId set remoteObjectId=replace(remoteObjectId,'ou=<>,cn=<>,cn=<>,o=ptc','ou=users,dc=xxxxxxx=,dc=okta,dc=com') where remoteObjectId like '%,ou=<>,cn=<>,cn=<>,o=ptc';
The fun part is mapping source to target DNs for hundreds or thousands of users.
I put the values in Excel and align old and new values. Sometimes user's name or email attributes match or follow a consistent pattern between LDAP servers. Sometimes it gets very tedious. There is a way to export Excel to structured XML. I did it once, but can't find my template file now.
In most cases I've found it quicker and easier to just update all the users with a DB query. The <dnMapping> just updates the RemoteObjectId.remoteObjectId value. Each sourceDN/targetDN pair is equivalent to this database update line.
-- Update one entry at a time.
update RemoteObjectId set remoteObjectId='uid=$email,ou=users,dc=xxxxxxx=,dc=okta,dc=com' where remoteObjectId='uid={userPrincipalName},ou=<>,cn=<>,cn=<>,o=ptc';
Or, when the DN structure changes are consistent...
-- Replace 'ou=<>,cn=<>,cn=<>,o=ptc' with 'ou=<>,cn=<>,cn=<>,o=ptc','ou=users,dc=xxxxxxx=,dc=okta,dc=com'
update RemoteObjectId set remoteObjectId=replace(remoteObjectId,'ou=<>,cn=<>,cn=<>,o=ptc','ou=users,dc=xxxxxxx=,dc=okta,dc=com') where remoteObjectId like '%,ou=<>,cn=<>,cn=<>,o=ptc';
The load files could be placed anywhere as long as you provide the absolute path in the command line
Hello @TJ_10505309,
It looks like you have some responses from some community members. If any of these replies helped you solve your question please mark the appropriate reply as the Accepted Solution.
Of course, if you have more to share on your issue, please let the Community know so other community members can continue to help you.
Thanks,
Vivek N.
Community Moderation Team.
