<!-- WP QUADS Content Ad Plugin v. 2.0.93 -->
<div class="quads-location quads-ad2529 " id="quads-ad2529" style="float:none;margin:0px 3px 3px 3px;padding:0px 0px 0px 0px;" data-lazydelay="0">

</div>

<h2 class="wp-block-heading">Matching Users after migrating to new Active Directory Forest</h2>



<p>Installing ADConnect in a new forest for the same users which have been migrated to a new Active Directory forest</p>
<!-- WP QUADS Content Ad Plugin v. 2.0.93 -->
<div class="quads-location quads-ad2526 " id="quads-ad2526" style="float:none;margin:0px 3px 3px 3px;padding:0px 0px 0px 0px;" data-lazydelay="0">

</div>

<!-- WP QUADS Content Ad Plugin v. 2.0.93 -->
<div class="quads-location quads-ad2531 " id="quads-ad2531" style="float:none;margin:0px 3px 3px 3px;padding:0px 0px 0px 0px;" data-lazydelay="0">

</div>

<!-- WP QUADS Content Ad Plugin v. 2.0.93 -->
<div class="quads-location quads-ad2527 " id="quads-ad2527" style="float:none;margin:0px 3px 3px 3px;padding:0px 0px 0px 0px;" data-lazydelay="0">

</div>




<p>In order to do so you will have to launch Azure powershell in admin mode and connect to MSOL service as in the following snapshot</p>



<p>$cred = get-credential<br>After connecting then type/copy the following ;<br>Get-MsolUser -ReturnDeletedUsers -All | Out-GridView</p>



<figure class="wp-block-image"><img src="http://lh6.ggpht.com/-bTsYbCoyBDE/VSe6tby9vwI/AAAAAAAAORQ/7oMFwn6XVWs/clip_image001%25255B5%25255D_thumb.png?imgmax=800" alt="clip_image001[5]"/> 

<!-- WP QUADS Content Ad Plugin v. 2.0.93 -->
<div class="quads-location quads-ad2530 " id="quads-ad2530" style="float:none;margin:0px 3px 3px 3px;padding:0px 0px 0px 0px;" data-lazydelay="0">

</div>
 
</figure>



<p>Once you type enter a GUI will come up showing you all the deleted users list, you should delete any old non-usable account that has similar attributes to the ones that you&#8217;re about to Sync from the AD to O365. ;</p>



<figure class="wp-block-image"><img src="http://lh4.ggpht.com/-Tc_IjdCkie4/VSe6vTh70nI/AAAAAAAAORg/DaVeYIKS1F4/clip_image002%25255B4%25255D_thumb.png?imgmax=800" alt="clip_image002[4]"/></figure>



<p>Once you&#8217;re sure about what do you want to delete you can go ahead with the following Command to delete the users</p>



<p><strong>Note:</strong><br>You must be sure that when you run this command, you will no longer be able to restore any deleted item or object later on.</p>



<p>Get-MsolUser -ReturnDeletedUsers -All | Remove-MsolUser -RemoveFromRecycleBin -Force –Verbose</p>
<!-- WP QUADS Content Ad Plugin v. 2.0.93 -->
<div class="quads-location quads-ad2522 " id="quads-ad2522" style="float:none;margin:0px 3px 3px 3px;padding:0px 0px 0px 0px;" data-lazydelay="0">

</div>




<figure class="wp-block-image"><img src="http://lh4.ggpht.com/-5paj8WsOWZs/VSe6xkWuhKI/AAAAAAAAORw/ZkFYGWVxNeM/clip_image003%25255B4%25255D_thumb.png?imgmax=800" alt="clip_image003[4]"/></figure>



<p>Now you should run the following Script on the same open power shell in order to start the copying process. </p>



<p>Import-Module Msonline<br>Import-Module ActiveDirectory<br>$cred = Get-Credential<br>Connect-MsolService -Credential $cred<br>$onlineusers = Get-MsolUser -All<br>$adusers = Get-ADUser -Filter *</p>



<p>Press enter and when you want you get prompted to select an option choose 1 and enter</p>



<figure class="wp-block-image"><img src="http://lh4.ggpht.com/-dn2f9cdUKEo/VSe60bcnjYI/AAAAAAAAOSA/du-W37Jv-jM/clip_image004%25255B4%25255D_thumb.png?imgmax=800" alt="clip_image004[4]"/></figure>



<p>Note:If you would like to ;receive ;the powershell script please don&#8217;t hesitate to contact me. ;</p>



<p>After the copy is finished you can match for yourself the list of ImmutableID along with the GUID ;<br>Ldifde -f dump.txt</p>
<!-- WP QUADS Content Ad Plugin v. 2.0.93 -->
<div class="quads-location quads-ad2523 " id="quads-ad2523" style="float:none;margin:0px 3px 3px 3px;padding:0px 0px 0px 0px;" data-lazydelay="0">

</div>




<p>Dump.txt</p>



<figure class="wp-block-image"><img src="http://lh6.ggpht.com/-pnvgRPt6_n4/VSe62yUPVgI/AAAAAAAAOSQ/P5WUuU98X90/clip_image005%25255B4%25255D_thumb.jpg?imgmax=800" alt="clip_image005[4]"/></figure>



<figure class="wp-block-image"><img src="http://lh5.ggpht.com/-lg6fVFgFc8o/VSe65oCP2kI/AAAAAAAAOSg/8ouI0xFaxPY/clip_image006%25255B4%25255D_thumb.jpg?imgmax=800" alt="clip_image006[4]"/></figure>



<p></p>
</p>
<!-- WP QUADS Content Ad Plugin v. 2.0.93 -->
<div class="quads-location quads-ad2528 " id="quads-ad2528" style="float:none;margin:0px 3px 3px 3px;padding:0px 0px 0px 0px;" data-lazydelay="0">

</div>


Reset and manage your Active Directory users' Passwords Active Directory is one of the most…
Finding Exchange Database hidden mailboxes. Story:Maybe you have been in this situation before, trying to…
If you're using a Proxy server in your firewall or in your network and have…
Story:I got some clients that have reported some of their users being locked out and…
Delegate Permissions This is a code that I have wrote recently to check if an…
Story: I got a request from a client who constantly gets CVs and have to…