<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style id="signatureStyle" type="text/css"><!--#x92c60f4e1057438 #x1f5def6457d14b1382ebca278d1ea825, #x92c60f4e1057438
{font-family: Tahoma; font-size: 12pt;}
--></style><style id="css_styles" type="text/css"><!--blockquote.cite { margin-left: 5px; margin-right: 0px; padding-left: 10px; padding-right:0px; border-left: 1px solid #cccccc }
blockquote.cite2 {margin-left: 5px; margin-right: 0px; padding-left: 10px; padding-right:0px; border-left: 1px solid #cccccc; margin-top: 3px; padding-top: 0px; }
a img { border: 0px; }
li[style='text-align: center;'], li[style='text-align: center; '], li[style='text-align: right;'], li[style='text-align: right; '] { list-style-position: inside;}
body { font-family: 'Segoe UI'; font-size: 12pt; }
.quote { margin-left: 1em; margin-right: 1em; border-left: 5px #ebebeb solid; padding-left: 0.3em; }
a.em-mention[href] { text-decoration: none; color: inherit; border-radius: 3px; padding-left: 2px; padding-right: 2px; background-color: #e2e2e2; }
._em_placeholder {color: gray; border-bottom: 1px dotted lightblue;} ._em_placeholder:before{color:gray; content: '{{ ';} ._em_placeholder:after{color:gray; content: ' }}';}
--></style>
</head>
<body>
<div>Hi Gary,</div>
<div><span>use this code as inspiration:</span></div>
<div><br>
</div>
<div> <attribute> </div>
<div> <ref>ri:manager</ref> </div>
<div> <displayName>Manager</displayName> </div>
<div> <tolerant>false</tolerant> </div>
<div> <outbound> </div>
<div> <authoritative>true</authoritative> </div>
<div> <strength>strong</strength> </div>
<div> <source> </div>
<div> <path>$focus/activation/effectiveStatus</path> </div>
<div> </source> </div>
<div> <expression> </div>
<div> <script> </div>
<div> <code><![CDATA[ </div>
<div> import com.evolveum.midpoint.xml.ns._public.common.common_3.UserType;
</div>
<div> import com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowKindType;
</div>
<div> import com.evolveum.midpoint.prism.query.ObjectQuery;
</div>
<div> import com.evolveum.midpoint.prism.path.ItemName;
</div>
<div> import com.evolveum.midpoint.schema.constants.SchemaConstants;
</div>
<div><br>
</div>
<div> def nrManager = basic.getExtensionPropertyValue(focus, 'perNrManager');
</div>
<div> if (!nrManager) return null; </div>
<div><br>
</div>
<div> ObjectQuery query = prismContext.queryFor(UserType.class)
</div>
<div> .item(new ItemName(SchemaConstants.NS_C, 'personalNumber')).eq((nrManager ?: '999999999'))
</div>
<div> .build(); </div>
<div><br>
</div>
<div> def manager = midpoint.repositoryService.searchObjects(UserType.class, query, null, midpoint.getCurrentResult())?.find()?.asObjectable();
</div>
<div> if (!manager) return null; </div>
<div><br>
</div>
<div> def managerAD = midpoint.getLinkedShadow(manager, "11111102-8d07-4dca-b2fe-c18889afa104", ShadowKindType.ACCOUNT, "user", true);
</div>
<div> if (managerAD) return managerAD?.name; </div>
<div> ]]></code> </div>
<div> </script> </div>
<div> </expression> </div>
<div> <condition> </div>
<div> <script> </div>
<div> <code><![CDATA[ </div>
<div> import com.evolveum.midpoint.xml.ns._public.common.common_3.ActivationStatusType;
</div>
<div><br>
</div>
<div> return effectiveStatus?.equals(ActivationStatusType.ENABLED);
</div>
<div> ]]></code> </div>
<div> </script> </div>
<div> </condition> </div>
<div> </outbound> </div>
<div> </attribute> </div>
<div><br>
</div>
<div><br>
</div>
<div>Regards</div>
<div id="signature_old" style="clear:both">
<div id="x92c60f4e1057438">
<div style="">
<div id="x1f5def6457d14b1382ebca278d1ea825"><br>
</div>
<div>
<div data-mce-style="font-family: Arial, sans-serif; font-size: 13px;" style="font-variant-ligatures: normal; orphans: 2; widows: 2; font-family: Arial, sans-serif; font-size: 13px;">
<p><strong>Roman Pudil</strong> <br>
<span data-mce-style="font-family: Arial, sans-serif; font-size: 11px; color: #808080;" style="font-size: 11px; color: rgb(128, 128, 128);">solution architect</span>
</p>
</div>
<p data-mce-style="font-family: Arial, sans-serif; font-size: 11px;" style="font-variant-ligatures: normal; orphans: 2; widows: 2; font-family: Arial, sans-serif; font-size: 11px;">
gsm: [+420] 775 663 666<br>
e‑mail: <a href="mailto:roman.pudil@ami.cz">roman.pudil@ami.cz</a> </p>
<p data-mce-style="font-family: Arial, sans-serif; font-size: 11px;" style="font-variant-ligatures: normal; font-size: 11px; font-family: Arial, sans-serif; widows: 2; orphans: 2;">
<strong>AMI Praha a.s.</strong> <br>
Pernerova 697/35, 186 00 Praha 8</p>
<p data-mce-style="font-family: Arial, sans-serif; font-size: 11px;" style="font-variant-ligatures: normal; font-size: 11px; font-family: Arial, sans-serif; widows: 2; orphans: 2;">
recepce: [+420] 604 444 848 | web: <a href="https://www.ami.cz/" data-mce-href="https://www.ami.cz" style="">www.ami.cz</a>
</p>
<p data-mce-style="margin-top: 20px;" style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; font-variant-ligatures: normal; orphans: 2; widows: 2; margin-top: 20px;">
<img src="https://www.ami.cz/images/podpis/ami-logo.png" alt="AMI Praha a.s." data-mce-src="https://www.ami.cz/images/podpis/ami-logo.png" style="border: 0px; cursor: default;">
</p>
<p data-mce-style="font-family: Arial, sans-serif; font-size: 11px; color: #aaaaaa;" style="font-variant-ligatures: normal; orphans: 2; widows: 2; font-family: Arial, sans-serif; font-size: 11px; color: rgb(170, 170, 170);">
Textem tohoto e‑mailu podepisující neslibuje uzavřít ani neuzavírá za společnost AMI Praha a.s.<br>
jakoukoliv smlouvu. Každá smlouva, pokud bude uzavřena, musí mít výhradně písemnou formu.<br>
<span data-mce-style="font-size: 6px;" style="font-size: 6px;"> </span> <br>
Tento e‑mail je určen výhradně pro potřeby jeho adresáta/ů a může obsahovat důvěrné nebo osobní<br>
informace. Nejste‑li zamýšleným příjemcem, je zakázáno jakékoliv zveřejňování, zprostředkování<br>
nebo jiné použití těchto informací. Pokud jste obdrželi e‑mail neoprávněně, informujte o tom prosím<br>
odesílatele a vymažte neprodleně všechny kopie tohoto e‑mailu včetně všech jeho příloh. Nakládáním<br>
s neoprávněně získanými informacemi se vystavujete riziku právního postihu.</p>
</div>
</div>
</div>
</div>
<div><br>
</div>
<div x-em-replyforwardheader=""><br>
</div>
<div>
<div>------ Původní zpráva ------</div>
<div>Od "Maxwell, Gary via midPoint" <<a href="mailto:midpoint@lists.evolveum.com">midpoint@lists.evolveum.com</a>></div>
<div>Komu "'midpoint@lists.evolveum.com'" <<a href="mailto:midpoint@lists.evolveum.com">midpoint@lists.evolveum.com</a>></div>
<div>Kopie "Maxwell, Gary" <<a href="mailto:Maxwell_G@fortlewis.edu">Maxwell_G@fortlewis.edu</a>></div>
<div>Datum 16.09.2025 18:26:08</div>
<div>Předmět [midPoint] How to obtain the dn using a managers username</div>
</div>
<div x-em-quote=""><br>
</div>
<div id="x23a034278b204e5" class="plain">
<blockquote cite="DM6PR03MB452383701AFA12086C2725F39514A@DM6PR03MB4523.namprd03.prod.outlook.com" type="cite" class="cite2">
<div class="plain_line">Is it possible to search for the dn of a employees' manager in an Active Directory resource in Midpoint 4.4?</div>
<div class="plain_line"> </div>
<div class="plain_line">As we provision an employee to active directory, we would like use the employees' manager username to find the manager dn to set the manager attribute for that employee. Is there any way to do this in Midpoint 4.4.</div>
<div class="plain_line">Any Ideas?</div>
<div class="plain_line"> </div>
<div class="plain_line">-Gary</div>
<div class="plain_line">_______________________________________________</div>
<div class="plain_line">midPoint mailing list</div>
<div class="plain_line"><a href="mailto:midPoint@lists.evolveum.com">midPoint@lists.evolveum.com</a></div>
<div class="plain_line"><a href="https://lists.evolveum.com/mailman/listinfo/midpoint">https://eur04.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.evolveum.com%2Fmailman%2Flistinfo%2Fmidpoint&data=05%7C02%7Croman.pudil%40ami.cz%7C1536750a28df42e3281608ddf53dc6aa%7C61ffc580ac524580a5885ba8429a3177%7C0%7C0%7C638936367871437987%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=jbPY8Ynf99H4CzTrVnFrXEfhU%2FBgO7cUt7U84o%2B93FE%3D&reserved=0</a></div>
</blockquote>
</div>
</body>
</html>