File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
jumpcloud-ADMU/Powershell Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -1977,6 +1977,13 @@ Function Start-Migration {
1977
1977
New-Item - ItemType Directory - Force - Path $path
1978
1978
}
1979
1979
$appxList = @ ()
1980
+ # Get Azure AD Status
1981
+ $ADStatus = dsregcmd.exe / status
1982
+ foreach ($line in $ADStatus ) {
1983
+ if ($line -match " AzureADJoined : " ) {
1984
+ $AzureADStatus = ($line.trimstart (' AzureADJoined : ' ))
1985
+ }
1986
+ }
1980
1987
if ($AzureADProfile -eq $true -or $netBiosName -match ' AzureAD' ) {
1981
1988
# Find Appx User Apps by Username
1982
1989
try {
@@ -2042,12 +2049,6 @@ Function Start-Migration {
2042
2049
# region Leave Domain or AzureAD
2043
2050
2044
2051
if ($LeaveDomain -eq $true ) {
2045
- # Get Azure AD Status
2046
- foreach ($line in $AzureADInfo ) {
2047
- if ($line -match " AzureADJoined : " ) {
2048
- $AzureADStatus = ($line.trimstart (' AzureADJoined : ' ))
2049
- }
2050
- }
2051
2052
if ($AzureADStatus -match ' YES' ) {
2052
2053
# Check if user is not NTAUTHORITY\SYSTEM
2053
2054
if (([bool ](([System.Security.Principal.WindowsIdentity ]::GetCurrent()).user.Value -match " S-1-5-18" )) -eq $false ) {
You can’t perform that action at this time.
0 commit comments