Same users but new domain with AD Connect...

%3CLINGO-SUB%20id%3D%22lingo-sub-218706%22%20slang%3D%22en-US%22%3ESame%20users%20but%20new%20domain%20with%20AD%20Connect...%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-218706%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSPAN%3EHi%2C%3CBR%20%2F%3EI%20explain%20my%20future%20problem%3B)%20but%20I%20can't%20find%20information%20about%20it%3CBR%20%2F%3EI%20have%20a%20local%20AD%20that%20is%20synchronized%20with%20Azure%20AD%20connect%20for%20my%20Office%20365%20(Exchange%20Online)%20accounts.%20I%20will%20change%20my%20local%20domain%20(name%20change)%20and%20redo%20all%20my%20users%20(migration%20seems%20too%20risky%20for%20the%20few%20accounts%20-%20it's%20on%20a%20W2008%20yet...%20to%20W2016)%20but%20it%20will%20be%20important%20that%20the%20new%20accounts%20synchronize%20on%20Azure%20AD%20and%20keep%20the%20existing%20Exchange%20accounts.%3CBR%20%2F%3EHow%20to%3A%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E-%20disconnect%20my%20old%20domain%20then%20reconnect%20my%20new%20domain%20but%20keeping%20the%20Exchange%20%2F%20Sharepoint%20%2F%20etc%20...%20accounts%20of%20my%20users%20%3F%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EThanks%20and%20Sorry%20for%20my%20english%20...%20I'm%20french%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EAM%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-218706%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EOffice%20365%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-218938%22%20slang%3D%22en-US%22%3ERe%3A%20Same%20users%20but%20new%20domain%20with%20AD%20Connect...%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-218938%22%20slang%3D%22en-US%22%3E%3CP%3EAfter%20you%20are%20finished%20with%20the%20migration%2C%20you%20can%20prepare%20the%20user%20objects%20in%20order%20to%20%22match%22%20them%20against%20the%20users%20already%20existing%20in%20O365.%20You%20have%20two%20options%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E1)%20Soft-match%2C%20based%20on%20the%20primary%20SMTP%20address%3A%20%3CA%20href%3D%22http%3A%2F%2Fsupport.microsoft.com%2Fkb%2F2641663%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttp%3A%2F%2Fsupport.microsoft.com%2Fkb%2F2641663%3C%2FA%3E.%20This%20will%20require%20you%20to%20clear%20the%20immutableID%20first.%3C%2FP%3E%0A%3CP%3E2)%20Hard-match%2C%20based%20on%20the%20objectID%3A%20%3CA%20href%3D%22http%3A%2F%2Fblogs.technet.com%2Fb%2Fpraveenkumar%2Farchive%2F2014%2F04%2F12%2Fhow-to-do-hard-match-in-dirsync.aspx%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttp%3A%2F%2Fblogs.technet.com%2Fb%2Fpraveenkumar%2Farchive%2F2014%2F04%2F12%2Fhow-to-do-hard-match-in-dirsync.aspx%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EBoth%20methods%20will%20yield%20same%20results%2C%20after%20you%20re-enable%20DirSync%20the%20accounts%20should%20be%20%22linked%22.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-218862%22%20slang%3D%22en-US%22%3ERe%3A%20Same%20users%20but%20new%20domain%20with%20AD%20Connect...%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-218862%22%20slang%3D%22en-US%22%3E%3CP%3EThanks%20for%20your%20reply%2C%26nbsp%3B%3C%2FP%3E%3CP%3EI%20did%20not%20know%20that%20disconnecting%20AD%20sync%2C%20O365%20would%20convert%20accounts%20to%20Cloud%20account.%3C%2FP%3E%3CP%3Eit%20would%20be%20really%20good%20%3A)%3C%2Fimg%3E%26nbsp%3B%3CBR%20%2F%3Ehowever%2C%20when%20I'm%20going%20to%20reconnect%20the%20AD%20sync%20with%20my%20new%20domain%2C%20how%20will%20it%20link%20to%20the%20cloud%20accounts%20and%20accounts%20of%20my%20new%20AD%3F%20just%20with%20the%20email%20address%3F%20the%20SID%20is%20not%20the%20unique%20reference%20as%20locally%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-218752%22%20slang%3D%22en-US%22%3ERe%3A%20Same%20users%20but%20new%20domain%20with%20AD%20Connect...%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-218752%22%20slang%3D%22en-US%22%3EOne%20way%2C%20and%20I'm%20not%20an%20expert%20on%20this%20topics%2C%20is%20just%20stop%20to%20sync%20your%20AD%20with%20Office%20365%20so%20all%20your%20users%20will%20be%20cloud%20users%2C%20do%20the%20migration%20and%20then%20setup%20up%20again%20AD%20Sync%20with%20Azure%20AD%20Connect%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1707755%22%20slang%3D%22de-DE%22%3ESubject%3A%20Same%20users%20but%20new%20domain%20with%20AD%20Connect...%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1707755%22%20slang%3D%22de-DE%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F167786%22%20target%3D%22_blank%22%3E%40Alexis%20MONIOT%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%20class%3D%22md-end-block%20md-p%22%3E%3CSPAN%20class%3D%22md-plain%20md-expand%22%3EHey%20Alexis%2C%3C%2FSPAN%3E%3C%2FP%3E%3CP%20class%3D%22md-end-block%20md-p%22%3E%3CSPAN%20class%3D%22md-plain%22%3Ewe%20faced%20a%20similiar%20issue.%20We%20had%20one%20old%20On-Premise%20AD%20which%20was%20synced%20to%20our%20AzureAD.%20They%20were%20all%20in%20the%20domain%20%22example.old%22.%20We%20manually%20migrated%20all%20our%20users%20to%20our%20new%20domain%20%22example.com%22%20in%20the%20new%20On-Premise%20AD.%20During%20the%20migration%20we%20changed%20the%20usernames%20(sAMAccountname)%20to%20a%20new%20schema%20as%20well.%20(side%20note%3A%20The%20old%20groups%20weren't%20neccessary%20in%20the%20new%20domain%2C%20so%20we%20didn't%20have%20to%20migrate%20the%20old%20groups)%3C%2FSPAN%3E%3C%2FP%3E%3CP%20class%3D%22md-end-block%20md-p%22%3E%26nbsp%3B%3C%2FP%3E%3CP%20class%3D%22md-end-block%20md-p%22%3E%3CSPAN%20class%3D%22md-pair-s%20%22%3E%3CSTRONG%3E%3CSPAN%20class%3D%22md-plain%22%3EThe%20problem%3A%3C%2FSPAN%3E%3C%2FSTRONG%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22md-plain%22%3E%20example.old-john.doe%20was%20already%20synced%20with%20the%20corresponding%20user%20in%20the%20AzureAD.%20So%20if%20we%20would%20just%20start%20the%20new%20AD%20Connect%20from%20the%20new%20AD%20(example.com)%20the%20synchronization%20would%20fail%2C%20because%20AzureAD%20doesn't%20allow%20two%20%22john.doe%22s.%20%3C%2FSPAN%3E%3C%2FP%3E%3CP%20class%3D%22md-end-block%20md-p%22%3E%26nbsp%3B%3C%2FP%3E%3CP%20class%3D%22md-end-block%20md-p%22%3E%3CSPAN%20class%3D%22md-pair-s%20%22%3E%3CSTRONG%3E%3CSPAN%20class%3D%22md-plain%22%3EOur%20solution%3A%3C%2FSPAN%3E%3C%2FSTRONG%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22md-plain%22%3E%20We%20stopped%20the%20sync%20on%20the%20old%20%22example.old%22%20AD%20before%20we%20configured%20the%20new%20AD%20Connect.%20We%20then%20configured%20the%20new%20AD-Sync%20like%20the%20old%20one%2C%20with%20the%20only%20difference%20that%20two%20ADs%20are%20synching%20into%20AzureAD%20and%20both%20ADs%20have%20unique%20users.%20Infact%20that's%20not%20the%20case%2C%20but%20we%20wanted%20to%20shut%20down%20the%20old%20AD.%20Don't%20worry%20that%20users%20might%20be%20deleted%2C%20because%20the%20new%20AD%20won't%20delete%20users%20of%20the%20old%20AD.%20The%20only%20issue%20might%20be%20newly%20created%20users.%3C%2FSPAN%3E%3C%2FP%3E%3CP%20class%3D%22md-end-block%20md-p%22%3E%3CSPAN%20class%3D%22md-plain%22%3EBefore%20starting%20the%20actual%20synchronization%20we%20ran%20the%20following%20script%20from%20the%20new%20AD.%20This%20script%20replaces%20the%20ImmutableIDs%20of%20the%20AzureAD%20users%20with%20the%20ones%20from%20the%20new%20On-Premise%20AD.%20This%20ID%20is%20used%20by%20ADSync%20to%20hard-match%20those%20entries.%3C%2FSPAN%3E%3C%2FP%3E%3CP%20class%3D%22md-end-block%20md-p%22%3E%26nbsp%3B%3C%2FP%3E%3CPRE%3E%3CSPAN%3E%3CSPAN%20class%3D%22cm-builtin%22%3EImport-Module%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22cm-identifier%22%3EActiveDirectory%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%E2%80%8B%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%3CSPAN%20class%3D%22cm-comment%22%3E%23%20get%20all%20users%20from%20new%20On-Premise%20AD%20that%20should%20be%20synced%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%3CSPAN%20class%3D%22cm-variable-2%22%3E%24users%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22cm-operator%22%3E%3D%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22cm-identifier%22%3EGet-ADUser%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22cm-operator%22%3E-%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-keyword%22%3EFilter%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22cm-string%22%3E%22*%22%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22cm-operator%22%3E-%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-identifier%22%3ESearchBase%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22cm-string%22%3E%22OU%3DUsers%2CDC%3Dexample%2CDC%3Dcom%22%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%E2%80%8B%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%3CSPAN%20class%3D%22cm-comment%22%3E%23%20Rewrite%20all%20ImmutableIDs%20of%20these%20users%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%3CSPAN%20class%3D%22cm-keyword%22%3Eforeach%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-punctuation%22%3E(%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-variable-2%22%3E%24user%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22cm-keyword%22%3Ein%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22cm-variable-2%22%3E%24users%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-punctuation%22%3E)%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%3CSPAN%20class%3D%22cm-punctuation%22%3E%7B%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%20%26nbsp%3B%20%26nbsp%3B%3CSPAN%20class%3D%22cm-builtin%22%3EWrite-Host%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22cm-string%22%3E%22Processing%20user%3A%20%22%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22cm-variable-2%22%3E%24user%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-punctuation%22%3E.%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-identifier%22%3EName%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22cm-variable-2%22%3E%24user%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-punctuation%22%3E.%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-identifier%22%3EObjectGUID%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%20%26nbsp%3B%20%26nbsp%3B%3CSPAN%20class%3D%22cm-builtin%22%3EC%3A%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-error%22%3E%5C%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-identifier%22%3Etmp%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-error%22%3E%5C%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-identifier%22%3ECreateID%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-punctuation%22%3E.%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-identifier%22%3Eps1%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22cm-operator%22%3E-%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-identifier%22%3Evaluetoconvert%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22cm-variable-2%22%3E%24user%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-punctuation%22%3E.%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-identifier%22%3EObjectGUID%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22cm-operator%22%3E-%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-identifier%22%3Eusername%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22cm-variable-2%22%3E%24user%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-punctuation%22%3E.%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-identifier%22%3EName%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%3CSPAN%20class%3D%22cm-punctuation%22%3E%7D%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FPRE%3E%3CP%20class%3D%22md-end-block%20md-p%22%3E%26nbsp%3B%3C%2FP%3E%3CP%20class%3D%22md-end-block%20md-p%22%3E%3CSPAN%20class%3D%22md-plain%22%3EWe%20slightly%20modified%20the%20following%20script%20(see%20source)%20so%20the%20users%20are%20edited%20automatically.%3C%2FSPAN%3E%3C%2FP%3E%3CP%20class%3D%22md-end-block%20md-p%22%3E%3CSPAN%20class%3D%22md-plain%22%3ECreateID.ps1%20(source%3A%20%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22md-link%20md-pair-s%22%3E%3CA%20href%3D%22https%3A%2F%2Fgallery.technet.microsoft.com%2Foffice%2FCovert-DirSyncMS-Online-5f3563b1%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgallery.technet.microsoft.com%2Foffice%2FCovert-DirSyncMS-Online-5f3563b1%3C%2FA%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22md-plain%22%3E)%3C%2FSPAN%3E%3C%2FP%3E%3CP%20class%3D%22md-end-block%20md-p%22%3E%26nbsp%3B%3C%2FP%3E%3CPRE%3E%3CSPAN%3E%3CSPAN%20class%3D%22cm-comment%22%3E%23------------------------------------------------------------------------------%20%26nbsp%3B%20%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%3CSPAN%20class%3D%22cm-comment%22%3E%23%20%26nbsp%3B%20%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%3CSPAN%20class%3D%22cm-comment%22%3E%23%20Copyright%20%C2%A9%202012%20Microsoft%20Corporation.%20%20All%20rights%20reserved.%20%26nbsp%3B%20%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%3CSPAN%20class%3D%22cm-comment%22%3E%23%20%26nbsp%3B%20%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%3CSPAN%20class%3D%22cm-comment%22%3E%23%20This%20Sample%20Code%20is%20provided%20for%20the%20purpose%20of%20illustration%20only%20and%20is%20not%20intended%20to%20be%20used%20in%20a%20production%20environment.%20%26nbsp%3B%20%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%3CSPAN%20class%3D%22cm-comment%22%3E%23%20THIS%20SAMPLE%20CODE%20AND%20ANY%20RELATED%20INFORMATION%20ARE%20PROVIDED%20%22AS%20IS%22%20WITHOUT%20WARRANTY%20OF%20ANY%20KIND%2C%20EITHER%20EXPRESSED%20OR%20IMPLIED%2C%20%26nbsp%3B%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%3CSPAN%20class%3D%22cm-comment%22%3E%23%20INCLUDING%20BUT%20NOT%20LIMITED%20TO%20THE%20IMPLIED%20WARRANTIES%20OF%20MERCHANTABILITY%20AND%2FOR%20FITNESS%20FOR%20A%20PARTICULAR%20PURPOSE.%20%26nbsp%3B%20%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%3CSPAN%20class%3D%22cm-comment%22%3E%23%20We%20grant%20You%20a%20nonexclusive%2C%20royalty-free%20right%20to%20use%20and%20modify%20the%20Sample%20Code%20and%20to%20reproduce%20and%20distribute%20the%20object%20code%20%26nbsp%3B%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%3CSPAN%20class%3D%22cm-comment%22%3E%23%20form%20of%20the%20Sample%20Code%2C%20provided%20that%20You%20agree%3A%20(i)%20to%20not%20use%20Our%20name%2C%20logo%2C%20or%20trademarks%20to%20market%20Your%20software%20product%20in%20%26nbsp%3B%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%3CSPAN%20class%3D%22cm-comment%22%3E%23%20which%20the%20Sample%20Code%20is%20embedded%3B%20(ii)%20to%20include%20a%20valid%20copyright%20notice%20on%20Your%20software%20product%20in%20which%20the%20Sample%20Code%20is%20%26nbsp%3B%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%3CSPAN%20class%3D%22cm-comment%22%3E%23%20embedded%3B%20and%20(iii)%20to%20indemnify%2C%20hold%20harmless%2C%20and%20defend%20Us%20and%20Our%20suppliers%20from%20and%20against%20any%20claims%20or%20lawsuits%2C%20%26nbsp%3B%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%3CSPAN%20class%3D%22cm-comment%22%3E%23%20including%20attorneys%E2%80%99%20fees%2C%20that%20arise%20or%20result%20from%20the%20use%20or%20distribution%20of%20the%20Sample%20Code.%20%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%3CSPAN%20class%3D%22cm-comment%22%3E%23%20%26nbsp%3B%20%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%3CSPAN%20class%3D%22cm-comment%22%3E%23------------------------------------------------------------------------------%20%26nbsp%3B%20%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%3CSPAN%20class%3D%22cm-comment%22%3E%23%20%26nbsp%3B%20%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%3CSPAN%20class%3D%22cm-comment%22%3E%23%20PowerShell%20Source%20Code%20%26nbsp%3B%20%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%3CSPAN%20class%3D%22cm-comment%22%3E%23%20%26nbsp%3B%20%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%3CSPAN%20class%3D%22cm-comment%22%3E%23%20NAME%3A%20%26nbsp%3B%20%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%3CSPAN%20class%3D%22cm-comment%22%3E%23%20%26nbsp%3B%20%20GUID2ImmutableID.ps1%20%26nbsp%3B%20%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%3CSPAN%20class%3D%22cm-comment%22%3E%23%20%26nbsp%3B%20%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%3CSPAN%20class%3D%22cm-comment%22%3E%23%20VERSION%3A%20%26nbsp%3B%20%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%3CSPAN%20class%3D%22cm-comment%22%3E%23%20%26nbsp%3B%20%201.0%20%26nbsp%3B%20%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%3CSPAN%20class%3D%22cm-comment%22%3E%23%20Author%3A%20Steve%20Halligan%20%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%3CSPAN%20class%3D%22cm-comment%22%3E%23%20%26nbsp%3B%20%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%3CSPAN%20class%3D%22cm-comment%22%3E%23------------------------------------------------------------------------------%20%26nbsp%3B%20%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%3CSPAN%20class%3D%22cm-keyword%22%3Eparam%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-punctuation%22%3E(%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%20%26nbsp%3B%20%26nbsp%3B%3CSPAN%20class%3D%22cm-punctuation%22%3E%5B%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-identifier%22%3Estring%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-punctuation%22%3E%5D%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-variable-2%22%3E%24valuetoconvert%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-punctuation%22%3E%2C%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%20%26nbsp%3B%20%26nbsp%3B%3CSPAN%20class%3D%22cm-punctuation%22%3E%5B%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-identifier%22%3Estring%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-punctuation%22%3E%5D%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-variable-2%22%3E%24username%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%3CSPAN%20class%3D%22cm-punctuation%22%3E)%3C%2FSPAN%3E%20%3C%2FSPAN%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CSPAN%3E%3CSPAN%20class%3D%22cm-keyword%22%3Efunction%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22cm-identifier%22%3EisGUID%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22cm-punctuation%22%3E(%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-variable-2%22%3E%24data%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-punctuation%22%3E)%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22cm-punctuation%22%3E%7B%3C%2FSPAN%3E%20%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%20%26nbsp%3B%20%26nbsp%3B%3CSPAN%20class%3D%22cm-keyword%22%3Etry%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22cm-punctuation%22%3E%7B%3C%2FSPAN%3E%20%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%3CSPAN%20class%3D%22cm-variable-2%22%3E%24guid%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22cm-operator%22%3E%3D%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22cm-punctuation%22%3E%5B%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-identifier%22%3EGUID%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-punctuation%22%3E%5D%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-variable-2%22%3E%24data%3C%2FSPAN%3E%20%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%3CSPAN%20class%3D%22cm-keyword%22%3Ereturn%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22cm-number%22%3E1%3C%2FSPAN%3E%20%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%20%26nbsp%3B%20%26nbsp%3B%3CSPAN%20class%3D%22cm-punctuation%22%3E%7D%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22cm-keyword%22%3Ecatch%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22cm-punctuation%22%3E%7B%3C%2FSPAN%3E%20%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%3CSPAN%20class%3D%22cm-comment%22%3E%23%24notguid%20%3D%201%20%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%3CSPAN%20class%3D%22cm-keyword%22%3Ereturn%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22cm-number%22%3E0%3C%2FSPAN%3E%20%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%20%26nbsp%3B%20%26nbsp%3B%3CSPAN%20class%3D%22cm-punctuation%22%3E%7D%3C%2FSPAN%3E%20%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%3CSPAN%20class%3D%22cm-punctuation%22%3E%7D%3C%2FSPAN%3E%20%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%3CSPAN%20class%3D%22cm-keyword%22%3Efunction%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22cm-identifier%22%3EisBase64%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22cm-punctuation%22%3E(%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-variable-2%22%3E%24data%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-punctuation%22%3E)%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22cm-punctuation%22%3E%7B%3C%2FSPAN%3E%20%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%20%26nbsp%3B%20%26nbsp%3B%3CSPAN%20class%3D%22cm-keyword%22%3Etry%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22cm-punctuation%22%3E%7B%3C%2FSPAN%3E%20%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%3CSPAN%20class%3D%22cm-variable-2%22%3E%24decodedII%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22cm-operator%22%3E%3D%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22cm-punctuation%22%3E%5B%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-identifier%22%3Esystem%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-punctuation%22%3E.%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-identifier%22%3Econvert%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-punctuation%22%3E%5D%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-operator%22%3E%3A%3A%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-identifier%22%3Efrombase64string%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-punctuation%22%3E(%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-variable-2%22%3E%24data%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-punctuation%22%3E)%3C%2FSPAN%3E%20%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%3CSPAN%20class%3D%22cm-keyword%22%3Ereturn%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22cm-number%22%3E1%3C%2FSPAN%3E%20%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%20%26nbsp%3B%20%26nbsp%3B%3CSPAN%20class%3D%22cm-punctuation%22%3E%7D%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22cm-keyword%22%3Ecatch%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22cm-punctuation%22%3E%7B%3C%2FSPAN%3E%20%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%3CSPAN%20class%3D%22cm-keyword%22%3Ereturn%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22cm-number%22%3E0%3C%2FSPAN%3E%20%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%20%26nbsp%3B%20%26nbsp%3B%3CSPAN%20class%3D%22cm-punctuation%22%3E%7D%3C%2FSPAN%3E%20%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%3CSPAN%20class%3D%22cm-punctuation%22%3E%7D%3C%2FSPAN%3E%20%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%3CSPAN%20class%3D%22cm-keyword%22%3Efunction%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22cm-identifier%22%3Edisplayhelp%3C%2FSPAN%3E%20%26nbsp%3B%3CSPAN%20class%3D%22cm-punctuation%22%3E%7B%3C%2FSPAN%3E%20%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%20%26nbsp%3B%20%26nbsp%3B%3CSPAN%20class%3D%22cm-builtin%22%3Ewrite-host%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22cm-string%22%3E%22Please%20Supply%20the%20value%20you%20want%20converted%22%3C%2FSPAN%3E%20%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%20%26nbsp%3B%20%26nbsp%3B%3CSPAN%20class%3D%22cm-builtin%22%3Ewrite-host%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22cm-string%22%3E%22Examples%3A%22%3C%2FSPAN%3E%20%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%20%26nbsp%3B%20%26nbsp%3B%3CSPAN%20class%3D%22cm-builtin%22%3Ewrite-host%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22cm-string%22%3E%22To%20convert%20a%20GUID%20to%20an%20Immutable%20ID%3A%20GUID2ImmutableID.ps1%20'748b2d72-706b-42f8-8b25-82fd8733860f'%22%3C%2FSPAN%3E%20%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%20%26nbsp%3B%20%26nbsp%3B%3CSPAN%20class%3D%22cm-builtin%22%3Ewrite-host%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22cm-string%22%3E%22To%20convert%20an%20ImmutableID%20to%20a%20GUID%3A%20GUID2ImmutableID.ps1%20'ci2LdGtw%2BEKLJYL9hzOGDw%3D%3D'%22%3C%2FSPAN%3E%20%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%20%26nbsp%3B%20%26nbsp%3B%3CSPAN%20class%3D%22cm-punctuation%22%3E%7D%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%20%26nbsp%3B%20%26nbsp%3B%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%3CSPAN%20class%3D%22cm-keyword%22%3Eif%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22cm-punctuation%22%3E(%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-variable-2%22%3E%24valuetoconvert%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22cm-operator%22%3E-eq%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22cm-builtin%22%3E%24NULL%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-punctuation%22%3E)%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22cm-punctuation%22%3E%7B%3C%2FSPAN%3E%20%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%20%26nbsp%3B%20%26nbsp%3B%3CSPAN%20class%3D%22cm-identifier%22%3EDisplayHelp%3C%2FSPAN%3E%20%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%20%26nbsp%3B%20%26nbsp%3B%3CSPAN%20class%3D%22cm-keyword%22%3Ereturn%3C%2FSPAN%3E%20%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%3CSPAN%20class%3D%22cm-punctuation%22%3E%7D%3C%2FSPAN%3E%20%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%3CSPAN%20class%3D%22cm-keyword%22%3Eif%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22cm-punctuation%22%3E(%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-identifier%22%3EisGUID%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-punctuation%22%3E(%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-variable-2%22%3E%24valuetoconvert%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-punctuation%22%3E))%3C%2FSPAN%3E%20%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%3CSPAN%20class%3D%22cm-punctuation%22%3E%7B%3C%2FSPAN%3E%20%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%20%26nbsp%3B%20%26nbsp%3B%3CSPAN%20class%3D%22cm-variable-2%22%3E%24guid%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22cm-operator%22%3E%3D%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22cm-punctuation%22%3E%5B%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-identifier%22%3EGUID%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-punctuation%22%3E%5D%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-variable-2%22%3E%24valuetoconvert%3C%2FSPAN%3E%20%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%20%26nbsp%3B%20%26nbsp%3B%3CSPAN%20class%3D%22cm-variable-2%22%3E%24bytearray%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22cm-operator%22%3E%3D%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22cm-variable-2%22%3E%24guid%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-punctuation%22%3E.%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-identifier%22%3Etobytearray%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-punctuation%22%3E()%3C%2FSPAN%3E%20%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%20%26nbsp%3B%20%26nbsp%3B%3CSPAN%20class%3D%22cm-variable-2%22%3E%24immutableID%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22cm-operator%22%3E%3D%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22cm-punctuation%22%3E%5B%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-identifier%22%3Esystem%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-punctuation%22%3E.%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-identifier%22%3Econvert%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-punctuation%22%3E%5D%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-operator%22%3E%3A%3A%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-identifier%22%3EToBase64String%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-punctuation%22%3E(%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-variable-2%22%3E%24bytearray%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-punctuation%22%3E)%3C%2FSPAN%3E%20%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%20%26nbsp%3B%20%26nbsp%3B%3CSPAN%20class%3D%22cm-builtin%22%3Ewrite-host%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22cm-string%22%3E%22ImmutableID%22%3C%2FSPAN%3E%20%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%20%26nbsp%3B%20%26nbsp%3B%3CSPAN%20class%3D%22cm-builtin%22%3Ewrite-host%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22cm-string%22%3E%22-----------%22%3C%2FSPAN%3E%20%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%20%26nbsp%3B%20%26nbsp%3B%3CSPAN%20class%3D%22cm-variable-2%22%3E%24immutableID%3C%2FSPAN%3E%20%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%3CSPAN%20class%3D%22cm-punctuation%22%3E%7D%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22cm-keyword%22%3Eelseif%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22cm-punctuation%22%3E(%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-identifier%22%3EisBase64%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-punctuation%22%3E(%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-variable-2%22%3E%24valuetoconvert%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-punctuation%22%3E))%7B%3C%2FSPAN%3E%20%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%20%26nbsp%3B%20%26nbsp%3B%3CSPAN%20class%3D%22cm-variable-2%22%3E%24decodedII%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22cm-operator%22%3E%3D%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22cm-punctuation%22%3E%5B%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-identifier%22%3Esystem%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-punctuation%22%3E.%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-identifier%22%3Econvert%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-punctuation%22%3E%5D%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-operator%22%3E%3A%3A%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-identifier%22%3Efrombase64string%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-punctuation%22%3E(%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-variable-2%22%3E%24valuetoconvert%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-punctuation%22%3E)%3C%2FSPAN%3E%20%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%20%26nbsp%3B%20%26nbsp%3B%3CSPAN%20class%3D%22cm-keyword%22%3Eif%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22cm-punctuation%22%3E(%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-identifier%22%3EisGUID%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-punctuation%22%3E(%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-variable-2%22%3E%24decodedII%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-punctuation%22%3E))%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22cm-punctuation%22%3E%7B%3C%2FSPAN%3E%20%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%3CSPAN%20class%3D%22cm-variable-2%22%3E%24decode%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22cm-operator%22%3E%3D%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22cm-punctuation%22%3E%5B%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-identifier%22%3EGUID%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-punctuation%22%3E%5D%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-variable-2%22%3E%24decodedii%3C%2FSPAN%3E%20%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%3CSPAN%20class%3D%22cm-variable-2%22%3E%24decode%3C%2FSPAN%3E%20%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%20%26nbsp%3B%20%26nbsp%3B%3CSPAN%20class%3D%22cm-punctuation%22%3E%7D%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22cm-keyword%22%3Eelse%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22cm-punctuation%22%3E%7B%3C%2FSPAN%3E%20%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%3CSPAN%20class%3D%22cm-builtin%22%3EWrite-Host%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22cm-string%22%3E%22Value%20provided%20not%20in%20GUID%20or%20ImmutableID%20format.%22%3C%2FSPAN%3E%20%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%3CSPAN%20class%3D%22cm-identifier%22%3EDisplayHelp%3C%2FSPAN%3E%20%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%20%26nbsp%3B%20%26nbsp%3B%3CSPAN%20class%3D%22cm-punctuation%22%3E%7D%3C%2FSPAN%3E%20%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%3CSPAN%20class%3D%22cm-punctuation%22%3E%7D%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22cm-keyword%22%3Eelse%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22cm-punctuation%22%3E%7B%3C%2FSPAN%3E%20%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%20%26nbsp%3B%20%26nbsp%3B%3CSPAN%20class%3D%22cm-builtin%22%3EWrite-Host%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22cm-string%22%3E%22Value%20provided%20not%20in%20GUID%20or%20ImmutableID%20format.%22%3C%2FSPAN%3E%20%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%20%26nbsp%3B%20%26nbsp%3B%3CSPAN%20class%3D%22cm-identifier%22%3EDisplayHelp%3C%2FSPAN%3E%20%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%3CSPAN%20class%3D%22cm-punctuation%22%3E%7D%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%E2%80%8B%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%3CSPAN%20class%3D%22cm-comment%22%3E%23%20START%20our%20modifications%3A%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%3CSPAN%20class%3D%22cm-builtin%22%3EImport-Module%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22cm-identifier%22%3EAzureAD%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%3CSPAN%20class%3D%22cm-variable-2%22%3E%24usernameAzure%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22cm-operator%22%3E%3D%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22cm-string%22%3E%22adminuser%40example.com%22%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%3CSPAN%20class%3D%22cm-variable-2%22%3E%24passwordAzure%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22cm-operator%22%3E%3D%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22cm-builtin%22%3EConvertTo-SecureString%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22cm-string%22%3E%22yoursupersecretpassword%22%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22cm-operator%22%3E-%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-identifier%22%3EAsPlainText%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22cm-operator%22%3E-%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-identifier%22%3EForce%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%3CSPAN%20class%3D%22cm-variable-2%22%3E%24credentials%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22cm-operator%22%3E%3D%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22cm-builtin%22%3ENew-Object%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22cm-identifier%22%3ESystem%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-punctuation%22%3E.%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-identifier%22%3EManagement%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-punctuation%22%3E.%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-identifier%22%3EAutomation%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-punctuation%22%3E.%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-identifier%22%3EPSCredential%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22cm-punctuation%22%3E(%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-variable-2%22%3E%24usernameAzure%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-punctuation%22%3E%2C%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22cm-variable-2%22%3E%24passwordAzure%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-punctuation%22%3E)%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%3CSPAN%20class%3D%22cm-variable-2%22%3E%24connect%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22cm-operator%22%3E%3D%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22cm-identifier%22%3EConnect-AzureAD%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22cm-operator%22%3E-%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-identifier%22%3ECredential%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22cm-variable-2%22%3E%24credentials%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%3CSPAN%20class%3D%22cm-comment%22%3E%23%20This%20is%20the%20important%20part%3A%20%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%3CSPAN%20class%3D%22cm-comment%22%3E%23%20here%20we%20replace%20the%20immutableIDs%20in%20AzureAD%20with%20the%20ones%20from%20the%20%22local%22%20AD%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%3CSPAN%20class%3D%22cm-variable-2%22%3E%24user%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22cm-operator%22%3E%3D%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22cm-identifier%22%3EGet-AzureADUser%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22cm-operator%22%3E-%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-keyword%22%3EFilter%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22cm-string%22%3E%22DisplayName%20eq%20'%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-variable-2%22%3E%24username%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-string%22%3E'%22%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%3CSPAN%20class%3D%22cm-variable-2%22%3E%24user%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22cm-operator%22%3E%7C%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22cm-identifier%22%3ESet-AzureADUser%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22cm-operator%22%3E-%3C%2FSPAN%3E%3CSPAN%20class%3D%22cm-identifier%22%3EImmutableId%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22cm-variable-2%22%3E%24immutableID%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
New Contributor

Hi,
I explain my future problem;) but I can't find information about it
I have a local AD that is synchronized with Azure AD connect for my Office 365 (Exchange Online) accounts. I will change my local domain (name change) and redo all my users (migration seems too risky for the few accounts - it's on a W2008 yet... to W2016) but it will be important that the new accounts synchronize on Azure AD and keep the existing Exchange accounts.
How to:

- disconnect my old domain then reconnect my new domain but keeping the Exchange / Sharepoint / etc ... accounts of my users ?

Thanks and Sorry for my english ... I'm french 

AM 

4 Replies
Highlighted
One way, and I'm not an expert on this topics, is just stop to sync your AD with Office 365 so all your users will be cloud users, do the migration and then setup up again AD Sync with Azure AD Connect
Highlighted

Thanks for your reply, 

I did not know that disconnecting AD sync, O365 would convert accounts to Cloud account.

it would be really good :) 
however, when I'm going to reconnect the AD sync with my new domain, how will it link to the cloud accounts and accounts of my new AD? just with the email address? the SID is not the unique reference as locally?

Highlighted

After you are finished with the migration, you can prepare the user objects in order to "match" them against the users already existing in O365. You have two options:

 

1) Soft-match, based on the primary SMTP address: http://support.microsoft.com/kb/2641663. This will require you to clear the immutableID first.

2) Hard-match, based on the objectID: http://blogs.technet.com/b/praveenkumar/archive/2014/04/12/how-to-do-hard-match-in-dirsync.aspx

 

Both methods will yield same results, after you re-enable DirSync the accounts should be "linked".

Highlighted

@Alexis MONIOT 

 

Hey Alexis,

we faced a similiar issue. We had one old On-Premise AD which was synced to our AzureAD. They all were in the Domain "example.old". We manually migrated all our users to our new domain "example.com" in the new On-Premise AD. During the migration we changed the usernames (sAMAccountname) to a new schema as well. (side note: The old groups weren't neccessary in the new domain, so we didn't have to migrate the old groups)

 

The problem: example.old\john.doe was already synced with the corresponding user in the AzureAD. So if we would just start the new AD Connect from the new AD (example.com) the synchronization would fail, because AzureAD doesn't allow two "john.doe"s.

 

Our solution: We stopped the sync on the old "example.old" AD before we configured the new AD Connect. We then configured the new AD-Sync like the old one, with the only difference that two ADs are synching into AzureAD and both ADs have unique users. Infact that's not the case, but we wanted to shut down the old AD. Don't worry that users might be deleted, because the new AD won't delete users of the old AD. The only issue might be newly created users.

Before starting the actual synchronization we ran the following script from the new AD. This script replaces the ImmutableIDs of the AzureAD users with the ones from the new On-Premise AD. This ID is used by ADSync to hard-match those entries.

 

Import-Module ActiveDirectory

# get all users from new On-Premise AD that should be synced
$users = Get-ADUser -Filter "*" -SearchBase "OU=Users,DC=example,DC=com"

# Rewrite all ImmutableIDs of these users
foreach($user in $users)
{
   Write-Host "Processing user: " $user.Name $user.ObjectGUID
   C:\tmp\CreateID.ps1 -valuetoconvert $user.ObjectGUID -username $user.Name
}

 

We slightly modified the following script (see source) so the users are edited automatically.

CreateID.ps1 (source: https://gallery.technet.microsoft.com/office/Covert-DirSyncMS-Online-5f3563b1)

 

#------------------------------------------------------------------------------   
#  
# Copyright © 2012 Microsoft Corporation. All rights reserved.  
#  
# This Sample Code is provided for the purpose of illustration only and is not intended to be used in a production environment.  
# THIS SAMPLE CODE AND ANY RELATED INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,  
# INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.  
# We grant You a nonexclusive, royalty-free right to use and modify the Sample Code and to reproduce and distribute the object code  
# form of the Sample Code, provided that You agree: (i) to not use Our name, logo, or trademarks to market Your software product in  
# which the Sample Code is embedded; (ii) to include a valid copyright notice on Your software product in which the Sample Code is  
# embedded; and (iii) to indemnify, hold harmless, and defend Us and Our suppliers from and against any claims or lawsuits,  
# including attorneys’ fees, that arise or result from the use or distribution of the Sample Code.
#  
#------------------------------------------------------------------------------  
#  
# PowerShell Source Code  
#  
# NAME:  
#   GUID2ImmutableID.ps1  
#  
# VERSION:  
#   1.0  
# Author: Steve Halligan
#  
#------------------------------------------------------------------------------  
param(
   [string]$valuetoconvert,
   [string]$username
)

function isGUID ($data) {
   try {
       $guid = [GUID]$data
       return 1
   } catch {
       #$notguid = 1
       return 0
   }
}
function isBase64 ($data) {
   try {
       $decodedII = [system.convert]::frombase64string($data)
       return 1
   } catch {
       return 0
   }
}
function displayhelp  {
   write-host "Please Supply the value you want converted"
   write-host "Examples:"
   write-host "To convert a GUID to an Immutable ID: GUID2ImmutableID.ps1 '748b2d72-706b-42f8-8b25-82fd8733860f'"
   write-host "To convert an ImmutableID to a GUID: GUID2ImmutableID.ps1 'ci2LdGtw+EKLJYL9hzOGDw=='"
   }
   
if ($valuetoconvert -eq $NULL) {
   DisplayHelp
   return
}
if (isGUID($valuetoconvert))
{
   $guid = [GUID]$valuetoconvert
   $bytearray = $guid.tobytearray()
   $immutableID = [system.convert]::ToBase64String($bytearray)
   write-host "ImmutableID"
   write-host "-----------"
   $immutableID
} elseif (isBase64($valuetoconvert)){
   $decodedII = [system.convert]::frombase64string($valuetoconvert)
   if (isGUID($decodedII)) {
       $decode = [GUID]$decodedii
       $decode
   } else {
       Write-Host "Value provided not in GUID or ImmutableID format."
       DisplayHelp
   }
} else {
   Write-Host "Value provided not in GUID or ImmutableID format."
   DisplayHelp
}

# START our modifications:
Import-Module AzureAD
$usernameAzure = "adminuser@example.com"
$passwordAzure = ConvertTo-SecureString "yoursupersecretpassword" -AsPlainText -Force
$credentials = New-Object System.Management.Automation.PSCredential ($usernameAzure, $passwordAzure)
$connect = Connect-AzureAD -Credential $credentials
# This is the important part:
# here we replace the immutableIDs in AzureAD with the ones from the "local" AD
$user = Get-AzureADUser -Filter "DisplayName eq '$username'"
$user | Set-AzureADUser -ImmutableId $immutableID