Home
%3CLINGO-SUB%20id%3D%22lingo-sub-974781%22%20slang%3D%22en-US%22%3ECalculating%20the%20domain%20and%20populating%20user%20attributes%20across%20multiple%20MIM%20implementations.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-974781%22%20slang%3D%22en-US%22%3E%0A%20%26lt%3Bmeta%20http-equiv%3D%22Content-Type%22%20content%3D%22text%2Fhtml%3B%20charset%3DUTF-8%22%20%2F%26gt%3B%3CSTRONG%3E%20First%20published%20on%20MSDN%20on%20May%2009%2C%202018%20%3C%2FSTRONG%3E%20%3CBR%20%2F%3E%3CP%3E%3CB%3E%20%3CU%3E%20OVERVIEW%3A%20%3C%2FU%3E%20%3C%2FB%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EEnterprise%20environments%20often%20contain%20multiple%20independent%20MIM%20installations%20that%20serve%20as%20a%20development%2C%20staging%2C%20and%20production%20environments.%20Ideally%2C%20code%20should%20be%20written%20and%20tested%20in%20the%20Development%20environment%20and%20transferred%20to%20staging%20for%20validation%20then%20transferred%20to%20production%20with%20no%20environmental%20modifications%20being%20required.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EI%20often%20run%20across%20Synchronization%20or%20Attribute%20Flow%20Rules%20that%20contain%20the%20domain%20name%20%E2%80%9Chard%20coded%E2%80%9D%20in%20the%20content%20of%20these%20rule%E2%80%99s%20logic.%26nbsp%3B%20Below%20is%20one%20method%20for%20replacing%20these%20%E2%80%9Chard%20coded%E2%80%9D%20domain%20names%20by%20dynamically%20populating%20user%20attributes%20with%20the%20appropriate%20domain%20associated%20to%20the%20environment%20the%20workflow%20is%20executing%20within%20(re.%20development%2C%20staging%2C%20or%20production).%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EA%20single%20workflow%20can%20be%20migrated%20from%20development%20to%20staging%20to%20production%20without%20modification.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3CB%3E%20%3CU%3E%20SOFTWARE%20REQUIREMENTS%3A%20%3C%2FU%3E%20%3C%2FB%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EThis%20solution%20uses%20the%20Microsoft%20Identity%20Manager%20Portal%20and%20MIMWAL%20workflow%20components.%20To%20install%20the%20MIM%20WAL%2C%20please%20refer%20to%20the%20following%20document(s).%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3CB%3E%20%3CU%3E%20EXAMPLE%20ASSUMPTIONS%3A%20%3C%2FU%3E%20%3C%2FB%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EEach%20environment%20(Re.%20development%2C%20staging%2C%20and%20production)%20has%20a%20distinctly%20different%20domain%20name.%20In%20this%20case%20the%20domains%20are%20as%20follow%3A%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EDevelopment%20TestContoso.com%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EStaging%20StageContoso.com%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EProduction%20Contoso.com%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3CB%3E%20%3CU%3E%20USER%20ATTRIBUTES%3A%20%3C%2FU%3E%20%3C%2FB%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EOur%20example%20will%20calculate%20the%20domain%20and%20populate%20the%20following%20attributes%20of%20the%20user%3A%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EDomain%20(ex.%20mydomain.com)%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EuserPrincipalName%20(ex.%20user.name%40mydomain.com)%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EEmail%20(ex.%20user.name%40mydomain.com)%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3CB%3E%20%3CU%3E%20CREATE%20THE%20WORKFLOW%3A%20%3C%2FU%3E%20%3C%2FB%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EThe%20following%20example%20workflow%20will%20calculate%20the%20domain%2C%20regardless%20of%20the%20environment%20(re.%20Test%2C%20Staging%2C%20Production)%20and%20eliminating%20the%20need%20for%20modification%20during%20code%20promotion.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3ELaunch%20the%20MIM%20Portal%20with%20Admin%20Rights.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3ESelect%20%3CB%3E%20Workflows%3C%2FB%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3ESelect%20%3CB%3E%20New%3C%2FB%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EEnter%20the%20workflow%20name%20(ex.%20%3CB%3ESet%20Attributes%20Containing%20Domain%20Names%20%3C%2FB%3E%20)%3C%2FP%3E%3CBR%20%2F%3E%3CP%3ESelect%20%3CB%3E%20Action%20%3C%2FB%3E%20as%20the%20Workflow%20Type.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3CIMG%20alt%3D%22clip_image002%22%20border%3D%220%22%20height%3D%22364%22%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F153997i5C214D0C7840FD3F%22%20title%3D%22clip_image002%22%20width%3D%22540%22%20%2F%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3ESelect%20%3CB%3E%20Next%3C%2FB%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3CB%3E%20%3CU%3E%20CREATE%20WORKFLOW%20ACTIVITY%20%231%20%3C%2FU%3E%20%3C%2FB%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3ESelect%20%3CB%3E%20Add%20Activity%3C%2FB%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3ESelect%20%3CB%3E%20WAL%3A%20Update%20Resource%20as%20the%20Activity%3C%2FB%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3CIMG%20alt%3D%22clip_image004%22%20border%3D%220%22%20height%3D%22326%22%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F153998i9B37517DA83F1E2F%22%20title%3D%22clip_image004%22%20width%3D%22267%22%20%2F%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EPress%20the%20%3CB%3E%20Select%20%3C%2FB%3E%20button.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EIn%20the%20%3CB%3E%20Activity%20Display%20Name%20%3C%2FB%3E%20enter%20%E2%80%9C%20%3CB%3E%20Query%20Domain%20Name%20%3C%2FB%3E%20%E2%80%9D%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EPlace%20a%20checkmark%20in%20the%20%3CB%3E%20Advance%20Features%20%3C%2FB%3E%20checkbox.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EPlace%20a%20checkmark%20in%20the%20%3CB%3E%20Query%20Resources%20%3C%2FB%3E%20checkbox.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EIn%20the%20%3CB%3E%20Queries%20%3C%2FB%3E%20Section%20enter%20%3CB%3E%20Domain%20%3C%2FB%3E%20as%20the%20%3CB%3E%20Key%3C%2FB%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EIn%20the%20%3CB%3E%20Queries%20%3C%2FB%3E%20Section%20enter%20%3CB%3E%20%2F%2FDomainConfiguration%20%3C%2FB%3E%20as%20the%20XPath%20Filter%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3CIMG%20alt%3D%22clip_image006%22%20border%3D%220%22%20height%3D%22218%22%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F153999i8368D658DF3664A9%22%20title%3D%22clip_image006%22%20width%3D%22508%22%20%2F%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3ENext%2C%20assign%20the%20value%20returned%20from%20the%20Query%20to%20a%20Workflow%20Data%20Variable%20called%20%3CB%3E%20Domain%20%3C%2FB%3E%20.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EIn%20the%20Updates%20section%2C%20enter%20%3CB%3E%20%5B%2F%2FQueries%2FDomain%2FDisplayName%5D%20%3C%2FB%3E%20as%20the%20%3CB%3E%20Value%20Expression%3C%2FB%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EIn%20the%20Updates%20section%2C%20enter%20%3CB%3E%20%5B%2F%2FWorkflowData%2FDomain%5D%20%3C%2FB%3E%20as%20the%20%3CB%3E%20Target%20%3C%2FB%3E%20.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3CIMG%20alt%3D%22clip_image008%22%20border%3D%220%22%20height%3D%2284%22%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F154000i4A69597EE58986A9%22%20title%3D%22clip_image008%22%20width%3D%22511%22%20%2F%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3ESelect%20%3CB%3E%20Save%20%3C%2FB%3E%20to%20save%20the%20first%20activity%20of%20the%20Workflow.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3CB%3ENote%3A%20%3C%2FB%3E%20Attribute%20names%20variables%2C%20Key%2C%20XPathFilter%2C%20Value%20Expression%2C%20and%20Target%20values%20are%20case%20sensitive.%20%3CB%3E%20%3C%2FB%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3CB%3E%20%3CU%3E%20CREATE%20WORKFLOW%20ACTIVITY%20%232%3A%20%3C%2FU%3E%20%3C%2FB%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3ESelect%20%3CB%3E%20Add%20Activity%3C%2FB%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3ESelect%20%3CB%3E%20WAL%3A%20Update%20Resource%20as%20the%20Activity%3C%2FB%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3CIMG%20alt%3D%22clip_image004%5B1%5D%22%20border%3D%220%22%20height%3D%22405%22%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F154001i2E7970BAA5C9F6A1%22%20title%3D%22clip_image004%5B1%5D%22%20width%3D%22331%22%20%2F%3E%20%3CB%3E%20%3C%2FB%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EPress%20the%20%3CB%3E%20Select%20%3C%2FB%3E%20button.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EEnter%20the%20%3CB%3E%20Activity%20Display%20Name%20%3C%2FB%3E%20(ex.%20%3CB%3EUpdate%20User%20Attributes%20%3C%2FB%3E%20)%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3CSTRONG%3E%20Next%2C%20we%20will%20Read%20the%20WorkflowData%2FDomain%20attribute%20into%20an%20Activity%20variable.%20%3C%2FSTRONG%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EUnder%20Updates%2C%20enter%20%5B%2F%2FWorkflowData%2FDomain%5D%20as%20the%20Value%20Expression%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EUnder%20Updates%2C%20enter%20%24Domain%20as%20the%20Target%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3CIMG%20alt%3D%22clip_image010%22%20border%3D%220%22%20height%3D%22201%22%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F154002i0559EAFD88D460C0%22%20title%3D%22clip_image010%22%20width%3D%22481%22%20%2F%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3ESelect%20%3CB%3E%20Add%20%3C%2FB%3E%20to%20add%20another%20row%20to%20the%20Updates%20section.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3CIMG%20alt%3D%22clip_image012%22%20border%3D%220%22%20height%3D%22217%22%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F154003i9F090A584EEFEA4F%22%20title%3D%22clip_image012%22%20width%3D%22486%22%20%2F%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EContinue%20to%20Add%20rows%20and%20enter%20the%20following%20additional%20Value%20Expressions%20and%20Targets%3A%3C%2FP%3E%3CBR%20%2F%3E%3CTABLE%20border%3D%221%22%20cellpadding%3D%220%22%20cellspacing%3D%220%22%3E%3CBR%20%2F%3E%3CTBODY%3E%3CBR%20%2F%3E%3CTR%3E%3CBR%20%2F%3E%3CTD%20valign%3D%22top%22%20width%3D%22252%22%3E%3CBR%20%2F%3E%3CP%20align%3D%22center%22%3E%3CB%3E%20Description%20%3C%2FB%3E%3C%2FP%3E%3CBR%20%2F%3E%3C%2FTD%3E%3CBR%20%2F%3E%3CTD%20valign%3D%22top%22%20width%3D%22228%22%3E%3CBR%20%2F%3E%3CP%20align%3D%22center%22%3E%3CB%3E%20Value%20Expression%20%3C%2FB%3E%3C%2FP%3E%3CBR%20%2F%3E%3C%2FTD%3E%3CBR%20%2F%3E%3CTD%20valign%3D%22top%22%20width%3D%22144%22%3E%3CBR%20%2F%3E%3CP%20align%3D%22center%22%3E%3CB%3E%20Target%20%3C%2FB%3E%3C%2FP%3E%3CBR%20%2F%3E%3C%2FTD%3E%3CBR%20%2F%3E%3C%2FTR%3E%3CBR%20%2F%3E%3CTR%3E%3CBR%20%2F%3E%3CTD%20valign%3D%22top%22%20width%3D%22252%22%3E%3CBR%20%2F%3E%3CP%20align%3D%22center%22%3ESet%20the%20lower%20case%20of%20the%20user%20accountName%20to%20the%20Account%20variable.%3C%2FP%3E%3CBR%20%2F%3E%3C%2FTD%3E%3CBR%20%2F%3E%3CTD%20valign%3D%22top%22%20width%3D%22228%22%3E%3CBR%20%2F%3E%3CP%20align%3D%22center%22%3ELowerCase(%5B%2F%2FTarget%2FaccountName%5D)%3C%2FP%3E%3CBR%20%2F%3E%3C%2FTD%3E%3CBR%20%2F%3E%3CTD%20valign%3D%22top%22%20width%3D%22144%22%3E%3CBR%20%2F%3E%3CP%20align%3D%22center%22%3E%24Account%3C%2FP%3E%3CBR%20%2F%3E%3C%2FTD%3E%3CBR%20%2F%3E%3C%2FTR%3E%3CBR%20%2F%3E%3CTR%3E%3CBR%20%2F%3E%3CTD%20valign%3D%22top%22%20width%3D%22252%22%3E%3CBR%20%2F%3E%3CP%20align%3D%22center%22%3ESet%20the%20Domain%20name%20variable%20to%20lowercase.%3C%2FP%3E%3CBR%20%2F%3E%3C%2FTD%3E%3CBR%20%2F%3E%3CTD%20valign%3D%22top%22%20width%3D%22228%22%3E%3CBR%20%2F%3E%3CP%20align%3D%22center%22%3ELowerCase(%24Domain)%3C%2FP%3E%3CBR%20%2F%3E%3C%2FTD%3E%3CBR%20%2F%3E%3CTD%20valign%3D%22top%22%20width%3D%22144%22%3E%3CBR%20%2F%3E%3CP%20align%3D%22center%22%3E%24Domain%3C%2FP%3E%3CBR%20%2F%3E%3C%2FTD%3E%3CBR%20%2F%3E%3C%2FTR%3E%3CBR%20%2F%3E%3CTR%3E%3CBR%20%2F%3E%3CTD%20valign%3D%22top%22%20width%3D%22252%22%3E%3CBR%20%2F%3E%3CP%20align%3D%22center%22%3ESet%20the%20Email%20variable%20by%20concatenating%20values.%3C%2FP%3E%3CBR%20%2F%3E%3C%2FTD%3E%3CBR%20%2F%3E%3CTD%20valign%3D%22top%22%20width%3D%22228%22%3E%3CBR%20%2F%3E%3CP%20align%3D%22center%22%3EConcatenate(%24Account%2C%E2%80%9D%40%E2%80%9D%2C%24Domain%2C%E2%80%9D.com%E2%80%9D)%3C%2FP%3E%3CBR%20%2F%3E%3C%2FTD%3E%3CBR%20%2F%3E%3CTD%20valign%3D%22top%22%20width%3D%22144%22%3E%3CBR%20%2F%3E%3CP%20align%3D%22center%22%3E%24Email%3C%2FP%3E%3CBR%20%2F%3E%3C%2FTD%3E%3CBR%20%2F%3E%3C%2FTR%3E%3CBR%20%2F%3E%3CTR%3E%3CBR%20%2F%3E%3CTD%20valign%3D%22top%22%20width%3D%22252%22%3E%3CBR%20%2F%3E%3CP%20align%3D%22center%22%3ESet%20the%20UPN%20variable%20userPrincipalName%20by%20concatenating%20values.%3C%2FP%3E%3CBR%20%2F%3E%3C%2FTD%3E%3CBR%20%2F%3E%3CTD%20valign%3D%22top%22%20width%3D%22228%22%3E%3CBR%20%2F%3E%3CP%20align%3D%22center%22%3EConcatenate(%24Account%2C%E2%80%9D%40%E2%80%9D%2C%24Domain%2C%E2%80%9D.com%E2%80%9D)%3C%2FP%3E%3CBR%20%2F%3E%3C%2FTD%3E%3CBR%20%2F%3E%3CTD%20valign%3D%22top%22%20width%3D%22144%22%3E%3CBR%20%2F%3E%3CP%20align%3D%22center%22%3E%24UPN%3C%2FP%3E%3CBR%20%2F%3E%3C%2FTD%3E%3CBR%20%2F%3E%3C%2FTR%3E%3CBR%20%2F%3E%3CTR%3E%3CBR%20%2F%3E%3CTD%20valign%3D%22top%22%20width%3D%22252%22%3E%3CBR%20%2F%3E%3CP%20align%3D%22center%22%3ESet%20the%20Domain%20attribute%20in%20the%20user%20record%20to%20the%20value%20of%20the%20Domain%20variable.%3C%2FP%3E%3CBR%20%2F%3E%3C%2FTD%3E%3CBR%20%2F%3E%3CTD%20valign%3D%22top%22%20width%3D%22228%22%3E%3CBR%20%2F%3E%3CP%20align%3D%22center%22%3E%24Domain%3C%2FP%3E%3CBR%20%2F%3E%3C%2FTD%3E%3CBR%20%2F%3E%3CTD%20valign%3D%22top%22%20width%3D%22144%22%3E%3CBR%20%2F%3E%3CP%20align%3D%22center%22%3E%5B%2F%2FTarget%2FDomain%5D%3C%2FP%3E%3CBR%20%2F%3E%3C%2FTD%3E%3CBR%20%2F%3E%3C%2FTR%3E%3CBR%20%2F%3E%3CTR%3E%3CBR%20%2F%3E%3CTD%20valign%3D%22top%22%20width%3D%22252%22%3E%3CBR%20%2F%3E%3CP%20align%3D%22center%22%3ESet%20the%20mail%20attribute%20in%20the%20user%20record%20to%20the%20value%20of%20the%20Email%20variable.%3C%2FP%3E%3CBR%20%2F%3E%3C%2FTD%3E%3CBR%20%2F%3E%3CTD%20valign%3D%22top%22%20width%3D%22228%22%3E%3CBR%20%2F%3E%3CP%20align%3D%22center%22%3E%24Email%3C%2FP%3E%3CBR%20%2F%3E%3C%2FTD%3E%3CBR%20%2F%3E%3CTD%20valign%3D%22top%22%20width%3D%22144%22%3E%3CBR%20%2F%3E%3CP%20align%3D%22center%22%3E%5B%2F%2FTarget%2Fmail%5D%3C%2FP%3E%3CBR%20%2F%3E%3C%2FTD%3E%3CBR%20%2F%3E%3C%2FTR%3E%3CBR%20%2F%3E%3CTR%3E%3CBR%20%2F%3E%3CTD%20valign%3D%22top%22%20width%3D%22252%22%3E%3CBR%20%2F%3E%3CP%20align%3D%22center%22%3ESet%20the%20userPrincipalName%20attribute%20in%20the%20user%20record%20to%20the%20value%20of%20the%20UPN%20variable.%3C%2FP%3E%3CBR%20%2F%3E%3C%2FTD%3E%3CBR%20%2F%3E%3CTD%20valign%3D%22top%22%20width%3D%22228%22%3E%3CBR%20%2F%3E%3CP%20align%3D%22center%22%3E%24UPN%3C%2FP%3E%3CBR%20%2F%3E%3C%2FTD%3E%3CBR%20%2F%3E%3CTD%20valign%3D%22top%22%20width%3D%22144%22%3E%3CBR%20%2F%3E%3CP%20align%3D%22center%22%3E%5B%2F%2FTarget%2FuserPrincipalName%5D%3C%2FP%3E%3CBR%20%2F%3E%3C%2FTD%3E%3CBR%20%2F%3E%3C%2FTR%3E%3CBR%20%2F%3E%3C%2FTBODY%3E%3CBR%20%2F%3E%3C%2FTABLE%3E%3CBR%20%2F%3E%3CP%3E%3CB%3ENOTE%3A%20%3C%2FB%3E%20All%20MIMWAL%20Functions%2C%20including%20%3CB%3E%20LowerCase%20%3C%2FB%3E%20and%20%3CB%3E%20Concatenate%20%3C%2FB%3E%20used%20in%20tis%20example%2C%20can%20be%20referenced%20at%20the%20following%20location%3A%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FMicrosoft%2FMIMWAL%2Fwiki%2FFunctions%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3E%20https%3A%2F%2Fgithub.com%2FMicrosoft%2FMIMWAL%2Fwiki%2FFunctions%20%3C%2FA%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EOnce%20completed%2C%20the%20second%20activity%20of%20the%20workflow%20will%20appear%20as%20follows%3A%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3CIMG%20alt%3D%22image%22%20border%3D%220%22%20height%3D%22486%22%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F154004i140A6AF1C2A6E1EF%22%20title%3D%22image%22%20width%3D%22696%22%20%2F%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3ESelect%20the%20%3CB%3E%20Save%20%3C%2FB%3E%20Button%20to%20save%20the%20second%20activity.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3ESelect%20%3CB%3E%20OK%20%3C%2FB%3E%20and%20%3CB%3E%20Submit%20%3C%2FB%3E%20to%20save%20the%20Workflow.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3CB%3E%20%3CU%3E%20CREATE%20A%20SET%20%3C%2FU%3E%20%3C%2FB%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3ENext%2C%20create%20a%20set%20of%20user%20objects%20that%20do%20not%20have%20a%20value%20for%20one%20or%20all%20of%20the%20attributes%20needing%20to%20be%20populated%20(re.%20Domain%2C%20mail%2C%20or%20userPrincipalName).%3C%2FP%3E%3CBR%20%2F%3E%3CP%3ESelect%20%3CB%3E%20Sets%20%3C%2FB%3E%20%2C%20%3CB%3E%20New%3C%2FB%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EIn%20the%20Display%20Name%20enter%20a%20name%20for%20the%20set%20(Ex.%20%3CB%3E%20~Users%20requiring%20Domain%20mail%20or%20userPrincipalName%20values)%3C%2FB%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3ESelect%20%3CB%3E%20Next%3C%2FB%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3ECheck%20%3CB%3E%20Enable%20criteria-based%20membership%20in%20current%20set%20%3C%2FB%3E%20.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EChange%20%3CB%3E%20all%20resources%20%3C%2FB%3E%20to%20%3CB%3E%20user%3C%2FB%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EChange%20%3CB%3E%20all%20%3C%2FB%3E%20to%20%3CB%3E%20any%3C%2FB%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3ESelect%20%3CB%3E%20Add%20Statement%3C%2FB%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3ESelect%20%3CB%3E%20Click%20to%20Select%20Attribute%20%3C%2FB%3E%20and%20choose%20the%20%3CB%3E%20Domain%20%3C%2FB%3E%20attribute%3C%2FP%3E%3CBR%20%2F%3E%3CP%3ESelect%20%3CB%3E%20is%20%3C%2FB%3E%20then%20from%20the%20drop%20down%20menu%20select%20%3CB%3E%20not%20starts%20with%3C%2FB%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3ESelect%20%3CB%3E%20click%20to%20select%20value%20%3C%2FB%3E%20%2C%20enter%20%3CB%3E%20%25%3C%2FB%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3CB%3ENote%3A%20%3C%2FB%3E%20%25%20is%20a%20wild%20card%20value%20meaning%20having%20any%20value%2C%20excludes%20nulls.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3ERepeat%20the%20above%20steps%20for%20the%20%3CB%3E%20Mail%20%3C%2FB%3E%20and%20%3CB%3E%20User%20Principal%20Name%20%3C%2FB%3E%20attributes.%20This%20should%20result%20in%20the%20following%3A%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3CIMG%20alt%3D%22clip_image016%22%20border%3D%220%22%20height%3D%22256%22%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F154005i5568374A0BBE5876%22%20title%3D%22clip_image016%22%20width%3D%22492%22%20%2F%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3ESelect%20the%20%3CB%3E%20View%20Members%20%3C%2FB%3E%20button%20to%20test%20the%20set.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3ESelect%20%3CB%3E%20Finish%20%3C%2FB%3E%20%2C%20%3CB%3E%20Submit%20%3C%2FB%3E%20to%20save%20the%20Set.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3CB%3E%20%3CU%3E%20CREATE%20A%20MANAGEMENT%20POLICY%20RULE%3A%20%3C%2FU%3E%20%3C%2FB%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EFinally%2C%20create%20a%20Management%20Policy%20Rule%20(MPR)%20that%20applies%20the%20Workflow%20to%20the%20set%20of%20users.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3ESelect%20Management%20Policy%20Rules%2C%20New%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EIn%20the%20Display%20Name%20enter%20the%20name%20of%20the%20MPR%20(ex.%20!~Update%20Users%20Domain%20Mail%20and%20userPrincipalName%20Values)%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EIn%20the%20%3CB%3E%20Type%20%3C%2FB%3E%20section%20select%20%3CB%3E%20Set%20Transition%3C%2FB%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3CIMG%20alt%3D%22clip_image018%22%20border%3D%220%22%20height%3D%22274%22%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F154006i9681C7777815287C%22%20title%3D%22clip_image018%22%20width%3D%22490%22%20%2F%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3ESelect%20%3CB%3E%20Next%3C%2FB%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EOn%20the%20Transition%20Definition%20Tab%20in%20the%20Transition%20Set%20section%20select%20the%20stacked%20paper%20icon.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EChoose%20the%20set%20that%20was%20created%20above%20(Ex.%20%3CB%3E%20~Users%20requiring%20Domain%20mail%20or%20userPrincipalName%20values)%20%3C%2FB%3E%20by%20placing%20a%20checkmark%20in%20the%20box%20next%20to%20the%20name.%20%3CB%3E%20%3C%2FB%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3CIMG%20alt%3D%22clip_image020%22%20border%3D%220%22%20height%3D%22385%22%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F154007i970985382ACBEBBF%22%20title%3D%22clip_image020%22%20width%3D%22486%22%20%2F%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3ESelect%20%3CB%3E%20Ok%3C%2FB%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EIn%20the%20Transition%20Type%20section%20retain%20the%20default%20setting%20of%20%3CB%3E%20Transition%20In%3C%2FB%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3ESelect%20%3CB%3E%20Next%3C%2FB%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EIn%20the%20same%20manner%20select%20the%20workflow%20created%20above%20(Re.%20%3CB%3E%20Set%20Attributes%20Containing%20Domain%20Names)%20%3C%2FB%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3CB%3E%20Select%20%3CB%3E%20Finish%20%3C%2FB%3E%20and%20%3CB%3E%20Submit%20%3C%2FB%3E%20to%20save.%20%3C%2FB%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3CB%3E%20%3CU%3E%20COMPLETED%3A%20%3C%2FU%3E%20%3C%2FB%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EAt%20this%20point%2C%20all%20new%20users%20entering%20the%20set%20for%20the%20first%20time%20will%20have%20the%20Workflow%20executed%20and%20the%20Domain%2C%20Mail%20and%20User%20Principal%20Name%20attributes%20populated%20from%20the%20formula%20in%20the%20workflow.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EThe%20attribute%20results%20for%20each%20of%20our%20domains%20(Re.%20Development%2C%20Staging%2C%20and%20Production)%20from%20the%20assumptions%20made%20in%20this%20example%3A%3C%2FP%3E%3CBR%20%2F%3E%3CTABLE%20border%3D%221%22%20cellpadding%3D%220%22%20cellspacing%3D%220%22%3E%3CBR%20%2F%3E%3CTBODY%3E%3CBR%20%2F%3E%3CTR%3E%3CBR%20%2F%3E%3CTD%20valign%3D%22top%22%20width%3D%22156%22%3E%3CBR%20%2F%3E%3CP%20align%3D%22center%22%3EATTRIBUTE%3C%2FP%3E%3CBR%20%2F%3E%3C%2FTD%3E%3CBR%20%2F%3E%3CTD%20valign%3D%22top%22%20width%3D%22156%22%3E%3CBR%20%2F%3E%3CP%20align%3D%22center%22%3EDEVELOPMENT%20DOMAIN%3C%2FP%3E%3CBR%20%2F%3E%3C%2FTD%3E%3CBR%20%2F%3E%3CTD%20valign%3D%22top%22%20width%3D%22156%22%3E%3CBR%20%2F%3E%3CP%20align%3D%22center%22%3ESTAGING%20DOMAIN%3C%2FP%3E%3CBR%20%2F%3E%3C%2FTD%3E%3CBR%20%2F%3E%3CTD%20valign%3D%22top%22%20width%3D%22156%22%3E%3CBR%20%2F%3E%3CP%20align%3D%22center%22%3EPRODUCTION%20DOMAIN%3C%2FP%3E%3CBR%20%2F%3E%3C%2FTD%3E%3CBR%20%2F%3E%3C%2FTR%3E%3CBR%20%2F%3E%3CTR%3E%3CBR%20%2F%3E%3CTD%20valign%3D%22top%22%20width%3D%22156%22%3E%3CBR%20%2F%3E%3CP%20align%3D%22center%22%3EDomain%3C%2FP%3E%3CBR%20%2F%3E%3C%2FTD%3E%3CBR%20%2F%3E%3CTD%20valign%3D%22top%22%20width%3D%22156%22%3E%3CBR%20%2F%3E%3CP%20align%3D%22center%22%3Etestcontoso%3C%2FP%3E%3CBR%20%2F%3E%3C%2FTD%3E%3CBR%20%2F%3E%3CTD%20valign%3D%22top%22%20width%3D%22156%22%3E%3CBR%20%2F%3E%3CP%20align%3D%22center%22%3Estagecontoso%3C%2FP%3E%3CBR%20%2F%3E%3C%2FTD%3E%3CBR%20%2F%3E%3CTD%20valign%3D%22top%22%20width%3D%22156%22%3E%3CBR%20%2F%3E%3CP%20align%3D%22center%22%3Econtoso%3C%2FP%3E%3CBR%20%2F%3E%3C%2FTD%3E%3CBR%20%2F%3E%3C%2FTR%3E%3CBR%20%2F%3E%3CTR%3E%3CBR%20%2F%3E%3CTD%20valign%3D%22top%22%20width%3D%22156%22%3E%3CBR%20%2F%3E%3CP%20align%3D%22center%22%3Email%3C%2FP%3E%3CBR%20%2F%3E%3C%2FTD%3E%3CBR%20%2F%3E%3CTD%20valign%3D%22top%22%20width%3D%22156%22%3E%3CBR%20%2F%3E%3CP%20align%3D%22center%22%3Euser.name%40testcontoso.com%3C%2FP%3E%3CBR%20%2F%3E%3C%2FTD%3E%3CBR%20%2F%3E%3CTD%20valign%3D%22top%22%20width%3D%22156%22%3E%3CBR%20%2F%3E%3CP%20align%3D%22center%22%3Euser.name%40stagecontoso.com%3C%2FP%3E%3CBR%20%2F%3E%3C%2FTD%3E%3CBR%20%2F%3E%3CTD%20valign%3D%22top%22%20width%3D%22156%22%3E%3CBR%20%2F%3E%3CP%20align%3D%22center%22%3Euser.name%40contoso.com%3C%2FP%3E%3CBR%20%2F%3E%3C%2FTD%3E%3CBR%20%2F%3E%3C%2FTR%3E%3CBR%20%2F%3E%3CTR%3E%3CBR%20%2F%3E%3CTD%20valign%3D%22top%22%20width%3D%22156%22%3E%3CBR%20%2F%3E%3CP%20align%3D%22center%22%3EuserPrincipalName%3C%2FP%3E%3CBR%20%2F%3E%3C%2FTD%3E%3CBR%20%2F%3E%3CTD%20valign%3D%22top%22%20width%3D%22156%22%3E%3CBR%20%2F%3E%3CP%20align%3D%22center%22%3E%3CA%20href%3D%22mailto%3Auser.name%40testcontoso.com%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%20user.name%40testcontoso.com%20%3C%2FA%3E%3C%2FP%3E%3CBR%20%2F%3E%3C%2FTD%3E%3CBR%20%2F%3E%3CTD%20valign%3D%22top%22%20width%3D%22156%22%3E%3CBR%20%2F%3E%3CP%20align%3D%22center%22%3E%3CA%20href%3D%22mailto%3Auser.name%40stagecontoso.com%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%20user.name%40stagecontoso.com%20%3C%2FA%3E%3C%2FP%3E%3CBR%20%2F%3E%3C%2FTD%3E%3CBR%20%2F%3E%3CTD%20valign%3D%22top%22%20width%3D%22156%22%3E%3CBR%20%2F%3E%3CP%20align%3D%22center%22%3E%3CA%20href%3D%22mailto%3Auser.name%40contoso.com%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%20user.name%40contoso.com%20%3C%2FA%3E%3C%2FP%3E%3CBR%20%2F%3E%3C%2FTD%3E%3CBR%20%2F%3E%3C%2FTR%3E%3CBR%20%2F%3E%3C%2FTBODY%3E%3CBR%20%2F%3E%3C%2FTABLE%3E%3CBR%20%2F%3E%3CP%3E%3CB%3E%20%3CU%3E%20%3C%2FU%3E%20%3C%2FB%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3CB%3E%20%3CU%3E%20ADDITIONAL%20NOTES%3A%20%3C%2FU%3E%20%3C%2FB%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EIn%20the%20event%20the%20workflow%20is%20updated%20with%20additional%20logic%2C%20and%2For%20you%20simply%20want%20to%20re-run%20the%20workflow%20against%20all%20members%20of%20the%20set%2C%20the%20following%20steps%20can%20be%20taken.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3CB%3EWARNING%3A%20%3C%2FB%3E%20Depending%20upon%20how%20many%20members%20are%20in%20the%20set%2C%20this%20could%20take%20some%20time%20to%20complete%20and%20could%20impact%20performance.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EOpen%20the%20Management%20Policy%20Rule%20and%20check%20Policy%20is%20Disabled.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3CIMG%20alt%3D%22clip_image022%22%20border%3D%220%22%20height%3D%22290%22%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F154008i633C026F316A2F54%22%20title%3D%22clip_image022%22%20width%3D%22535%22%20%2F%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3ESelect%20Finish%20and%20Submit%20to%20save.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EOpen%20the%20Workflow%20and%20check%20%3CSTRONG%3E%20Run%20on%20Policy%20Update%3C%2FSTRONG%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3ESelect%20%3CB%3E%20OK%20%3C%2FB%3E%20and%20%3CB%3E%20Submit%20%3C%2FB%3E%20.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3CIMG%20alt%3D%22clip_image024%22%20border%3D%220%22%20height%3D%22310%22%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F154009iD9CFC1950D1B5952%22%20title%3D%22clip_image024%22%20width%3D%22525%22%20%2F%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EOpen%20the%20Management%20Policy%20Rule%20and%20remove%20the%20check%20from%20%3CSTRONG%3E%20Policy%20is%20Disabled%20%3C%2FSTRONG%3E%20.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3CIMG%20alt%3D%22clip_image026%22%20border%3D%220%22%20height%3D%22284%22%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F154010i7EC726881C28731B%22%20title%3D%22clip_image026%22%20width%3D%22525%22%20%2F%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3ESelect%20%3CB%3E%20Finish%20%3C%2FB%3E%20and%20%3CB%3E%20Submit%20%3C%2FB%3E%20.%20This%20will%20cause%20the%20workflow%20to%20immediately%20start%20processing%20against%20all%20members%20of%20the%20set.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3CB%3ENote%20%3C%2FB%3E%20%3A%20All%20create%2C%20and%20update%20actions%20performed%20above%20are%20recorded%20as%20transactions%20in%20the%20Search%20Requests%20view%20of%20the%20portal.%20Additionally%2C%20any%20workflow%20executions%20against%20users%20and%20their%20status%20is%20also%20recorded%20in%20the%20Search%20Request%20view.%3C%2FP%3E%0A%20%0A%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-974781%22%20slang%3D%22en-US%22%3EFirst%20published%20on%20MSDN%20on%20May%2009%2C%202018%20OVERVIEW%3A%20Enterprise%20environments%20often%20contain%20multiple%20independent%20MIM%20installations%20that%20serve%20as%20a%20development%2C%20staging%2C%20and%20production%20environments.%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-974781%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3Edata%20migration%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Edomain%20name%20calculation%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Email%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Emim%202016%20sp1%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Emim%20portal%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Emim%20wal%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EUPN%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Microsoft

First published on MSDN on May 09, 2018

OVERVIEW:

 

Enterprise environments often contain multiple independent MIM installations that serve as a development, staging, and production environments. Ideally, code should be written and tested in the Development environment and transferred to staging for validation then transferred to production with no environmental modifications being required.

 

I often run across Synchronization or Attribute Flow Rules that contain the domain name “hard coded” in the content of these rule’s logic.  Below is one method for replacing these “hard coded” domain names by dynamically populating user attributes with the appropriate domain associated to the environment the workflow is executing within (re. development, staging, or production).

 

A single workflow can be migrated from development to staging to production without modification.

 

SOFTWARE REQUIREMENTS:

 

This solution uses the Microsoft Identity Manager Portal and MIMWAL workflow components. To install the MIM WAL, please refer to the following document(s).

 

EXAMPLE ASSUMPTIONS:

 

Each environment (Re. development, staging, and production) has a distinctly different domain name. In this case the domains are as follow:

 

Development TestContoso.com

 

Staging StageContoso.com

 

Production Contoso.com

 

USER ATTRIBUTES:

 

Our example will calculate the domain and populate the following attributes of the user:

 

Domain (ex. mydomain.com)

 

userPrincipalName (ex. user.name@mydomain.com)

 

Email (ex. user.name@mydomain.com)

 

CREATE THE WORKFLOW:

 

The following example workflow will calculate the domain, regardless of the environment (re. Test, Staging, Production) and eliminating the need for modification during code promotion.

 

Launch the MIM Portal with Admin Rights.

 

Select Workflows

 

Select New

 

Enter the workflow name (ex. Set Attributes Containing Domain Names )

 

Select Action as the Workflow Type.

 

 

Select Next

 

CREATE WORKFLOW ACTIVITY #1

 

Select Add Activity

 

Select WAL: Update Resource as the Activity

 

 

Press the Select button.

 

In the Activity Display Name enter “ Query Domain Name

 

Place a checkmark in the Advance Features checkbox.

 

Place a checkmark in the Query Resources checkbox.

 

In the Queries Section enter Domain as the Key

 

In the Queries Section enter //DomainConfiguration as the XPath Filter

 

 

Next, assign the value returned from the Query to a Workflow Data Variable called Domain .

 

In the Updates section, enter [//Queries/Domain/DisplayName] as the Value Expression

 

In the Updates section, enter [//WorkflowData/Domain] as the Target .

 

 

Select Save to save the first activity of the Workflow.

 

Note: Attribute names variables, Key, XPathFilter, Value Expression, and Target values are case sensitive.

 

CREATE WORKFLOW ACTIVITY #2:

 

Select Add Activity

 

Select WAL: Update Resource as the Activity

 

 

Press the Select button.

 

Enter the Activity Display Name (ex. Update User Attributes )

 

Next, we will Read the WorkflowData/Domain attribute into an Activity variable.

 

Under Updates, enter [//WorkflowData/Domain] as the Value Expression

 

Under Updates, enter $Domain as the Target

 

 

Select Add to add another row to the Updates section.

 

 

Continue to Add rows and enter the following additional Value Expressions and Targets:

 


Description


Value Expression


Target


Set the lower case of the user accountName to the Account variable.


LowerCase([//Target/accountName])


$Account


Set the Domain name variable to lowercase.


LowerCase($Domain)


$Domain


Set the Email variable by concatenating values.


Concatenate($Account,”@”,$Domain,”.com”)


$Email


Set the UPN variable userPrincipalName by concatenating values.


Concatenate($Account,”@”,$Domain,”.com”)


$UPN


Set the Domain attribute in the user record to the value of the Domain variable.


$Domain


[//Target/Domain]


Set the mail attribute in the user record to the value of the Email variable.


$Email


[//Target/mail]


Set the userPrincipalName attribute in the user record to the value of the UPN variable.


$UPN


[//Target/userPrincipalName]

 

NOTE: All MIMWAL Functions, including LowerCase and Concatenate used in tis example, can be referenced at the following location:

 

https://github.com/Microsoft/MIMWAL/wiki/Functions

 

Once completed, the second activity of the workflow will appear as follows:

 

 

Select the Save Button to save the second activity.

 

Select OK and Submit to save the Workflow.

 

CREATE A SET

 

Next, create a set of user objects that do not have a value for one or all of the attributes needing to be populated (re. Domain, mail, or userPrincipalName).

 

Select Sets , New

 

In the Display Name enter a name for the set (Ex. ~Users requiring Domain mail or userPrincipalName values)

 

Select Next

 

Check Enable criteria-based membership in current set .

 

Change all resources to user

 

Change all to any

 

Select Add Statement

 

Select Click to Select Attribute and choose the Domain attribute

 

Select is then from the drop down menu select not starts with

 

Select click to select value , enter %

 

Note: % is a wild card value meaning having any value, excludes nulls.

 

Repeat the above steps for the Mail and User Principal Name attributes. This should result in the following:

 

 

Select the View Members button to test the set.

 

Select Finish , Submit to save the Set.

 

CREATE A MANAGEMENT POLICY RULE:

 

Finally, create a Management Policy Rule (MPR) that applies the Workflow to the set of users.

 

Select Management Policy Rules, New

 

In the Display Name enter the name of the MPR (ex. !~Update Users Domain Mail and userPrincipalName Values)

 

In the Type section select Set Transition

 

 

Select Next

 

On the Transition Definition Tab in the Transition Set section select the stacked paper icon.

 

Choose the set that was created above (Ex. ~Users requiring Domain mail or userPrincipalName values) by placing a checkmark in the box next to the name.

 

 

Select Ok

 

In the Transition Type section retain the default setting of Transition In

 

Select Next

 

In the same manner select the workflow created above (Re. Set Attributes Containing Domain Names)

 

Select Finish and Submit to save.

 

COMPLETED:

 

At this point, all new users entering the set for the first time will have the Workflow executed and the Domain, Mail and User Principal Name attributes populated from the formula in the workflow.

 

The attribute results for each of our domains (Re. Development, Staging, and Production) from the assumptions made in this example:

 


ATTRIBUTE


DEVELOPMENT DOMAIN


STAGING DOMAIN


PRODUCTION DOMAIN


Domain


testcontoso


stagecontoso


contoso


mail


user.name@testcontoso.com


user.name@stagecontoso.com


user.name@contoso.com


userPrincipalName


user.name@testcontoso.com


user.name@stagecontoso.com


user.name@contoso.com

 

 

 

ADDITIONAL NOTES:

 

In the event the workflow is updated with additional logic, and/or you simply want to re-run the workflow against all members of the set, the following steps can be taken.

 

WARNING: Depending upon how many members are in the set, this could take some time to complete and could impact performance.

 

Open the Management Policy Rule and check Policy is Disabled.

 

 

Select Finish and Submit to save.

 

Open the Workflow and check Run on Policy Update

 

Select OK and Submit .

 

 

Open the Management Policy Rule and remove the check from Policy is Disabled .

 

 

Select Finish and Submit . This will cause the workflow to immediately start processing against all members of the set.

 

Note : All create, and update actions performed above are recorded as transactions in the Search Requests view of the portal. Additionally, any workflow executions against users and their status is also recorded in the Search Request view.