[midPoint] bulk action to delete dead linkRef or script to remove owner
Hsin-Fang Hsu
hsin-fang.hsu at itconcepts.ch
Mon Feb 27 16:11:15 CET 2023
Hi,
I want to remove owner from a resource. From the GUI we can use remove owner but how to do it in the task (>10,000 users)?
[cid:image001.png at 01D94AC5.F7477B50]
Another question is:
I tried to remove some dead linkRef from users with a single bulk action task. Dead linkRef means the <linkRef> in the user xml which cannot be found in midpoint anymore.
The code below shows no error but also doesn’t remove the dead linkref.
linksToRemove = []
for (link in links) {
try {
shadow = midpoint.getObject(ShadowType.class, link.getOid(),
SelectorOptions.createCollection(GetOperationOptions.createNoFetch().resolveNames(true)));
} catch (ObjectNotFoundException e) {
linksToRemove.add(link.asReferenceValue().clone())
}
}
def delta = DeltaBuilder.deltaFor(input.class, prismContext)
.item(UserType.F_LINK_REF)
.delete(linksToRemove)
.asObjectDelta(input.oid)
midpoint.modifyObject(delta)
Thank you very much for the help in advance!
Best regards,
Hsin-Fang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20230227/5f7a2c6d/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 18619 bytes
Desc: image001.png
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20230227/5f7a2c6d/attachment-0001.png>
More information about the midPoint
mailing list