Code.ps1
$dsregStatus = & dsregcmd /status
$isAzureADJoined = $dsregStatus -match "AzureAdJoined\s*:\s*YES"
$AzureAD = if ($isAzureADJoined) { "TRUE" } else { "FALSE" }
Lab Core | The Lab of MrNetTek
A blog about IT, technical solutions, and code.