This was quick and dirty / probably needs some more work I'll add it to GitHub later.
Import-Module ActiveDirectory
if ((Get-ADOptionalFeature -Identity 'Recycle Bin Feature').EnabledScopes)
{
Write-Host "AD Recycle Bin Enabled"
}
else
{
try
{
$domain = Get-WmiObject...
The process of hard linking AD objects to AAD objects for when you get errors during an AD Sync.
On the domain controller run:
Get-ADUser username | Select-Object UserPrincipalName, objectGUID, @{Name = 'ImmutableID'; Expression = {...