Quantcast
Channel: Microsoft Dynamics 365 Community
Viewing all articles
Browse latest Browse all 64797

Fix NAV2015 Administration Shell after NAV 2016 installation

$
0
0

You should read Arend-Jan’s blogpost first.

He explains that after you install NAV2016 on a machine that already had NAV2015 on it, that it breaks the NAV2015 Administration console. Arend-Jan also provide a fix for this! A really easy one even.

But he was also talking about “if you’re not a PowerShell guru” .. And such. Now, I’m not a guru, but I sure like to “fix” things purely in PowerShell. So – since I needed the fix myself – and since I’ll probably have to apply this fix a numerous times – I was wondering whether I could come up with a simple “run with PowerShell” fix for this issue.

And I believe I have a second solution, which is going to execute all the steps that Arend-Jan already described .. but all within PowerShell. Just copy/paste the script below in a PowerShell ISE, execute it, and you should be good to go. On top of that, you might be able to include this script in any provisioning-script that you might already have .. . Don’t know – it’s up to you and the script is “as is” ;-).

Thanks Arend-Jan for sorting this out ;-).

$BaseReg90 = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey('LocalMachine', [net.dns]::GetHostName())
$RegKey90  = $BaseReg90.OpenSubKey('SOFTWARE\Microsoft\MMC\SnapIns\FX:{BA484C42-ED9A-4bc1-925F-23E64E686FCE}')

$BaseReg80 = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey('LocalMachine', [net.dns]::GetHostName())
$RegKey80 = $basereg80.CreateSubKey('SOFTWARE\Microsoft\MMC\SnapIns\FX:{BA484C41-ED9A-4bc1-925F-23E64E686FCE}')

foreach($RegKeyValue90 in $RegKey90.GetValueNames()){  
    $value80 = $RegKey90.GetValue($RegKeyValue90)

    if ($value80 -match '\\90\\'){
        $value80 = $value80 -replace '\\90\\','\80\'
    }
    if ($value80 -match 'ManagementUI, Version=9.0.0.0'){
        $value80 = $value80 -replace 'ManagementUI, Version=9.0.0.0','ManagementUI, Version=8.0.0.0'
    }
    if ($value80 -match 'BA484C42-ED9A-4bc1-925F-23E64E686FCE'){
        $value80 = $value80 -replace 'BA484C42-ED9A-4bc1-925F-23E64E686FCE','BA484C41-ED9A-4bc1-925F-23E64E686FCE'
    }

    $regkey80.SetValue($RegKeyValue90, $value80)
}

foreach($RegKeySubKey90 in $RegKey90.GetSubKeyNames()){
    write-host $RegKeySubKey90

    $RegKey80.CreateSubKey($RegKeySubKey90)
}

$msc80file = "${env:ProgramFiles(x86)}\Microsoft Dynamics NAV\80\RoleTailored Client\Microsoft Dynamics NAV Server.msc"
(get-content $msc80file).Replace('ba484c42-ed9a-4bc1-925f-23e64e686fce','ba484c41-ed9a-4bc1-925f-23e64e686fce') | Set-Content $msc80file

 


Viewing all articles
Browse latest Browse all 64797

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>