@@ -1401,7 +1401,7 @@ Function Start-Migration {
1401
1401
Begin {
1402
1402
Write-ToLog - Message:(' ####################################' + (get-date - format " dd-MMM-yyyy HH:mm" ) + ' ####################################' )
1403
1403
# Start script
1404
- $admuVersion = ' 2.4.2 '
1404
+ $admuVersion = ' 2.4.3 '
1405
1405
Write-ToLog - Message:(' Running ADMU: ' + ' v' + $admuVersion )
1406
1406
Write-ToLog - Message:(' Script starting; Log file location: ' + $jcAdmuLogFile )
1407
1407
Write-ToLog - Message:(' Gathering system & profile information' )
@@ -1499,6 +1499,7 @@ Function Start-Migration {
1499
1499
$netBiosName = Get-NetBiosName
1500
1500
$WmiComputerSystem = Get-WmiObject - Class:(' Win32_ComputerSystem' )
1501
1501
$localComputerName = $WmiComputerSystem.Name
1502
+ $systemVersion = Get-ComputerInfo | Select-Object OSName, OSVersion, OsHardwareAbstractionLayer
1502
1503
$windowsDrive = Get-WindowsDrive
1503
1504
$jcAdmuTempPath = " $windowsDrive \Windows\Temp\JCADMU\"
1504
1505
$jcAdmuLogFile = " $windowsDrive \Windows\Temp\jcAdmu.log"
@@ -1704,6 +1705,27 @@ Function Start-Migration {
1704
1705
$admuTracker.copyRegistry.fail = $true
1705
1706
break
1706
1707
}
1708
+
1709
+ # for Windows 10 devices, force refresh of start/ search app:
1710
+ If ($systemVersion.OSName -Match " Windows 10" ) {
1711
+ Write-ToLog - Message:(' Windows 10 System, removing start and search reg keys to force refresh of those apps' )
1712
+ $regKeyClear = @ (
1713
+ " SOFTWARE\Microsoft\Windows\CurrentVersion\StartLayout" ,
1714
+ " SOFTWARE\Microsoft\Windows\CurrentVersion\Start" ,
1715
+ " SOFTWARE\Microsoft\Windows\CurrentVersion\SearchSettings" ,
1716
+ " SOFTWARE\Microsoft\Windows\CurrentVersion\Search"
1717
+ )
1718
+
1719
+ foreach ($key in $regKeyClear ) {
1720
+ if (reg query " HKU\$ ( $NewUserSID ) _admu\$ ( $key ) " ) {
1721
+ write-ToLog - Message:(" removing key: $key " )
1722
+ reg delete " HKU\$ ( $NewUserSID ) _admu\$ ( $key ) " / f
1723
+ } else {
1724
+ write-ToLog - Message:(" key not found $key " )
1725
+ }
1726
+ }
1727
+ }
1728
+
1707
1729
reg copy HKU\$ ($SelectedUserSID )_Classes_admu HKU\$ ($NewUserSID )_Classes_admu / s / f
1708
1730
if ($? ) {
1709
1731
Write-ToLog - Message:(' Copy Profile: ' + " $newUserProfileImagePath /AppData/Local/Microsoft/Windows/UsrClass.dat" + ' To: ' + " $oldUserProfileImagePath /AppData/Local/Microsoft/Windows/UsrClass.dat" )
@@ -1955,14 +1977,19 @@ Function Start-Migration {
1955
1977
New-Item - ItemType Directory - Force - Path $path
1956
1978
}
1957
1979
$appxList = @ ()
1980
+
1981
+ # Get Azure AD Status
1982
+
1958
1983
$ADStatus = dsregcmd.exe / status
1959
1984
foreach ($line in $ADStatus ) {
1960
1985
if ($line -match " AzureADJoined : " ) {
1961
1986
$AzureADStatus = ($line.trimstart (' AzureADJoined : ' ))
1962
1987
}
1963
1988
}
1989
+
1964
1990
Write-ToLog " AzureAD Status: $AzureADStatus "
1965
1991
if ($AzureADStatus -eq ' YES' -or $netBiosName -match ' AzureAD' ) {
1992
+
1966
1993
# Find Appx User Apps by Username
1967
1994
try {
1968
1995
$appxList = Get-AppXpackage - user (Convert-Sid $SelectedUserSID ) | Select-Object InstallLocation
@@ -1971,7 +1998,7 @@ Function Start-Migration {
1971
1998
}
1972
1999
} else {
1973
2000
try {
1974
- $appxList = Get-AppXpackage - user $SelectedUserSID | Select-Object InstallLocation
2001
+ $appxList = Get-AppXpackage - user ( Convert-Sid $SelectedUserSID ) | Select-Object InstallLocation
1975
2002
} catch {
1976
2003
Write-ToLog - Message " Could not determine AppXPackages for selected user, this is okay. Rebuilding UWP Apps from AllUsers list"
1977
2004
}
@@ -2027,12 +2054,6 @@ Function Start-Migration {
2027
2054
# region Leave Domain or AzureAD
2028
2055
2029
2056
if ($LeaveDomain -eq $true ) {
2030
- # Get Azure AD Status
2031
- foreach ($line in $AzureADInfo ) {
2032
- if ($line -match " AzureADJoined : " ) {
2033
- $AzureADStatus = ($line.trimstart (' AzureADJoined : ' ))
2034
- }
2035
- }
2036
2057
if ($AzureADStatus -match ' YES' ) {
2037
2058
# Check if user is not NTAUTHORITY\SYSTEM
2038
2059
if (([bool ](([System.Security.Principal.WindowsIdentity ]::GetCurrent()).user.Value -match " S-1-5-18" )) -eq $false ) {
0 commit comments