install gMSA account on a server but do not want to Install-WindowsFeature AD-DOMAIN-SERVICES

zhiqing zhou 76 Reputation points
2022-02-02T20:46:06.863+00:00

I like to change my SQL service account to gMSA, in order to do that I need install the gMSA account on the server.
However, to run Install-ADServiceAccount, I need run Install-WindowsFeature AD-DOMAIN-SERVICES. this will add AD features, and after install the server keeps reminding me to promote to DC, this is annoying and I have to remove the AD features after.

I am asking if it is possible to install the AD service account remotely? so that I don't have to install AD-Domain services on each sql server where I change to gMSA.

PS C:\SQL> Install-ADServiceAccount serviceaccountgmsa
Install-ADServiceAccount : The term 'Install-ADServiceAccount' is not recognized as the name of a cmdlet, function,
script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is
correct and try again.
At line:1 char:1

  • Install-ADServiceAccount servicegmsa
  • ~~~~~~~~~~~~~~~~~~~~~~~~
  • CategoryInfo : ObjectNotFound: (Install-ADServiceAccount:String) [], CommandNotFoundException
  • FullyQualifiedErrorId : CommandNotFoundException
Windows for business | Windows Client for IT Pros | Directory services | Active Directory
Windows for business | Windows Server | User experience | PowerShell
0 comments No comments
{count} vote

Accepted answer
  1. Anonymous
    2022-02-04T15:12:00.343+00:00

    Ok, gotcha now. In your case, you may need to install the AD module.
    https://learn.microsoft.com/en-us/previous-versions/technet-magazine/gg413289(v=msdn.10)?redirectedfrom=MSDN
    https://devblogs.microsoft.com/scripting/active-directory-week-get-started-with-active-directory-powershell/

    --please don't forget to upvote and Accept as answer if the reply is helpful--

    1 person found this answer helpful.

3 additional answers

Sort by: Most helpful
  1. Esmaeil Yazdani 25 Reputation points
    2023-12-14T17:40:22.7133333+00:00

    Hi. Before running the "Install-ADServiceAccount servicegmsa" command, you should install RSAT tools for Active Directory Powershell. Run the following command:

    Install-WindowsFeature RSAT-AD-PowerShell

    After a few seconds, RSAT tools will install on your server. Then you can install and test SQL service account with the following commands:

    Install-ADServiceAccount servicegmsa

    Test-ADServiceAccount servicegmsa

    3 people found this answer helpful.

  2. Esmaeil Yazdani 25 Reputation points
    2024-10-10T10:15:48.11+00:00

    Also you can use the guides provided in the following website to create gmsa account graphically:

    http://www.cjwdev.com/Software/MSAGUI/Info.html

    1 person found this answer helpful.
    0 comments No comments

  3. Anonymous
    2022-02-03T02:22:20.113+00:00

    Read on here.
    https://learn.microsoft.com/en-us/sql/database-engine/configure-windows/configure-windows-service-accounts-and-permissions?view=sql-server-ver15#MSA

    You can provision the gMSA in your existing active directory environment then it will be available to use on your domain joined SQL server.
    https://learn.microsoft.com/en-us/windows-server/security/group-managed-service-accounts/getting-started-with-group-managed-service-accounts#BKMK_Step1

    --please don't forget to upvote and Accept as answer if the reply is helpful--


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.