---
title: Migrate Traditional Service Account to gMSA for Nodinite v7
description: Migrate from a traditional service account to gMSA in Nodinite v7. Move certificates from CurrentUser to LocalMachine, grant private key permissions, update identities, and verify encryption.
---

# <i class="fal fa-right-left" aria-hidden="true"></i> Migrate Traditional Service Account to gMSA

Use this guide when you already run <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> with a traditional service account and want to switch to gMSA without losing encrypted configuration access.

<aside aria-label="Tip" class="nodinite-note nodinite-note--tip">
<p class="nodinite-note__label" aria-hidden="true"><i class="far fa-fw fa-lightbulb"></i> Tip</p>
<div class="nodinite-note__content"><p>The best time to switch to gMSA is during the <a href="https://docs.nodinite.com/install-and-update/getting-started/version-6/updating-from-v6-to-v7/">v6 to v7 migration</a>: select the gMSA when you register the environment, and the migration applies it from the start. On an existing v7 installation, changing the account means you apply all secrets and passwords again (<a href="#step-4-update-service-identities-to-gmsa">Step 4</a>).</p></div>
</aside>

## <i class="fal fa-diagram-project" aria-hidden="true"></i> Understanding Certificate Store Migration

Traditional service accounts and gMSA accounts use different certificate store contexts. With a traditional account, <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> auto-generates the [secret-encryption certificate][Secret Management] in the account's personal (`CurrentUser\My`) store; a gMSA has no user profile and reads the certificate from `LocalMachine\My`. You must move the certificate before you switch identities, or the services can't decrypt the existing secrets.

<div class="mermaid">
flowchart TB
    OLD["fa:fa-user Traditional Service Account"] --> CUR["fa:fa-certificate CurrentUser My store"]
    CUR --> EXP["fa:fa-file-export Export PFX"]
    EXP --> IMP["fa:fa-file-import Import PFX"]
    IMP --> LM["fa:fa-certificate LocalMachine My store"]
    LM --> ACL["fa:fa-key Grant Private Key Read"]
    ACL --> GMSA["fa:fa-user-shield gMSA Identity"]
    GMSA --> IIS["fa:fa-globe IIS Application Pools"]
    GMSA --> SVC["fa:fa-gear Windows Services"]
    style OLD fill:#2678BD,color:#fff
    style CUR fill:#FFD525
    style LM fill:#FFD525
    style GMSA fill:#93d16d
    style ACL fill:#93d16d
</div>

*Diagram: the certificate moves from the old account's `CurrentUser\My` store to `LocalMachine\My` (yellow), the [gMSA][gMSA Accounts] gets Read access to the private key (green), and the [IIS][] application pools and Windows Service agents then run as the gMSA. Scripts for each step: [Install Certificates for gMSA][].*

## <i class="fal fa-list-check" aria-hidden="true"></i> Migration Workflow

1. Export certificates from the old account's `Cert:\CurrentUser\My` store.
2. Import certificates into `Cert:\LocalMachine\My`.
3. Grant the gMSA account read access to certificate private keys.
4. Update <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> service identities to use gMSA.
5. Verify IIS application pools, Windows Services, and encrypted configuration access.

## Step 1: Export Certificates from CurrentUser Store

Run PowerShell as the old service account:

```powershell
Get-ChildItem Cert:\CurrentUser\My |
  Where-Object { $_.Subject -like "*Nodinite*" -or $_.FriendlyName -like "*Nodinite*" } |
  Format-List Subject, Thumbprint, NotAfter, FriendlyName

$certThumbprint = "1234567890ABCDEF1234567890ABCDEF12345678"
$cert = Get-ChildItem Cert:\CurrentUser\My\$certThumbprint

if ($null -eq $cert) {
    Write-Error "Certificate not found in CurrentUser store"
    exit
}

$pfxPassword = Read-Host "Enter a PFX password" -AsSecureString
$pfxPath = "C:\Temp\NodiniteCert_$certThumbprint.pfx"
Export-PfxCertificate -Cert $cert -FilePath $pfxPath -Password $pfxPassword
```

## Step 2: Import Certificates into LocalMachine Store

Run PowerShell as Administrator:

```powershell
$pfxPath = "C:\Temp\NodiniteCert_1234567890ABCDEF1234567890ABCDEF12345678.pfx"
$pfxPassword = Read-Host "Enter the PFX password" -AsSecureString

$cert = Import-PfxCertificate -FilePath $pfxPath -CertStoreLocation Cert:\LocalMachine\My -Password $pfxPassword -Exportable

Write-Host "Imported: $($cert.Thumbprint)" -ForegroundColor Green
Remove-Item $pfxPath -Force
```

## Step 3: Grant gMSA Private Key Permissions

Run PowerShell as Administrator:

```powershell
$gmsaAccount = "CONTOSO\NodiniteProdSvc$"
$certThumbprint = "1234567890ABCDEF1234567890ABCDEF12345678"

$cert = Get-ChildItem Cert:\LocalMachine\My\$certThumbprint
if ($null -eq $cert) {
    Write-Error "Certificate not found in LocalMachine store"
    exit
}

$privateKey = [System.Security.Cryptography.X509Certificates.RSACertificateExtensions]::GetRSAPrivateKey($cert)
if ($privateKey -is [System.Security.Cryptography.RSACng]) {
    # CNG keys -> ProgramData\Microsoft\Crypto\Keys
    $privateKeyFile = Join-Path $env:ProgramData "Microsoft\Crypto\Keys\$($privateKey.Key.UniqueName)"
} else {
    # CSP keys -> ProgramData\Microsoft\Crypto\RSA\MachineKeys
    $privateKeyFile = Join-Path $env:ProgramData "Microsoft\Crypto\RSA\MachineKeys\$($privateKey.CspKeyContainerInfo.UniqueKeyContainerName)"
}

$acl = Get-Acl -Path $privateKeyFile
$rule = New-Object System.Security.AccessControl.FileSystemAccessRule($gmsaAccount, "Read", "Allow")
$acl.SetAccessRule($rule)
Set-Acl -Path $privateKeyFile -AclObject $acl
```

For detailed certificate ACL guidance and the scripts that grant it, see [Install Certificates for gMSA][].

## Step 4: Update Service Identities to gMSA

Use the [Nodinite Portal](https://portal.nodinite.com)<sup><i class="fal fa-arrow-up-right-from-square" aria-hidden="true"></i></sup>:

1. In the Environment, open [Step 2: Auth][Step 2 Service Account Defaults] and set **Service Account Defaults** to the gMSA: Domain mode, the domain, and the account name with the trailing `$` (`gMSAName$`).  
2. If a [Core Service][Core Services] uses its own account, update it in [Step 4: Servers][Step 4 Core platform services]; turn on **Use gMSA** for the agents in [Step 5: Agents][Step 5 Agents].  
3. Review and download the new package in [Step 6: Review and Download][Step 6].  
4. Run the update with the [CLI in elevated PowerShell 7][Step 7] from the new package. You don't need to uninstall first.  
5. Apply the secrets and passwords again. Changing the service account on v7 means every secret and password must be applied again, for example in the agents' [Remote Configuration][].  

Agents installed with an MSI as Windows Services get the gMSA in the **Services** console; see [Configure Group Managed Service Accounts (gMSA)][gMSA Accounts].

## Step 5: Verify Migration

```powershell
$certThumbprint = "1234567890ABCDEF1234567890ABCDEF12345678"
Get-ChildItem Cert:\LocalMachine\My\$certThumbprint | Format-List Subject, Thumbprint, HasPrivateKey, NotAfter

Import-Module WebAdministration
Get-ChildItem IIS:\AppPools |
  Where-Object { $_.Name -like "Nodinite*" } |
  Select-Object Name, State, @{n="Identity";e={$_.ProcessModel.UserName}}
```

Then verify [Web Client][] login, [Monitor Views][], [Log Views][], and that the services can still decrypt their secrets.

## <i class="fal fa-hand-point-right" aria-hidden="true"></i> Next Steps

* <i class="fal fa-wrench" aria-hidden="true"></i> [FAQ - gMSA Troubleshooting][]  
* <i class="fal fa-certificate" aria-hidden="true"></i> [Install Certificates for gMSA][]  
* <i class="fal fa-key" aria-hidden="true"></i> [Secret Management][]  

## <i class="fal fa-link-horizontal" aria-hidden="true"></i> Related Topics

* <i class="fal fa-user-shield" aria-hidden="true"></i> [Configure Group Managed Service Accounts (gMSA)][gMSA Accounts]  
* <i class="fal fa-user-plus" aria-hidden="true"></i> [How to set Logon as a Service right][LogonAsAService]  
* <i class="fal fa-arrows-rotate" aria-hidden="true"></i> [Update Nodinite v7][Updating Nodinite v7]  
* <i class="fal fa-arrow-turn-up" aria-hidden="true"></i> [Windows Server Troubleshooting][Windows Overview]  
* <i class="fal fa-triangle-exclamation" aria-hidden="true"></i> [Troubleshooting][]  

[Core Services]:https://docs.nodinite.com/core-services/overview/
[FAQ - gMSA Troubleshooting]:https://docs.nodinite.com/install-and-update/troubleshooting/windows/gmsa/faq-gmsa-troubleshooting/
[gMSA Accounts]:https://docs.nodinite.com/install-and-update/troubleshooting/windows/gmsa-accounts/
[IIS]:https://docs.nodinite.com/logging-and-monitoring/windows-server/features/iis/
[Install Certificates for gMSA]:https://docs.nodinite.com/install-and-update/troubleshooting/windows/install-certificates-for-gmsa/
[Log Views]:https://docs.nodinite.com/administration/log-management/log-views/features/what-is-a-log-view/
[LogonAsAService]:https://docs.nodinite.com/install-and-update/troubleshooting/windows/logon-as-a-service-right/
[Monitor Views]:https://docs.nodinite.com/administration/monitor-management/monitor-views/features/what-is-a-monitor-view/
[Remote Configuration]:https://docs.nodinite.com/administration/monitor-management/monitor-agents/features/how-do-i-configure-a-monitor-agent/
[Secret Management]:https://docs.nodinite.com/install-and-update/troubleshooting/secret-managment/
[Step 2 Service Account Defaults]:https://docs.nodinite.com/install-and-update/getting-started/version-7/install-nodinite-v7-steps/02-auth/#service-account-defaults
[Step 4 Core platform services]:https://docs.nodinite.com/install-and-update/getting-started/version-7/install-nodinite-v7-steps/04-servers/#core-platform-services
[Step 5 Agents]:https://docs.nodinite.com/install-and-update/getting-started/version-7/install-nodinite-v7-steps/05-agents/#net-10-agents-with-gmsa-support
[Step 6]:https://docs.nodinite.com/install-and-update/getting-started/version-7/install-nodinite-v7-steps/06-review-and-download/
[Step 7]:https://docs.nodinite.com/install-and-update/getting-started/version-7/install-nodinite-v7-steps/07-install-the-generated-package/
[Troubleshooting]:https://docs.nodinite.com/install-and-update/troubleshooting/overview/
[Updating from v6 to v7]:https://docs.nodinite.com/install-and-update/getting-started/version-6/updating-from-v6-to-v7/
[Updating Nodinite v7]:https://docs.nodinite.com/install-and-update/getting-started/version-7/updating-nodinite-v7/
[Web Client]:https://docs.nodinite.com/core-services/web-client/overview/
[Windows Overview]:https://docs.nodinite.com/install-and-update/troubleshooting/windows/overview/