%3CLINGO-SUB%20id%3D%22lingo-sub-763564%22%20slang%3D%22en-US%22%3ERe%3A%20Understanding%20the%20Repair%20Active%20Directory%20Object%20Recovery%20Action%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-763564%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20John%20-%20any%20way%20to%20query%20the%20password%20date%20in%20the%20cluster%20database%3F%26nbsp%3B%20I%20have%202%20node%202016%20cluster%20that%20is%20alerting%20with%201196%20DNS%20bad%20key.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-371891%22%20slang%3D%22en-US%22%3EUnderstanding%20the%20Repair%20Active%20Directory%20Object%20Recovery%20Action%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-371891%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSTRONG%3E%20First%20published%20on%20MSDN%20on%20Dec%2013%2C%202013%20%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EOne%20of%20the%20responsibilities%20of%20cluster%20Network%20Name%20resource%20is%20to%20rotate%20the%20password%20of%20the%20computer%20object%20in%20Active%20Directory%20associated%20with%20it.%26nbsp%3B%20When%20the%20Network%20Name%20resource%26nbsp%3Bis%20online%2C%26nbsp%3Bit%20will%20rotate%20the%26nbsp%3Bpassword%20according%20to%20domain%20and%20local%20machine%20policy%20(which%20is%2030%20days%20by%20default).%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIf%20the%26nbsp%3Bpassword%20is%20different%20from%20what%20is%20stored%20in%20the%20cluster%20database%2C%26nbsp%3Bthe%20cluster%20service%20will%20be%20unable%20to%20logon%20to%20the%20computer%20object%20and%20the%20Network%20Name%20will%26nbsp%3Bfail%20to%26nbsp%3Bcome%20online.%26nbsp%3B%20This%20may%20also%26nbsp%3Bcause%20issues%20such%20as%20Kerberos%20errors%2C%20failure%20to%20register%20in%20a%20secure%20DNS%20zone%2C%20and%20live%20migration%20to%20fail.%3C%2FP%3E%0A%3CP%3E%3CBR%20%2F%3EThe%20Repair%20Active%20Directory%20Object%20option%20is%20a%20recovery%20tool%20to%20re-synchronize%26nbsp%3Bthe%20password%20for%20cluster%20computer%20objects.%26nbsp%3B%26nbsp%3BIt%20can%20be%20found%20in%20Failover%20Cluster%20Manager%20(CluAdmin.msc)%26nbsp%3Bby%20right-clicking%20on%20the%20Network%20Name%2C%20selecting%20More%20Actions%E2%80%A6%2C%20and%20then%20clicking%20Repair%20Active%20Directory%20Object.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CUL%3E%0A%3CUL%3E%0A%3CLI%3E%3CDIV%3E%3CSTRONG%3ECluster%20Name%20Object%20(CNO)%20%3C%2FSTRONG%3E%20-%20The%20CNO%20is%20the%20computer%20object%20associated%20with%20the%20Cluster%20Name%20resource.%26nbsp%3B%20When%20using%20Repair%20on%20the%20Cluster%20Name%2C%20it%20will%20use%20the%20credentials%20of%20the%20currently%20logged%20on%20user%20and%20reset%20the%20computer%20objects%20password.%26nbsp%3B%20To%20run%20Repair%2C%20you%20must%20have%20the%20%22Reset%20Password%22%20permissions%20to%20the%20CNO%20computer%20object.%3C%2FDIV%3E%0A%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3C%2FUL%3E%0A%3CUL%3E%0A%3CUL%3E%0A%3CLI%3E%3CDIV%3E%3CSTRONG%3EVirtual%20Computer%20Object%20(VCO)%20%3C%2FSTRONG%3E%20-%20The%20CNO%20is%20responsible%20for%20managing%20the%20passwords%20on%20all%20other%20computer%20objects%20(VCO's)%20for%20other%20cluster%20network%20names%20in%20the%20cluster.%26nbsp%3B%20If%20the%20password%20for%20a%20VCO%20falls%20out%20of%20sync%2C%20the%20CNO%20will%20reset%20the%20password%20and%20self-heal%20automatically.%26nbsp%3B%20Therefore%20it%20is%20not%20needed%20to%20run%20Repair%20to%20reset%20the%20password%20for%20a%20VCO.%26nbsp%3B%20In%20Windows%20Server%202012%20a%20Repair%20action%20was%20added%20for%20all%20other%20cluster%20Network%20Names%2C%20and%20is%20a%20little%20bit%20different.%26nbsp%3B%20Repair%26nbsp%3Bwill%20check%20to%20see%20if%20the%20associated%20computer%20object%20exists%20in%20Active%20Directory.%26nbsp%3B%20If%20the%20VCO%20had%20been%20accidentally%20deleted%2C%20then%20using%20Repair%20will%20re-create%20the%20computer%20object%20if%20it%20is%20missing.%26nbsp%3B%20The%20recommended%20process%20to%20recover%20deleted%20computer%20objects%20is%26nbsp%3Bwith%20the%20AD%20Recycle%20Bin%20feature%2C%20using%20Repair%26nbsp%3Bto%20re-create%20computer%20objects%20when%20they%20have%20been%20deleted%20should%20be%20a%20last%20resort%20recovery%20action.%26nbsp%3B%20This%20is%20because%20some%20applications%20store%20attributes%20in%20the%20computer%20object%20(namely%20MSMQ)%2C%20and%20recreating%20a%20new%26nbsp%3Bcomputer%20object%26nbsp%3Bwill%20break%20the%20application.%26nbsp%3B%20Repair%20is%20a%20safe%20action%20to%20perform%26nbsp%3Bon%20any%20SQL%20Server%2C%20or%20File%20Server%20deployment.%26nbsp%3B%20The%20CNO%20must%20have%20%22Create%20Computer%20Objects%22%20permissions%20on%20the%20OU%20in%20which%20it%20resides%20to%20recreate%20the%20VCO's.%3C%2FDIV%3E%0A%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20551px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F90460iE497D82F69FC213A%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ETo%20run%20Repair%2C%20the%20Network%20Name%20resource%20must%20be%20in%20a%20%22Failed%22%20or%20%22Offline%22%20state.%26nbsp%3B%26nbsp%3B%20Otherwise%20the%20option%20will%20be%20grayed%20out.%3C%2FP%3E%0A%3CP%3E%3CBR%20%2F%3ERepair%20is%20only%20available%20through%20the%20Failover%20Cluster%20Manager%20snap-in%2C%20there%20is%20no%20Powershell%20cmdlet%20available%20to%20script%20the%20action.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIf%20you%20are%20running%20Windows%20Server%202012%20and%20find%20that%20you%20are%20having%20to%20repeatedly%20run%20Repair%20every%20~30%20days%2C%20ensure%20you%20have%20hotfix%20KB2838043%20installed.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EMatt%20Kurjanowicz%20%3CBR%20%2F%3ESenior%20Software%20Development%20Engineer%20%3CBR%20%2F%3EClustering%20%26amp%3B%20High-Availability%20%3CBR%20%2F%3EMicrosoft%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-371891%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EActive%20Directory%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Efailover%20clustering%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Enetwork%20name%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-793815%22%20slang%3D%22en-US%22%3ERe%3A%20Understanding%20the%20Repair%20Active%20Directory%20Object%20Recovery%20Action%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-793815%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F378579%22%20target%3D%22_blank%22%3E%40IT1776%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EUnfortunately%20no%2C%20there%20is%20not%20a%20way.%26nbsp%3B%20The%20password%20date%20is%20a%20part%20of%20the%20crypto%20checkpoint%20key%20of%20the%20network%20name.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-794012%22%20slang%3D%22en-US%22%3ERe%3A%20Understanding%20the%20Repair%20Active%20Directory%20Object%20Recovery%20Action%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-794012%22%20slang%3D%22en-US%22%3E%3CP%3EThanks%20John%20for%20replying%20to%20my%20question.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1147395%22%20slang%3D%22en-US%22%3ERe%3A%20Understanding%20the%20Repair%20Active%20Directory%20Object%20Recovery%20Action%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1147395%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F74167%22%20target%3D%22_blank%22%3E%40John%20Marlin%3C%2FA%3E%26nbsp%3B%3A%20On%20the%20newer%20versions%20of%20Windows%20(2016%2F2019)%2C%20is%20there%20a%20way%20to%20do%20a%20CNO%20repair%20from%20power-shell%20%2F%20command%20line%20%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%2C%3C%2FP%3E%3CP%3EBogdan%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1147582%22%20slang%3D%22en-US%22%3ERe%3A%20Understanding%20the%20Repair%20Active%20Directory%20Object%20Recovery%20Action%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1147582%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F542679%22%20target%3D%22_blank%22%3E%40BogdanB%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EUnfortunately%20no.%20At%20this%20time%2C%20the%20Cluster%20Manager%20UX%20is%20the%20only%20method%20to%20accomplish%20this.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1176354%22%20slang%3D%22en-US%22%3ERe%3A%20Understanding%20the%20Repair%20Active%20Directory%20Object%20Recovery%20Action%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1176354%22%20slang%3D%22en-US%22%3E%3CP%3EThanks%20John%2C%20hopefully%20it%20will%20make%20it%20a%20new%20version%20%2F%20update%20%3A)%3C%2Fimg%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EFound%20out%20that%20there%20is%20an%20API%20for%20managing%20the%20cluster%20that%20can%20be%20used%20for%20this%20(clusapi.dll).%3CBR%20%2F%3EIt's%20not%201%20line%20though%20%3A)%3C%2Fimg%3E%20-%20my%20code%20reached%20~400...%3CBR%20%2F%3EAm%20posting%20here%20some%20instructions%20for%20those%20who%20are%20looking%20for%20smth%20like%20this.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EFirst%20you%20have%20to%20create%20the%20computer%20account%20in%20the%20AD%20and%20set%20it's%20typical%20CNO%20properties%20(SPNs%2C%20DSNHostName%2C%20msDS-SupportedEncryptionTypes%2C%20KerberosEncryptionType%2C%20compoundIdentitySupported%20and%20why%20not%2C%20Description).%20Generate%20a%20new%20password%20and%20set%20it%20for%20the%20CNO.%3CBR%20%2F%3EThen%20retrieve%20the%20ObjectGuid%20of%20the%20new%20CNO%20from%20AD.%3CBR%20%2F%3EUse%20New%2FSet%2FGet-AdComputer%20and%20Set-ADAccountPassword%20for%20all%20these.%3CBR%20%2F%3ESet%20this%20ObjectGuid%20in%20the%20registry%20for%20the%20Cluster%20Name%20resource%20on%20all%20nodes%20(HKLM%3A%5CCluster%5CResources%5C...).%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThen%20comes%20the%20fun%20part.%20Use%20Add-Type%20to%20import%20the%20dll%20and%20expose%20the%20API%20functions.%3CBR%20%2F%3EFrom%20clusapi.dll%20you'll%20need%20to%20use%3A%3CBR%20%2F%3E-%20OpenCluster%3CBR%20%2F%3E-%20OpenClusterNode%3CBR%20%2F%3E-%20OpenClusterResource%3CBR%20%2F%3E-%20ClusterResourceControl%20(with%20the%20CLUSCTL_RESOURCE_NETNAME_SET_PWD_INFO%20control%20code).%3CBR%20%2F%3EYou%20also%20need%20to%20use%20some%20additional%20APIs%20for%20creating%20and%20handling%20the%20memory%20structure%20(a%20byte%20array)%20required%20as%20input%20for%20ClusterResourceControl%20(containing%20the%20guid%20and%20password%20-%20if%20you%20sum%20up%20the%20specs%20from%20documentation%20is%20a%20568%20byte%20array%2C%20but%20you%20need%20680%20for%20the%20function%20call%2C%20just%20fill%20the%20rest%20with%200s).%3CBR%20%2F%3EFrom%20kernel32.dll%20and%20msvcrt.dll%20use%20these%3A%3CBR%20%2F%3E-%20VirtualAlloc%3CBR%20%2F%3E-%20memset%3CBR%20%2F%3E-%20VirtualFree%3CBR%20%2F%3EBefore%20calling%20ClusterResourceControl%20set%20the%20resource%20for%20the%20cluster%20name%20offline%20and%20bring%20it%20back%20online%20after.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThen%20do%20some%20additional%20cleanup%20%2F%20setup%20like%20granting%20CNO%20permissions%20on%20VCO%20and%20on%20it's%20DNS%20record.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20I%20missed%20something%20from%20the%20process%2C%20I'll%20appreciate%20your%20input.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHere%20are%20the%20useful%20links%20for%20all%20these%3A%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fwindows%2Fwin32%2Fapi%2Fclusapi%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fwindows%2Fwin32%2Fapi%2Fclusapi%2F%3C%2FA%3E%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fprevious-versions%2Fwindows%2Fdesktop%2Fmscs%2Fclusctl-resource-netname-set-pwd-info%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fprevious-versions%2Fwindows%2Fdesktop%2Fmscs%2Fclusctl-resource-netname-set-pwd-info%3C%2FA%3E%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fwinprotocoldoc.blob.core.windows.net%2Fproductionwindowsarchives%2FMS-CMRP%2F%255BMS-CMRP%255D-190313-diff.pdf%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fwinprotocoldoc.blob.core.windows.net%2Fproductionwindowsarchives%2FMS-CMRP%2F%255BMS-CMRP%255D-190313-diff.pdf%3C%2FA%3E%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fwww.fuzzysecurity.com%2Ftutorials%2F24.html%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fwww.fuzzysecurity.com%2Ftutorials%2F24.html%3C%2FA%3E%3CBR%20%2F%3E%3CA%20href%3D%22http%3A%2F%2Fwww.exploit-monday.com%2F2012%2F05%2Faccessing-native-windows-api-in.html%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttp%3A%2F%2Fwww.exploit-monday.com%2F2012%2F05%2Faccessing-native-windows-api-in.html%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Microsoft

First published on MSDN on Dec 13, 2013

 

One of the responsibilities of cluster Network Name resource is to rotate the password of the computer object in Active Directory associated with it.  When the Network Name resource is online, it will rotate the password according to domain and local machine policy (which is 30 days by default).

 

If the password is different from what is stored in the cluster database, the cluster service will be unable to logon to the computer object and the Network Name will fail to come online.  This may also cause issues such as Kerberos errors, failure to register in a secure DNS zone, and live migration to fail.


The Repair Active Directory Object option is a recovery tool to re-synchronize the password for cluster computer objects.  It can be found in Failover Cluster Manager (CluAdmin.msc) by right-clicking on the Network Name, selecting More Actions…, and then clicking Repair Active Directory Object.

 

    • Cluster Name Object (CNO) - The CNO is the computer object associated with the Cluster Name resource.  When using Repair on the Cluster Name, it will use the credentials of the currently logged on user and reset the computer objects password.  To run Repair, you must have the "Reset Password" permissions to the CNO computer object.
    • Virtual Computer Object (VCO) - The CNO is responsible for managing the passwords on all other computer objects (VCO's) for other cluster network names in the cluster.  If the password for a VCO falls out of sync, the CNO will reset the password and self-heal automatically.  Therefore it is not needed to run Repair to reset the password for a VCO.  In Windows Server 2012 a Repair action was added for all other cluster Network Names, and is a little bit different.  Repair will check to see if the associated computer object exists in Active Directory.  If the VCO had been accidentally deleted, then using Repair will re-create the computer object if it is missing.  The recommended process to recover deleted computer objects is with the AD Recycle Bin feature, using Repair to re-create computer objects when they have been deleted should be a last resort recovery action.  This is because some applications store attributes in the computer object (namely MSMQ), and recreating a new computer object will break the application.  Repair is a safe action to perform on any SQL Server, or File Server deployment.  The CNO must have "Create Computer Objects" permissions on the OU in which it resides to recreate the VCO's.

 

 

To run Repair, the Network Name resource must be in a "Failed" or "Offline" state.   Otherwise the option will be grayed out.


Repair is only available through the Failover Cluster Manager snap-in, there is no Powershell cmdlet available to script the action.

 

If you are running Windows Server 2012 and find that you are having to repeatedly run Repair every ~30 days, ensure you have hotfix KB2838043 installed.

 

Matt Kurjanowicz
Senior Software Development Engineer
Clustering & High-Availability
Microsoft

 

 

6 Comments
Regular Visitor

Hi John - any way to query the password date in the cluster database?  I have 2 node 2016 cluster that is alerting with 1196 DNS bad key.

Microsoft

@IT1776 

 

Unfortunately no, there is not a way.  The password date is a part of the crypto checkpoint key of the network name.

 

Regular Visitor

Thanks John for replying to my question.

Occasional Visitor

Hi,

 

@John Marlin : On the newer versions of Windows (2016/2019), is there a way to do a CNO repair from power-shell / command line ?

 

Thanks,

Bogdan

Microsoft

@BogdanB 

Unfortunately no. At this time, the Cluster Manager UX is the only method to accomplish this.

Occasional Visitor

Thanks John, hopefully it will make it a new version / update :)

 

Found out that there is an API for managing the cluster that can be used for this (clusapi.dll).
It's not 1 line though :) - my code reached ~400...
Am posting here some instructions for those who are looking for smth like this.

 

First you have to create the computer account in the AD and set it's typical CNO properties (SPNs, DSNHostName, msDS-SupportedEncryptionTypes, KerberosEncryptionType, compoundIdentitySupported and why not, Description). Generate a new password and set it for the CNO.
Then retrieve the ObjectGuid of the new CNO from AD.
Use New/Set/Get-AdComputer and Set-ADAccountPassword for all these.
Set this ObjectGuid in the registry for the Cluster Name resource on all nodes (HKLM:\Cluster\Resources\...).

 

Then comes the fun part. Use Add-Type to import the dll and expose the API functions.
From clusapi.dll you'll need to use:
- OpenCluster
- OpenClusterNode
- OpenClusterResource
- ClusterResourceControl (with the CLUSCTL_RESOURCE_NETNAME_SET_PWD_INFO control code).
You also need to use some additional APIs for creating and handling the memory structure (a byte array) required as input for ClusterResourceControl (containing the guid and password - if you sum up the specs from documentation is a 568 byte array, but you need 680 for the function call, just fill the rest with 0s).
From kernel32.dll and msvcrt.dll use these:
- VirtualAlloc
- memset
- VirtualFree
Before calling ClusterResourceControl set the resource for the cluster name offline and bring it back online after.

 

Then do some additional cleanup / setup like granting CNO permissions on VCO and on it's DNS record.

 

If I missed something from the process, I'll appreciate your input.

 

Here are the useful links for all these:

https://docs.microsoft.com/en-us/windows/win32/api/clusapi/
https://docs.microsoft.com/en-us/previous-versions/windows/desktop/mscs/clusctl-resource-netname-set...
https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-CMRP/%5BMS-CMRP%5D-190313-...
https://www.fuzzysecurity.com/tutorials/24.html
http://www.exploit-monday.com/2012/05/accessing-native-windows-api-in.html