A few of you really went out of your way to offer some insight and I appreciate that. Ultimately, my "proof of concept" code is quite simple. It needs some extra validation and I'll build in an email summary as well but it looks like this:
Dim entityDimPk As DimPk = BRApi.Finance.Dim.GetDimPk(si,"AllEntities")
Dim childId As Integer = BRApi.Finance.Members.GetMemberId(si,dimTypeId.Entity,"Loc432")
Dim hierId As Integer = BRApi.Finance.Members.GetMemberId(si,dimTypeId.Entity,"ManagerHierarchy")
Dim parentRelationships As List(Of Relationship) = BRApi.Finance.Members.ReadParentRelationshipsNoCache(si,dimTypeId.Entity,childId)
Dim correctParentId As Integer = BRApi.Finance.Members.GetMemberId(si,dimTypeId.Entity,"Bob")
For Each objRelationship In parentRelationships
If BRApi.Finance.Members.IsDescendant(si,entityDimPk,hierId,objRelationship.RelationshipPk.ParentId) AndAlso Not objRelationship.RelationshipPk.ParentId.Equals(correctParentId)
Dim objRelOptions As New RelationshipPositionOptions 'this feels superfluous but the following line fails if I pass Nothing here
BRApi.Finance.MemberAdmin.CopyOrMoveRelationships(si,entityDimPk,New List(Of RelationshipPK) From {objRelationship.RelationshipPk},correctParentId,False,objRelOptions)
End If
Next
Return Nothing
I'll turn the sample values into variables and use For loops on the datatable I query from our metadata source but this is all the heavy lifting.
Edit: Essentially, if Loc432 exists in the Manager hierarchy under any parent but the one specified in source, move it. As it's written at the moment, it assumes the hierarchy is already correct otherwise and only the position of this member is outdated. It doesn't address any oddities like a duplicate members, any of the members not existing in the dimension at all, being unable to find the ID for the correct parent, general failures at any point, or really anything else at all. However, when things are right and expected, it works. It should be useful as a starting point.