Home
%3CLINGO-SUB%20id%3D%22lingo-sub-1029309%22%20slang%3D%22en-US%22%3EThe%20RC4%20Removal%20Files%20Part%201%3A%20What's%20in%20an%20error%20message%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1029309%22%20slang%3D%22en-US%22%3E%3CP%3E%3C%2FP%3E%0A%3CDIV%20id%3D%22page%22%3E%3CTIME%3E%3C%2FTIME%3E%3CHR%20%2F%3E%0A%3CDIV%20id%3D%22content%22%3E%0A%3CDIV%20id%3D%22content%22%3EI've%20been%20doing%20system%20administration%20since%20roughly%201994%20and%20in%20that%20time%20I've%20come%20to%20realize%20one%20thing%3A%26nbsp%3B%20making%20changes%20to%20established%20environments%20always%20causes%20a%20ripple%20effect.%26nbsp%3B%20The%20impact%20of%20changes%20usually%20doesn't%20surface%20right%20away%2C%20so%20associating%20the%20exact%20change%20to%20the%20problems%20that%20crop%20up%20down%20the%20road%20can%20be%26nbsp%3B%20very%20difficult.%3C%2FDIV%3E%0A%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CDIV%3ERecently%20my%20Microsoft%20colleague%20Bill%20Almonroeder%20and%20I%20were%20helping%20our%20customer%20implement%20a%20Group%20Managed%20Service%20Account%20(gMSA)%20to%20increase%20security%20and%20lower%20the%20administrative%20overhead%20on%20our%20service%20accounts.%26nbsp%3B%20We%20were%20methodical%20in%20the%20steps%20to%20properly%20create%20the%20account%20and%20waited%20a%20full%20weekend%20between%20the%20time%20that%20we%20created%20the%20account%20in%20active%20directory.%20Sounds%20good%20so%20far%2C%20right%3F%26nbsp%3B%20In%20complex%20compute%20environments%20where%20there%20are%20many%20moving%20parts%2C%20things%20rarely%20go%20as%20planned%2C%20and%20this%20day%20was%20no%20exception.%20When%20we%20attempted%20to%20perform%20the%20installation%20of%20the%20gMSA%20on%20Windows%20Server%2C%20we%20received%20the%20error%20message%3A%3C%2FDIV%3E%0A%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CDIV%3E%0A%3CPRE%3EInstall-ADServiceAccount%20%3A%20Cannot%20Install%20service%20account.%20Error%20Message%3A%20%20'The%20provided%20context%20did%20not%20match%20the%20target'%3C%2FPRE%3E%0A%3C%2FDIV%3E%0A%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CDIV%3EHmmm..%22The%20provided%20context%20did%20not%20match%20the%20target%22...not%20exactly%20overflowing%20with%20relevant%20information.%20The%20%3CEM%3E%3CSTRONG%3ETest-ADServiceAccount%3C%2FSTRONG%3E%20%3C%2FEM%3Ecmdlet%20gave%20us%20a%20little%20more%20to%20go%20on%3A%3C%2FDIV%3E%0A%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CDIV%3E%3CSTRONG%3E%3CEM%3EWARNING%3A%20Test%20failed%20for%20Managed%20Service%20Account%20SQLServerGMSA.%20If%20standalone%20Managed%20Service%20Account%2C%20the%20account%20is%20linked%20to%20another%20computer%20object%20in%20the%20Active%20Directory.%20If%20group%20Managed%20Service%20Account%2C%20either%20this%20computer%20does%20not%20have%20permission%20to%20use%20the%20group%20MSA%20or%20this%20computer%20does%20not%20support%20all%20the%20Kerberos%20encryption%20types%20required%20for%20the%20gMSA.%20See%20the%20MSA%20operational%20log%20for%20more%20information.%3C%2FEM%3E%3C%2FSTRONG%3E%3C%2FDIV%3E%0A%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CDIV%3EWe%20verified%20that%20the%20account%20had%20been%20created%20properly%20and%20did%20not%20suffer%20from%20the%20%22linked%20to%20another%20computer%20object%22%20condition%20mentioned%20first%20in%20the%20message.%26nbsp%3B%20This%20would%20be%20applicable%20on%20a%20Managed%20Service%20Account%20(MSA)%20scenario%20since%20that%20type%20of%20account%20can%20only%20be%20used%20with%20a%20single%20computer.%20Our%20account%20was%20created%20as%20a%20gMSA%2C%20and%20we%20validated%20that%20the%20group%20that%20had%20been%20associated%20with%20the%20GMSA%20was%20properly%20configured%20and%20contained%20both%20servers%20on%20which%20we%20intended%20to%20use%20the%20gMSA.%20Permissions%20were%20verified%2C%20all%20is%20well.%3C%2FDIV%3E%0A%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CDIV%3EThe%20error%20also%20mentions%20Kerberos%20encryption%2C%20but%20we're%20not%20experiencing%20any%20other%20Kerberos-related%20issues.%20Time%20to%20look%20at%20the%20event%20logs.%20A%20quick%20look%20at%20the%20Security-Netlogon%20event%20log%20yielded%20a%20couple%20of%20clues%3A%3C%2FDIV%3E%0A%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CDIV%3EThere%20were%20event%20IDs%209001%20and%209002%20being%20logged%20when%20we%20attempt%20to%20test%20and%20install%20the%20GMSA.%20The%209002%20event%20doesn't%20provide%20much%20more%20information%20than%20the%20%3CSTRONG%3E%3CI%3E%22provided%20context%20did%20not%20match%20the%20target%22%20%3C%2FI%3E%3C%2FSTRONG%3Emessage.%3C%2FDIV%3E%0A%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CDIV%3ELet's%20look%20at%20the%209001%3A%20%3CEM%3E%3CSTRONG%3EThe%20account%20SQLServergMSA%20cannot%20be%20used%20as%20a%20managed%20service%20account%20on%20the%20local%20machine%20because%20not%20all%20of%20the%20supported%20encryption%20types%20are%20supported%20by%20the%20local%20machine.%3C%2FSTRONG%3E%3C%2FEM%3E%3C%2FDIV%3E%0A%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CDIV%3EThis%20event%20is%20at%20least%20pointing%20us%20back%20at%20the%20encryption%20types%2C%20which%20is%20also%20mentioned%20at%20the%20tail%20end%20of%20the%20%3CEM%3E%3CSTRONG%3ETest-ADServiceAccount%3C%2FSTRONG%3E%3C%2FEM%3E%20output.%20What%20gives%3F%3C%2FDIV%3E%0A%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CDIV%3EAfter%20dredging%20through%20the%20documentation%20for%20gMSAs%2C%20I%20ran%20across%20the%20answer%20to%20our%20issue%20at%3A%20%3CA%20href%3D%22https%3A%2F%2Ftechnet.microsoft.com%2Fen-us%2Flibrary%2Fhh831782.aspx%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Ftechnet.microsoft.com%2Fen-us%2Flibrary%2Fhh831782.aspx%3C%2FA%3E%20%3A%3C%2FDIV%3E%0A%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CDIV%3E%22A%20managed%20service%20account%20is%20dependent%20upon%20Kerberos%20supported%20encryption%20types.%20When%20a%20client%20computer%20authenticates%20to%20a%20server%20using%20Kerberos%20the%20DC%20creates%20a%20Kerberos%20service%20ticket%20protected%20with%20encryption%20both%20the%20DC%20and%20server%20supports.%20The%20DC%20uses%20the%20account's%20msDS-SupportedEncryptionTypes%20attribute%20to%20determine%20what%20encryption%20the%20server%20supports%20and%2C%20if%20there%20is%20no%20attribute%2C%20it%20assumes%20the%20client%20computer%20does%20not%20support%20stronger%20encryption%20types.%20%3CSTRONG%3E%3CEM%3E%3CU%3EIf%20the%20Windows%20Server%202012%20host%20is%20configured%20to%20not%20support%20RC4%20then%20authentication%20will%20always%20fail.%20For%20this%20reason%2C%20AES%20should%20always%20be%20explicitly%20configured%20for%20MSAs%3C%2FU%3E%22%3C%2FEM%3E%3C%2FSTRONG%3E%3C%2FDIV%3E%0A%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CDIV%3EAha...now%20it%20makes%20sense!%26nbsp%3B%20We%20had%20recently%20decided%20to%20remove%20the%20RC4%20encryption%20algorithm%20in%20Kerberos%20to%20tighten%20security%20and%2C%20until%20now%2C%20had%20not%20run%20into%20an%20issue.%26nbsp%3B%20%3C%2FDIV%3E%0A%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CDIV%3ENow%20we're%20making%20progress!%26nbsp%3B%20We'll%20heed%20the%20advice%20of%20the%20documentation%20and%20specify%20the%20encryption%20types%20for%20the%20gMSA%20using%20the%20command%20below%3A%3C%2FDIV%3E%0A%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CDIV%3E%0A%3CPRE%3ESet-ADServiceAccount%20-Identity%20SQLServerGMSA%20-KerberosEncryptionType%20AES128%2CAES256%3C%2FPRE%3E%0A%3C%2FDIV%3E%0A%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CDIV%3ETo%20verify%2C%20we%20can%20look%20at%20the%20GMSAs%20attributes%20in%20Active%20Directory%20Users%20and%20Computers%2C%20specifically%2C%20the%20%3CEM%3E%3CSTRONG%3EmsDS-SupportedEcryptionTypes%3C%2FSTRONG%3E%3C%2FEM%3E%20attribute%20to%20verify%20that%20it%20does%20not%20contain%20RC4.%3C%2FDIV%3E%0A%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CDIV%3ENow%20that%20the%20problem%20has%20been%20resolved%2C%20the%20%3CEM%3E%3CSTRONG%3EInstall-ADServiceAccount%3C%2FSTRONG%3E%3C%2FEM%3E%20cmdlet%20works%20with%20no%20errors%2C%20hopefully%20no%20news%20is%20good%20news.%3C%2FDIV%3E%0A%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CDIV%3EIf%20we%20run%20the%20%3CEM%3E%3CSTRONG%3ETest-ADServiceAccount%3C%2FSTRONG%3E%3C%2FEM%3E%20cmdlet%2C%20note%20that%20it%20returns%20%22True%22%20now.%20That%20looks%20much%20better!%20Our%20gMSA%20is%20finally%20ready%20for%20use.%20%26nbsp%3B%3C%2FDIV%3E%0A%3C%2FDIV%3E%0A%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-1029309%22%20slang%3D%22en-US%22%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWhen%20installing%20a%20gMSA%2C%20you%20may%20receive%20an%20error%20%22Cannot%20Install%20service%20account.%20Error%20Message%3A%20'The%20provided%20context%20did%20not%20match%20the%20target'%22.%20This%20blog%20will%20help%20with%20one%20common%20solution%20to%20this%20problem.%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1029309%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EJoelVIckery%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Microsoft


I've been doing system administration since roughly 1994 and in that time I've come to realize one thing:  making changes to established environments always causes a ripple effect.  The impact of changes usually doesn't surface right away, so associating the exact change to the problems that crop up down the road can be  very difficult.
 
Recently my Microsoft colleague Bill Almonroeder and I were helping our customer implement a Group Managed Service Account (gMSA) to increase security and lower the administrative overhead on our service accounts.  We were methodical in the steps to properly create the account and waited a full weekend between the time that we created the account in active directory. Sounds good so far, right?  In complex compute environments where there are many moving parts, things rarely go as planned, and this day was no exception. When we attempted to perform the installation of the gMSA on Windows Server, we received the error message:
 
Install-ADServiceAccount : Cannot Install service account. Error Message:  'The provided context did not match the target'
 
Hmmm.."The provided context did not match the target"...not exactly overflowing with relevant information. The Test-ADServiceAccount cmdlet gave us a little more to go on:
 
WARNING: Test failed for Managed Service Account SQLServerGMSA. If standalone Managed Service Account, the account is linked to another computer object in the Active Directory. If group Managed Service Account, either this computer does not have permission to use the group MSA or this computer does not support all the Kerberos encryption types required for the gMSA. See the MSA operational log for more information.
 
We verified that the account had been created properly and did not suffer from the "linked to another computer object" condition mentioned first in the message.  This would be applicable on a Managed Service Account (MSA) scenario since that type of account can only be used with a single computer. Our account was created as a gMSA, and we validated that the group that had been associated with the GMSA was properly configured and contained both servers on which we intended to use the gMSA. Permissions were verified, all is well.
 
The error also mentions Kerberos encryption, but we're not experiencing any other Kerberos-related issues. Time to look at the event logs. A quick look at the Security-Netlogon event log yielded a couple of clues:
 
There were event IDs 9001 and 9002 being logged when we attempt to test and install the GMSA. The 9002 event doesn't provide much more information than the "provided context did not match the target" message.
 
Let's look at the 9001: The account SQLServergMSA cannot be used as a managed service account on the local machine because not all of the supported encryption types are supported by the local machine.
 
This event is at least pointing us back at the encryption types, which is also mentioned at the tail end of the Test-ADServiceAccount output. What gives?
 
After dredging through the documentation for gMSAs, I ran across the answer to our issue at: https://technet.microsoft.com/en-us/library/hh831782.aspx :
 
"A managed service account is dependent upon Kerberos supported encryption types. When a client computer authenticates to a server using Kerberos the DC creates a Kerberos service ticket protected with encryption both the DC and server supports. The DC uses the account's msDS-SupportedEncryptionTypes attribute to determine what encryption the server supports and, if there is no attribute, it assumes the client computer does not support stronger encryption types. If the Windows Server 2012 host is configured to not support RC4 then authentication will always fail. For this reason, AES should always be explicitly configured for MSAs"
 
Aha...now it makes sense!  We had recently decided to remove the RC4 encryption algorithm in Kerberos to tighten security and, until now, had not run into an issue. 
 
Now we're making progress!  We'll heed the advice of the documentation and specify the encryption types for the gMSA using the command below:
 
Set-ADServiceAccount -Identity SQLServerGMSA -KerberosEncryptionType AES128,AES256
 
To verify, we can look at the GMSAs attributes in Active Directory Users and Computers, specifically, the msDS-SupportedEcryptionTypes attribute to verify that it does not contain RC4.
 
Now that the problem has been resolved, the Install-ADServiceAccount cmdlet works with no errors, hopefully no news is good news.
 
If we run the Test-ADServiceAccount cmdlet, note that it returns "True" now. That looks much better! Our gMSA is finally ready for use.