Home
%3CLINGO-SUB%20id%3D%22lingo-sub-811945%22%20slang%3D%22en-US%22%3ERe%3A%20Machine%20Account%20Password%20Process%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-811945%22%20slang%3D%22en-US%22%3E%3CP%3ENice!!%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20got%20a%20problem%20with%20SQL%20Server%20and%20Kerberos%20Authentication.%3C%2FP%3E%3CP%3EThe%20SQL%20Instance%20runs%20under%20the%20Virtual%20Account%20%22NT%20SERVICE%5CMSSQLSERVER%22.%26nbsp%3B%20All%20possible%20SPN%20are%20correctly%20registered%20to%20the%20machine%20account.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhen%20some%20client%20attempts%20authentication%20on%20SQL%20Server%20using%20Windows%20Authentication%2C%20the%20client%20gets%20the%20Kerberos%20Ticket%20succesffully%20(i%20can%20see%20it%20on%20output%20of%20klist).%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBut%2C%20when%20the%20client%20send%20its%20to%20the%20my%20SQL%20instance%2C%20it%20cannot%20decrypt%20the%20ticket%2C%20and%20client%20receives%20%22Cannot%20generate%20SSPI%22.%20Looking%20at%20the%20kerberos%20log%2C%20on%20event%20viewer%2C%20i%20get%20the%26nbsp%3BKRB_AP_ERR_MODIFIED%20error.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThis%20can%20be%20triggered%20by%20a%20different%20machine%20account%20password%20on%20my%20SQL%20Server%20instance%20and%20the%20password%20stored%20on%20Active%20Directory%3F%3C%2FP%3E%3CP%3EJust%20more%20data%3A%20I've%20used%20the%20AdExplorer%20from%20sysinternals%20to%20look%20in%20some%20properties%20of%20machine%20account%20in%20AD%20and%20I%20noted%20that%20the%20attribute%20badPasswordTime%20keeps%20updated.%20In%20other%20servers%2C%20last%20value%20is%20from%20two%20years%20ago.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-882087%22%20slang%3D%22en-US%22%3ERe%3A%20Machine%20Account%20Password%20Process%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-882087%22%20slang%3D%22en-US%22%3E%3CP%3EThank%20you%20really%20for%20that%20post.%3C%2FP%3E%3CP%3EBut%20all%20KB%20links%20are%20wrong.%20%3A(%3C%2Fimg%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1270318%22%20slang%3D%22en-US%22%3ERe%3A%20Machine%20Account%20Password%20Process%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1270318%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3ECould%20you%20explain%20more%20the%20line%20%3A%20%22If%20the%20machine%20was%20unable%20to%20communicate%20with%20a%20domain%20controller%20for%2060%20days%2C%20then%20we%20have%20a%20secure%20channel%20issue%22%20%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1291183%22%20slang%3D%22en-US%22%3ERe%3A%20Machine%20Account%20Password%20Process%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1291183%22%20slang%3D%22en-US%22%3E%3CP%3EHello%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EMy%20question%20is%20a%20little%20bit%20similar%20to%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F603922%22%20target%3D%22_blank%22%3E%40webmantoine%3C%2FA%3E's%20question.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAt%20the%20end%20of%20article%20you%20provide%20example%20%22%3CEM%3E%3CSPAN%3ENow%20consider%20the%20scenario%2C%20when%20a%20machine%20is%20not%20connected%20to%20the%20network%20for%20a%20long%20period%3C%2FSPAN%3E%3C%2FEM%3E%22.%3C%2FP%3E%3CP%3EBased%20on%20all%20the%20article%20above%2C%20if%20machine%20is%20%22not%20connected%20to%20the%20network%22%2C%20it%20does%20not%20change%20the%20password%2C%20because%20DC%20is%20not%20available.%20So%20how%20in%20your%20example%20this%20thing%20happens%3F%3C%2FP%3E%3CBLOCKQUOTE%3EAfter%2030%20days%20when%20the%20Scavenger%20thread%20runs%2C%20the%20value%20would%20be%3CBR%20%2F%3EOld%20Password%20%3D%20A%3CBR%20%2F%3ECurrent%20Password%20%3D%20B%3CBR%20%2F%3E%3CBR%20%2F%3EAt%2060%20th%20day%20the%20same%20process%20happens%20again.%20So%20now%20the%20newly%20generated%20password%20is%20C%20and%20the%20values%20are%3A%3CBR%20%2F%3EOld%20password%20%3D%20B%3CBR%20%2F%3ECurrent%20Password%20%3D%20C%26nbsp%3B%3C%2FBLOCKQUOTE%3E%3CP%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-396026%22%20slang%3D%22en-US%22%3EMachine%20Account%20Password%20Process%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-396026%22%20slang%3D%22en-US%22%3E%3CP%3E%3CEM%3EFirst%20published%20on%20TechNet%20on%20Feb%2013%2C%202009%3C%2FEM%3E%3C%2FP%3E%0A%3CP%3E%3CBR%20%2F%3EHi%2C%20this%20is%20Manish%20Singh%20from%20the%20Directory%20Services%20team%20and%20I%20am%20going%20to%20talk%20about%20the%20machine%20account%20password%20process.%20Ever%20wondered%20what%20goes%20on%20with%20your%20machine%20account%20in%20Active%20Directory%3F%20Here%20is%20a%20brief%20set%20of%20question%20and%20answers%20to%20clear%20things%20up.%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSTRONG%3EQuestion%3C%2FSTRONG%3E%3A%20How%20often%20does%20the%20machine%20password%20account%20change%20in%20AD%20(is%20it%20different%20for%20various%20Windows%20operating%20systems)%3F%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSTRONG%3EAnswer%3C%2FSTRONG%3E%3A%20The%20machine%20account%20password%20change%20is%20initiated%20by%20the%20computer%20every%2030%20days%20by%20default.%20Since%20Windows%202000%2C%20all%20versions%20of%20Windows%20have%20the%20same%20value.%20This%20behavior%20can%20be%20modified%20to%20a%20custom%20value%20using%20the%20following%20group%20policy%20setting%20in%20Active%20Directory.%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSTRONG%3EDomain%20member%3A%20Maximum%20machine%20account%20password%20age%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EYou%20can%20configure%20this%20security%20setting%20by%20opening%20the%20appropriate%20policy%20and%3CBR%20%2F%3Eexpanding%20the%20console%20tree%20as%20such%3A%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSTRONG%3EComputer%5CConfiguration%5CWindows%20Settings%5CSecurity%20Settings%5CLocal%20Policies%5CSecurity%20Options%3C%2FSTRONG%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSTRONG%3EQuestion%3C%2FSTRONG%3E%3A%20If%20a%20workstation%20does%20not%20change%20its%20password%2C%20will%20it%20not%20be%20allowed%20to%20log%20onto%20the%20network%3F%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSTRONG%3EAnswer%3C%2FSTRONG%3E%3A%20Machine%20account%20passwords%20as%20such%20do%20not%20expire%20in%20Active%20Directory.%20They%20are%20exempted%20from%20the%20domain's%20password%20policy.%20It%20is%20important%20to%20remember%20that%20machine%20account%20password%20changes%20are%20driven%20by%20the%20CLIENT%20(computer)%2C%20and%20not%20the%20AD.%20As%20long%20as%20no%20one%20has%20disabled%20or%20deleted%20the%20computer%20account%2C%20nor%20tried%20to%20add%20a%20computer%20with%20the%20same%20name%20to%20the%20domain%2C%20(or%20some%20other%20destructive%20action)%2C%20the%20computer%20will%20continue%20to%20work%20no%20matter%20how%20long%20it%20has%20been%20since%20its%20machine%20account%20password%20was%20initiated%20and%20changed.So%20if%20a%20computer%20is%20turned%20off%20for%20three%20months%20nothing%20expires.%20When%20the%20computer%20starts%20up%2C%20it%20will%20notice%20that%20its%20password%20is%20older%20than%2030%20days%20and%20will%20initiate%20action%20to%20change%20it.%20The%20Netlogon%20service%20on%20the%20client%20computer%20is%20responsible%20for%20doing%20this.%20This%20is%20only%20applicable%20if%20the%20machine%20is%20turned%20off%20for%20such%20a%20long%20time.%3CBR%20%2F%3E%3CBR%20%2F%3EIf%20the%20machine%20was%20down%20for%20a%20long%20time%2C%20that%20scavenger%20thread%20will%20not%20run%20and%20the%20password%20will%20not%20get%20out%20of%20sync%20in%20the%20local%20store%20and%20Active%20Directory.%3CBR%20%2F%3E%3CBR%20%2F%3EIf%20the%20machine%20was%20unable%20to%20communicate%20with%20a%20domain%20controller%2C%20the%20client%20doesn%E2%80%99t%20try%20to%20change%20its%20password.%20For%20example%2C%20if%20it%20was%20a%20laptop%20running%20at%20home%20with%20no%20VPN%20for%204%20months%2C%20the%20laptop%20would%20never%20change%20its%20own%20machine%20password.%26nbsp%3B%3CBR%20%2F%3E%3CBR%20%2F%3EThe%20relevant%20Netlogon%20parameters%20that%20come%20into%20play%20and%20we%20can%20think%20about%20changing%20here%20are%3A%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSTRONG%3EScavengeInterval%3C%2FSTRONG%3E%20(default%2015%20minutes)%2C%3CBR%20%2F%3E%3CSTRONG%3EMaximumPasswordAge%3C%2FSTRONG%3E%20(default%2030%20days)%3CBR%20%2F%3E%3CSTRONG%3EDisablePasswordChange%3C%2FSTRONG%3E%20(default%20off).%20%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSTRONG%3EDisablePasswordChange%3C%2FSTRONG%3E%20would%20prevent%20the%20client%20computer%20from%20changing%20its%20computer%20account%20password.%3CBR%20%2F%3E%3CBR%20%2F%3E%3CEM%3EWarning%3C%2FEM%3E%3A%20If%20you%20disable%20machine%20account%20password%20changes%2C%20there%20are%20security%20risks%20because%20the%20security%20channel%20is%20used%20for%20pass-through%20authentication.%20If%20someone%20discovers%20a%20password%2C%20he%20or%20she%20can%20potentially%20perform%20pass-through%20authentication%20to%20the%20domain%20controller.%3CBR%20%2F%3E%3CBR%20%2F%3EHere%20is%20the%20article%20that%20talks%20about%20disabling%20automatic%20machine%20account%20password%20change%3A%20%3CA%20href%3D%22https%3A%2F%2Fsupport.microsoft.com%2Fen-us%2Fhelp%2F154501%2Fhow-to-disable-automatic-machine-account-password-changes%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3EKB154501%3C%2FA%3E%20%3CBR%20%2F%3E%3CBR%20%2F%3EKey%20%3D%20HKLM%5CSYSTEM%5CCurrentControlSet%5CServices%5CNetLogon%5CParameters%3CBR%20%2F%3EValue%20%3D%20%3CSTRONG%3EDisablePasswordChange%3C%2FSTRONG%3E%20REG_DWORD%3CBR%20%2F%3EDefault%20%3D%200%3CBR%20%2F%3E%3CBR%20%2F%3EGroup%20policy%20setting%3A%3CBR%20%2F%3EComputer%5CConfiguration%5CWindows%20Settings%5CSecurity%20Settings%5CLocal%20Policies%5CSecurity%20Options%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSTRONG%3EDomain%20member%3A%20Disable%20machine%20account%20Password%20changes%3C%2FSTRONG%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSTRONG%3EScavengeInterval%3C%2FSTRONG%3E%20controls%20how%20often%20the%20workstation%20scavenger%20thread%20runs%20-%20the%20workstation%20scavenger%20is%20responsible%20for%20changing%20the%20machine%20password%20if%20necessary.%3CBR%20%2F%3E%3CBR%20%2F%3EHKLM%5CSYSTEM%5CCurrentControlSet%5CServices%5CNetLogon%5CParameters%3CBR%20%2F%3EValue%3A%20%3CSTRONG%3EScavengeInterval%3C%2FSTRONG%3E%20REG_DWORD%2C%2060%20to%20172800%20Seconds%20(48%20hours)%3CBR%20%2F%3EDefault%20%3A%20900%20(15%20minutes)%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSTRONG%3EMaximumPasswordAge%3C%2FSTRONG%3E%20determines%20when%20the%20computer%20password%20needs%20to%20be%20changed.%3CBR%20%2F%3E%3CBR%20%2F%3EKey%20%3D%20HKLM%5CSYSTEM%5CCurrentControlSet%5CServices%5CNetLogon%5CParameters%3CBR%20%2F%3EValue%20%3D%20MaximumPasswordAge%20REG_DWORD%3CBR%20%2F%3EDefault%20%3D%2030%3CBR%20%2F%3ERange%20%3D%201%20to%201%2C000%2C000%20(in%20days)%3CBR%20%2F%3E%3CBR%20%2F%3EGroup%20policy%20setting%3A%3CBR%20%2F%3EComputer%5CConfiguration%5CWindows%20Settings%5CSecurity%20Settings%5CLocal%20Policies%5CSecurity%20Options%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSTRONG%3EDomain%20member%3A%20Maximum%20machine%20account%20Password%20age%3C%2FSTRONG%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSTRONG%3ETo%20clear%20things%20up%2C%20it%20is%207%20days%20on%20Windows%20NT%20by%20default%2C%20and%2030%20days%20on%20Windows%202000%20and%20up.%3C%2FSTRONG%3E%20%3CBR%20%2F%3E%3CBR%20%2F%3EThe%20trust%20password%20follows%20the%20same%20setting.%20So%20Trust%20between%20two%20NT%204%20domains%20is%207%20days.%20Trusts%20between%20Windows%202000%20and%20up%20and%20anything%20else%20is%2030%20days.%3CBR%20%2F%3E%3CBR%20%2F%3ESo%20what%20this%20means%20is%20if%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E-%202000%20and%20NT4%20trust%20password%20is%2030%20days.%3CBR%20%2F%3E-%202000%20to%202000%20is%2030%20days.%3CBR%20%2F%3E-%202000%20to%202003%20is%2030%20days.%3CBR%20%2F%3E-%202003%20to%202003%20is%2030%20days.%3CBR%20%2F%3E%3CBR%20%2F%3EAfter%20Netlogon%20service%20starts%20the%20Workstation%20service%20scavenger%20thread%20wakes%20up.%20If%20the%20password%20is%20not%20older%20than%20MaximumPasswordAge%20%2C%20the%20scavenger%20thread%20goes%20back%20to%20sleep%20and%20sets%20itself%20to%20wake%20up%20when%20the%20password%20will%20reach%20that%20age.%20Otherwise%2C%20the%20scavenger%20thread%20will%20attempt%20to%20change%20the%20password.%20If%20it%20cannot%20talk%20to%20a%20DC%2C%20it%20will%20go%20back%20to%20sleep%20and%20try%20again%20in%20ScavengeInterval%20minutes.%3CBR%20%2F%3E%3CBR%20%2F%3EThe%20ScavengeInterval%20setting%20can%20be%20modified%20to%20a%20custom%20value%20using%20the%20group%20policy%20setting%20in%20Active%20Directory.%3CBR%20%2F%3E%3CBR%20%2F%3EGroup%20policy%20setting%3A%3CBR%20%2F%3E%3CSTRONG%3EComputer%20Configuration%5CAdministrative%20Templates%5CSystem%5CNetlogon%5CScavenge%20Interval%3C%2FSTRONG%3E%3CBR%20%2F%3E%3CBR%20%2F%3EFurther%20we%20have%20given%20the%20following%20clarification%20regarding%20the%20behavior%20described%3CBR%20%2F%3Ein%20%3CA%20href%3D%22http%3A%2F%2Fwww.microsoft.com%2Ftechnet%2Fprodtechnol%2Fwindows2000serv%2Freskit%2Fregentry%2F55944.mspx%3Fmfr%3Dtrue%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3EKB260575%3C%2FA%3E.%26nbsp%3B%26nbsp%3B%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSTRONG%3EQuestion%3C%2FSTRONG%3E%3A%20How%20do%20computers%20actually%20use%20passwords%3F%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSTRONG%3EAnswer%3C%2FSTRONG%3E%3A%20Each%20Windows-based%20computer%20maintains%20a%20machine%20account%20password%20history%20containing%20the%20current%20and%20previous%20passwords%20used%20for%20the%20account.%20When%20two%20computers%20attempt%20to%20authenticate%20with%20each%20other%20and%20a%20change%20to%20the%20current%20password%20is%20not%20yet%20received%2C%20Windows%20then%20relies%20on%20the%20previous%20password.%20If%20the%20sequence%20of%20password%20changes%20exceeds%20two%20changes%2C%20the%20computers%20involved%20may%20be%20unable%20to%20communicate%2C%20and%20you%20may%20receive%20error%20messages.When%20a%20client%20determines%20that%20the%20machine%20account%20password%20needs%20to%20be%20changed%2C%20it%20would%20try%20to%20contact%20a%20domain%20controller%20for%20the%20domain%20of%20which%20it%20is%20a%20member%20of%20to%20change%20the%20password%20on%20the%20domain%20controller.%20If%20this%20operation%20succeeds%20then%20it%20would%20update%20machine%20account%20password%20locally.%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3EThe%20local%20copy%20of%20the%20machine%20password%20is%20stored%20under%3A%3CBR%20%2F%3E%3CBR%20%2F%3EHKLM%5CSECURITY%5CPolicy%5CSecrets%5C%24machine.ACC%3CBR%20%2F%3E%3CBR%20%2F%3EWe%20store%20the%20current%20password%20and%20the%20previous%20password%20under%20CurrVal%20%26amp%3B%20OldVal%20Keys%20respectively.%3CBR%20%2F%3E%3CBR%20%2F%3EIn%20Active%20Directory%2C%20we%20store%20the%20password%20in%20unicodepwd%20and%20lmpwdHistory%20.%20We%20also%20store%20the%20timestamp%20in%20the%20pwdlastset%20attribute%20(the%20method%20to%20convert%20it%20into%20readable%20format%20isConvert%20the%20value%20in%20the%20attribute%20from%20decimal%20to%20hex%20(using%20calc.exe)Split%20the%20result%20into%20two%20equal%20parts%20(8%20bits%20for%20each%20part)Run%20nltest%20%2Ftime%3A%20rightsidehex%20leftsidehexThe%20resultant%20value%20is%20the%20date%20and%20time%20the%20password%20was%20set%20on%20this%20computer%20object%20in%20AD.%20The%20cases%20where%20in%20you%20could%20run%20into%20problems%20that%20the%20KB260575%20describes%20would%20be%3AIf%20you%20use%20System%20Restore%20after%20the%20password%20change%20interval%20expired%20one%20time%2C%20and%20you%20restore%20the%20computer%20to%20a%20point%20before%20the%20password%20changes%2C%20the%20next%20password%20change%20may%20not%20occur%20when%20it%20is%20due.%20Instead%2C%20the%20operating%20system%20treats%20the%20restore%20as%20if%20the%20password%20was%20changed.Now%20consider%20the%20scenario%2C%20when%20a%20machine%20is%20not%20connected%20to%20the%20network%20for%20a%20long%20period.Supposing%20on%20the%20client%3AOld%20password%20%3D%20nullCurrent%20password%20%3D%20A%20New%20random%20password%20%3D%20B%20And%20on%20the%20machine%20account%20in%20AD%3A%3C%2FP%3E%0A%3CP%3E%3CBR%20%2F%3E%3CSTRIKE%3EunicodePWD%20%3D%20A%20%3C%2FSTRIKE%3E%3C%2FP%3E%0A%3CP%3E%3CBR%20%2F%3E%3CSTRIKE%3EAfter%2030%20days%20when%20the%20Scavenger%20thread%20runs%2C%20the%20value%20would%20be%3C%2FSTRIKE%3E%3C%2FP%3E%0A%3CP%3E%3CBR%20%2F%3E%3CSTRIKE%3EOld%20Password%20%3D%20A%20%3C%2FSTRIKE%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSTRIKE%3ECurrent%20Password%20%3D%20B%20%3C%2FSTRIKE%3E%3CBR%20%2F%3E%3CSTRIKE%3EAt%2060%20th%20day%20the%20same%20process%20happens%20again.%20So%20now%20the%20newly%20generated%20password%20is%20C%20and%20the%20values%20are%3A%3C%2FSTRIKE%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSTRIKE%3EOld%20password%20%3D%20B%20%3C%2FSTRIKE%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSTRIKE%3ECurrent%20Password%20%3D%20C%20%3C%2FSTRIKE%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSTRIKE%3ENow%20when%20the%20client%20connects%20to%20AD%2C%20it%20will%20try%20the%20current%20password%20to%20authenticate.%20When%20that%20fails%20with%20the%20error%2C%20it%20can%20try%20the%20previous.%20Otherwise%20machine%20should%20be%20able%20to%20reset%20its%20password%20once%20it%20boots%20even%20after%20say%2090%20days.%3C%2FSTRIKE%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EUpdate%20April%202020%3A%20While%20the%20above%20scenario%20may%20have%20been%20possible%20when%20the%20article%20was%20originally%20written%2C%20Windows%207%20SP1%20clients%20and%20later%20will%20never%20reset%20the%20local%20registry%20LSA%20secret%20if%20it%20fails%20to%20reset%20the%20AD%20object%E2%80%99s%20corresponding%20UnicodePWD%20attribute%20--%20in%20other%20words%3A%20Local%20password%20change%20will%20never%20occur%20unless%20a%20DC%20is%20able%20to%20process%20the%20change.%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CBR%20%2F%3E%3CBR%20%2F%3EHow%20to%20detect%20and%20remove%20inactive%20machine%20accounts%3C%2FP%3E%0A%3CP%3E%3CA%20tabindex%3D%22-1%22%20title%3D%22https%3A%2F%2Fgallery.technet.microsoft.com%2Fscriptcenter%2Fget-active-directory-df516533%22%20href%3D%22https%3A%2F%2Fgallery.technet.microsoft.com%2Fscriptcenter%2FGet-Active-Directory-df516533%22%20target%3D%22_blank%22%20rel%3D%22noreferrer%20noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgallery.technet.microsoft.com%2Fscriptcenter%2FGet-Active-Directory-df516533%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fgallery.technet.microsoft.com%2Fscriptcenter%2FGet-Inactive-Computer-in-54feafde%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgallery.technet.microsoft.com%2Fscriptcenter%2FGet-Inactive-Computer-in-54feafde%3C%2FA%3E%3CBR%20%2F%3E%3CBR%20%2F%3EI%20would%20recommend%20the%20following%20KB%20articles%20as%20good%20reads%3A%20%3CBR%20%2F%3E%3CBR%20%2F%3EHow%20to%20disable%20automatic%20machine%20account%20password%20changes%3C%2FP%3E%0A%3CDIV%3E%3CA%20href%3D%22https%3A%2F%2Fsupport.microsoft.com%2Fen-nz%2Fhelp%2F154501%2Fhow-to-disable-automatic-machine-account-password-changes%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fsupport.microsoft.com%2Fen-us%2Fhelp%2F154501%2Fhow-to-disable-automatic-machine-account-password-changes%3C%2FA%3E%3C%2FDIV%3E%0A%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CDIV%3EEffects%20of%20machine%20account%20replication%20on%20a%20domain%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fsupport.microsoft.com%2Fen-in%2Fhelp%2F175468%2Feffects-of-machine-account-replication-on-a-domain%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fsupport.microsoft.com%2Fen-us%2Fhelp%2F175468%2Feffects-of-machine-account-replication-on-a-domain%3C%2FA%3E%3CBR%20%2F%3E%3CBR%20%2F%3EDomain%20member%3A%20Disable%20machine%20account%20password%20changes%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fwindows%2Fsecurity%2Fthreat-protection%2Fsecurity-policy-settings%2Fdomain-member-disable-machine-account-password-changes%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fwindows%2Fsecurity%2Fthreat-protection%2Fsecurity-policy-settings%2Fdomain-member-disable-machine-account-password-changes%3C%2FA%3E%3CBR%20%2F%3E%3CBR%20%2F%3EDomain%20member%3A%20Maximum%20machine%20account%20password%20age%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fwindows%2Fsecurity%2Fthreat-protection%2Fsecurity-policy-settings%2Fdomain-member-maximum-machine-account-password-age%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fwindows%2Fsecurity%2Fthreat-protection%2Fsecurity-policy-settings%2Fdomain-member-maximum-machine-account-password-age%3C%2FA%3E%3CBR%20%2F%3E%3CBR%20%2F%3EAccount%20Passwords%20and%20Policies%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fwindows%2Fsecurity%2Fthreat-protection%2Fsecurity-policy-settings%2Fpassword-policy%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fwindows%2Fsecurity%2Fthreat-protection%2Fsecurity-policy-settings%2Fpassword-policy%3C%2FA%3E%3CBR%20%2F%3E%3CBR%20%2F%3ETo%20wrap%20it%20up%20Machine%20account%20password%20are%20driven%20by%20Client%20computer%20not%20by%20Active%20directory.%20The%20Netlogon%20scavenger%20thread%20is%20responsible%20for%20changing%20the%20Machine%20password%20if%20necessary%20the%20same%20can%20be%20modified%20by%20group%20policy.%20We%20first%20change%20the%20password%20locally%20and%20then%20update%20it%20in%20Active%20Directory.%20It%20will%20not%20rollback%20the%20changes%20to%20the%20current%20password%20if%20it%20is%20unable%20to%20update%20it%20in%20Active%20Directory.-%20Manish%20Singh%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-396026%22%20slang%3D%22en-US%22%3E%3CP%3E%3CEM%3EFirst%20published%20on%20TechNet%20on%20Feb%2013%2C%202009%3C%2FEM%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EHi%2C%20this%20is%20Manish%20Singh%20from%20the%20Directory%20Services%20team%20and%20I%20am%20going%20to%20talk%20about%20the%20machine%20account%20password%20process.%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-396026%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAuthentication%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Microsoft

First published on TechNet on Feb 13, 2009


Hi, this is Manish Singh from the Directory Services team and I am going to talk about the machine account password process. Ever wondered what goes on with your machine account in Active Directory? Here is a brief set of question and answers to clear things up.

Question: How often does the machine password account change in AD (is it different for various Windows operating systems)?

Answer: The machine account password change is initiated by the computer every 30 days by default. Since Windows 2000, all versions of Windows have the same value. This behavior can be modified to a custom value using the following group policy setting in Active Directory.

Domain member: Maximum machine account password age

 

You can configure this security setting by opening the appropriate policy and
expanding the console tree as such:

Computer\Configuration\Windows Settings\Security Settings\Local Policies\Security Options

Question: If a workstation does not change its password, will it not be allowed to log onto the network?

Answer: Machine account passwords as such do not expire in Active Directory. They are exempted from the domain's password policy. It is important to remember that machine account password changes are driven by the CLIENT (computer), and not the AD. As long as no one has disabled or deleted the computer account, nor tried to add a computer with the same name to the domain, (or some other destructive action), the computer will continue to work no matter how long it has been since its machine account password was initiated and changed.

So if a computer is turned off for three months nothing expires. When the computer starts up, it will notice that its password is older than 30 days and will initiate action to change it. The Netlogon service on the client computer is responsible for doing this. This is only applicable if the machine is turned off for such a long time.

If the machine was down for a long time, that scavenger thread will not run and the password will not get out of sync in the local store and Active Directory.

If the machine was unable to communicate with a domain controller, the client doesn’t try to change its password. For example, if it was a laptop running at home with no VPN for 4 months, the laptop would never change its own machine password. 

The relevant Netlogon parameters that come into play and we can think about changing here are:

ScavengeInterval (default 15 minutes),
MaximumPasswordAge (default 30 days)
DisablePasswordChange (default off).

DisablePasswordChange would prevent the client computer from changing its computer account password.

Warning: If you disable machine account password changes, there are security risks because the security channel is used for pass-through authentication. If someone discovers a password, he or she can potentially perform pass-through authentication to the domain controller.

Here is the article that talks about disabling automatic machine account password change: KB154501

Key = HKLM\SYSTEM\CurrentControlSet\Services\NetLogon\Parameters
Value = DisablePasswordChange REG_DWORD
Default = 0

Group policy setting:
Computer\Configuration\Windows Settings\Security Settings\Local Policies\Security Options

Domain member: Disable machine account Password changes

ScavengeInterval controls how often the workstation scavenger thread runs - the workstation scavenger is responsible for changing the machine password if necessary.

HKLM\SYSTEM\CurrentControlSet\Services\NetLogon\Parameters
Value: ScavengeInterval REG_DWORD, 60 to 172800 Seconds (48 hours)
Default : 900 (15 minutes)

MaximumPasswordAge determines when the computer password needs to be changed.

Key = HKLM\SYSTEM\CurrentControlSet\Services\NetLogon\Parameters
Value = MaximumPasswordAge REG_DWORD
Default = 30
Range = 1 to 1,000,000 (in days)

Group policy setting:
Computer\Configuration\Windows Settings\Security Settings\Local Policies\Security Options

Domain member: Maximum machine account Password age

To clear things up, it is 7 days on Windows NT by default, and 30 days on Windows 2000 and up.

The trust password follows the same setting. So Trust between two NT 4 domains is 7 days. Trusts between Windows 2000 and up and anything else is 30 days.

So what this means is if:

 

- 2000 and NT4 trust password is 30 days.
- 2000 to 2000 is 30 days.
- 2000 to 2003 is 30 days.
- 2003 to 2003 is 30 days.

After Netlogon service starts the Workstation service scavenger thread wakes up. If the password is not older than MaximumPasswordAge , the scavenger thread goes back to sleep and sets itself to wake up when the password will reach that age. Otherwise, the scavenger thread will attempt to change the password. If it cannot talk to a DC, it will go back to sleep and try again in ScavengeInterval minutes.

The ScavengeInterval setting can be modified to a custom value using the group policy setting in Active Directory.

Group policy setting:
Computer Configuration\Administrative Templates\System\Netlogon\Scavenge Interval

Further we have given the following clarification regarding the behavior described
in KB260575.  

Question: How do computers actually use passwords?

Answer: Each Windows-based computer maintains a machine account password history containing the current and previous passwords used for the account. When two computers attempt to authenticate with each other and a change to the current password is not yet received, Windows then relies on the previous password. If the sequence of password changes exceeds two changes, the computers involved may be unable to communicate, and you may receive error messages.

When a client determines that the machine account password needs to be changed, it would try to contact a domain controller for the domain of which it is a member of to change the password on the domain controller. If this operation succeeds then it would update machine account password locally.


The local copy of the machine password is stored under:

HKLM\SECURITY\Policy\Secrets\$machine.ACC

We store the current password and the previous password under CurrVal & OldVal Keys respectively.

In Active Directory, we store the password in unicodepwd and lmpwdHistory . We also store the timestamp in the pwdlastset attribute (the method to convert it into readable format is



Convert the value in the attribute from decimal to hex (using calc.exe)
Split the result into two equal parts (8 bits for each part)
Run nltest /time: rightsidehex leftsidehex

The resultant value is the date and time the password was set on this computer object in AD. The cases where in you could run into problems that the KB260575 describes would be:

If you use System Restore after the password change interval expired one time, and you restore the computer to a point before the password changes, the next password change may not occur when it is due. Instead, the operating system treats the restore as if the password was changed.

Now consider the scenario, when a machine is not connected to the network for a long period.

Supposing on the client:

Old password = null
Current password = A

New random password = B

And on the machine account in AD:


unicodePWD = A


After 30 days when the Scavenger thread runs, the value would be


Old Password = A

Current Password = B
At 60 th day the same process happens again. So now the newly generated password is C and the values are:

Old password = B

Current Password = C

Now when the client connects to AD, it will try the current password to authenticate. When that fails with the error, it can try the previous. Otherwise machine should be able to reset its password once it boots even after say 90 days.

 

Update April 2020: While the above scenario may have been possible when the article was originally written, Windows 7 SP1 clients and later will never reset the local registry LSA secret if it fails to reset the AD object’s corresponding UnicodePWD attribute -- in other words: Local password change will never occur unless a DC is able to process the change.



How to detect and remove inactive machine accounts

https://gallery.technet.microsoft.com/scriptcenter/Get-Active-Directory-df516533

https://gallery.technet.microsoft.com/scriptcenter/Get-Inactive-Computer-in-54feafde

I would recommend the following KB articles as good reads:

How to disable automatic machine account password changes

 
Effects of machine account replication on a domain
https://support.microsoft.com/en-us/help/175468/effects-of-machine-account-replication-on-a-domain

Domain member: Disable machine account password changes
https://docs.microsoft.com/en-us/windows/security/threat-protection/security-policy-settings/domain-...

Domain member: Maximum machine account password age
https://docs.microsoft.com/en-us/windows/security/threat-protection/security-policy-settings/domain-...

Account Passwords and Policies
https://docs.microsoft.com/en-us/windows/security/threat-protection/security-policy-settings/passwor...

To wrap it up Machine account password are driven by Client computer not by Active directory. The Netlogon scavenger thread is responsible for changing the Machine password if necessary the same can be modified by group policy. We first change the password locally and then update it in Active Directory. It will not rollback the changes to the current password if it is unable to update it in Active Directory.


- Manish Singh
4 Comments
Occasional Visitor

Nice!!

 

I got a problem with SQL Server and Kerberos Authentication.

The SQL Instance runs under the Virtual Account "NT SERVICE\MSSQLSERVER".  All possible SPN are correctly registered to the machine account.

 

When some client attempts authentication on SQL Server using Windows Authentication, the client gets the Kerberos Ticket succesffully (i can see it on output of klist).

 

But, when the client send its to the my SQL instance, it cannot decrypt the ticket, and client receives "Cannot generate SSPI". Looking at the kerberos log, on event viewer, i get the KRB_AP_ERR_MODIFIED error.

 

This can be triggered by a different machine account password on my SQL Server instance and the password stored on Active Directory?

Just more data: I've used the AdExplorer from sysinternals to look in some properties of machine account in AD and I noted that the attribute badPasswordTime keeps updated. In other servers, last value is from two years ago.

Visitor

Thank you really for that post.

But all KB links are wrong. :(

Occasional Visitor

Hi,

Could you explain more the line : "If the machine was unable to communicate with a domain controller for 60 days, then we have a secure channel issue" ?

Senior Member

Hello,

 

My question is a little bit similar to @webmantoine's question.

 

At the end of article you provide example "Now consider the scenario, when a machine is not connected to the network for a long period".

Based on all the article above, if machine is "not connected to the network", it does not change the password, because DC is not available. So how in your example this thing happens?

After 30 days when the Scavenger thread runs, the value would be
Old Password = A
Current Password = B

At 60 th day the same process happens again. So now the newly generated password is C and the values are:
Old password = B
Current Password = C