{"id":15818,"date":"2021-02-26T10:20:04","date_gmt":"2021-02-26T09:20:04","guid":{"rendered":"https:\/\/www.dbi-services.com\/blog\/automate-cnos-and-vcos-for-sql-server-aag\/"},"modified":"2021-02-26T10:20:04","modified_gmt":"2021-02-26T09:20:04","slug":"automate-cnos-and-vcos-for-sql-server-aag","status":"publish","type":"post","link":"https:\/\/www.dbi-services.com\/blog\/automate-cnos-and-vcos-for-sql-server-aag\/","title":{"rendered":"Automate CNOs and VCOs for SQL Server AAG"},"content":{"rendered":"<p>During the installation of a new SQL Server environment in a Project, we wanted to automate the whole process deployment and configuration when installing a new SQL Server Always On Availability Group (AAG).<br \/>\nThis installation requires to prestage cluster computer objects in Active Directory Domain Services, called Cluster Name Objects (CNOs) and Virutal Computer Objects (VCOs).<br \/>\nFor more information on the prestage process, please read this <a href=\"https:\/\/docs.microsoft.com\/en-us\/windows-server\/failover-clustering\/prestage-cluster-adds\" target=\"_blank\" rel=\"noopener noreferrer\">Microsoft article<\/a>.<\/p>\n<p>In this blog, we will see how to automate the procedure through PowerShell scripts. <a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/activedirectory\/?view=winserver2012-ps\" target=\"_blank\" rel=\"noopener noreferrer\">ActiveDirectory<\/a> module is required.<\/p>\n<h3>CNO Creation<\/h3>\n<p>First, you need an account with the approriate permissions to create Objects in a specific OU of the domain.<br \/>\nWith this account, you can create the CNO object as follows:<\/p>\n<pre class=\"brush: powershell; gutter: true; first-line: 1\">\n# To configure following your needs\n$Ou1='CNO-VCO';\n$Ou2='MSSQL';\n$DC1='dbi';\n$DC2='test';\n$ClusterName='CLST-PRD1';\n$ClusterNameFQDN=\"$(ClusterName).$($DC1).$($DC2)\";\n\n# Test if the CNO exists\nIf (-not (Test-path \"AD:CN=$($ClusterName),OU=$($Ou1),OU=$($Ou2),DC=$($DC1),DC=$($DC2)\")){\n\t# Create CNO for Windows Cluster\n\tNew-ADComputer -Name \"$ClusterName\" `\n          -SamAccountName \"$ClusterName\" `\n            -Path \"OU=$($Ou1),OU=$($Ou2),DC=$($DC1),DC=$($DC2)\" `\n              -Description \"Failover cluster virtual network name account\" `\n                 -Enabled $false -DNSHostName $ClusterNameFQDN;\n\n\t# Wait for AD synchronization\n\tStart-Sleep -Seconds 20;\n};\n<\/pre>\n<p>Once the CNO created, we have to configure the correct permissions. We have to give, to the account we will use for the creation of the Windows Server Failover Cluster (WSFC), the correct Access Control Lists (ACLs) to be able to claim the object during the WSFC installation process.<\/p>\n<pre class=\"brush: powershell; gutter: true; first-line: 1\">\n# Group Account use for the installation\n$GroupAccount='MSSQL-Admins';\n\n# Retrieve existing ACL on the CNO\n$acl = Get-Acl \"AD:$((Get-ADComputer -Identity $ClusterName).DistinguishedName)\";\n\n# Create a new access rule which will give to the installation account Full Control on the object\n$identity = ( Get-ADGroup -Identity $GroupAccount).SID;\n$adRights = [System.DirectoryServices.ActiveDirectoryRights] \"GenericAll\";\n$type = [System.Security.AccessControl.AccessControlType] \"Allow\";\n$inheritanceType = [System.DirectoryServices.ActiveDirectorySecurityInheritance] \"All\";\n$ACE = New-Object System.DirectoryServices.ActiveDirectoryAccessRule $identity,$adRights,$type,$inheritanceType;\n\n# Add the new acess rule to the existing ACL, then set the ACL on the CNO to save the changes\n$acl.AddAccessRule($ace); \nSet-acl -aclobject $acl \"AD:$((Get-ADComputer -Identity $ClusterName).DistinguishedName)\";\n<\/pre>\n<p>Here, our CNO is created disabled with the correct permissions we require for the installation.<br \/>\nWe need to create its DNS entry, and give to the CNO read\/write permissions on it.<\/p>\n<pre class=\"brush: powershell; gutter: true; first-line: 1\">\n# Specify the IP address the Cluster we will use\n$IPAddress='192.168.0.2';\n\n# Computer Name of the AD \/ DNS server name\n$ADServer = 'DC01';\n\nAdd-DnsServerResourceRecordA -ComputerName $ADServer -Name $ClusterName -ZoneName \"$($DC1).$($DC2)\" -IPv4Address $IPAddress;\n\n#Retrieve ACl for DNS Record\n$acl = Get-Acl \"AD:$((Get-DnsServerResourceRecord -ComputerName $ADServer -ZoneName '$($DC1).$($DC2)' -Name $ClusterName).DistinguishedName)\";\n\n#Retrive SID Identity for CNO to update in ACL\n$identity = (Get-ADComputer -Identity $ClusterName).SID;\n\n# Contruct ACE for Generic Read\n$adRights = [System.DirectoryServices.ActiveDirectoryRights] \"GenericRead\";\n$type = [System.Security.AccessControl.AccessControlType] \"Allow\";\n$inheritanceType = [System.DirectoryServices.ActiveDirectorySecurityInheritance] \"All\";\n$ACE = New-Object System.DirectoryServices.ActiveDirectoryAccessRule $identity,$adRights,$type,$inheritanceType;\n$acl.AddAccessRule($ace);\n\n# Contruct ACE for Generic Write\n$adRights = [System.DirectoryServices.ActiveDirectoryRights] \"GenericWrite\";\n$type = [System.Security.AccessControl.AccessControlType] \"Allow\";\n$inheritanceType = [System.DirectoryServices.ActiveDirectorySecurityInheritance] \"All\";\n$ACE = New-Object System.DirectoryServices.ActiveDirectoryAccessRule $identity,$adRights,$type,$inheritanceType;\n$acl.AddAccessRule($ace);\n\n#Update ACL for DNS Record of the CNO\nSet-acl -aclobject $acl \"AD:$((Get-DnsServerResourceRecord  -ComputerName $ADServer  -ZoneName \"$($DC1).$($DC2)\" -Name $ClusterName).DistinguishedName)\";\n<\/pre>\n<p>At this step, the installation process will be able to claim the CNO while creating the new Cluster.<br \/>\nThe prestage for the CNO object is completed.<\/p>\n<h3>VCO Creation<\/h3>\n<p>The creation of the VCO, used by the AAG for its Listener, is quite similar.<br \/>\nAs there is no additional complexity compared to the creation of the CNO, here is the whole code:<\/p>\n<pre class=\"brush: powershell; gutter: true; first-line: 1\">\n# To configure following your needs\n$Ou1='CNO-VCO';\n$Ou2='MSSQL';\n$DC1='dbi';\n$DC2='test';\n$ListenerName='LSTN-PRD1';\n$ListenerNameFQDN=\"$(ListenerName).$($DC1).$($DC2)\";\n$IPAddress='192.168.0.3';\n$ADServer = 'DC01';\n\nIf (-not (Test-path \"AD:CN=$($ListenerName),OU=$($Ou1),OU=$($Ou2),DC=$($DC1),DC=$($DC2)\")){\n\t# Create VCO for AAG\n\tNew-ADComputer -Name \"$ListenerName\" -SamAccountName \"$ListenerName\" -Path \"OU=$($Ou1),OU=$($Ou2),DC=$($DC1),DC=$($DC2)\" -Description \"AlwaysOn Availability Group Listener Account\" -Enabled $false -DNSHostName $ListenerNameFQN;\n\n\t# Wait for AD synchronization\n\tStart-Sleep -Seconds 20;\n};\n\n# Retrieve existing ACL on the VCO\n$acl = Get-Acl \"AD:$((Get-ADComputer -Identity $ListenerName).DistinguishedName)\"; `\n\n# Create a new access rule which will give CNO account Full Control on the object\n$identity = (Get-ADComputer -Identity $ClusterName).SID;\n$adRights = [System.DirectoryServices.ActiveDirectoryRights] \"GenericAll\";\n$type = [System.Security.AccessControl.AccessControlType] \"Allow\";\n$inheritanceType = [System.DirectoryServices.ActiveDirectorySecurityInheritance] \"All\";\n$ACE = New-Object System.DirectoryServices.ActiveDirectoryAccessRule $identity,$adRights,$type,$inheritanceType;\n\n# Add the ACE to the ACL, then set the ACL to save the changes\n$acl.AddAccessRule($ace);\nSet-acl -aclobject $acl \"AD:$((Get-ADComputer -Identity $ListenerName).DistinguishedName)\";\n\n# Create a new DNS entry for the Listener\nAdd-DnsServerResourceRecordA -ComputerName $ADServer -Name $ListenerName -ZoneName \"$($DC1).$($DC2)\" -IPv4Address $IPAddress;\n\n# We have to give the CNO the access to the DNS record\n$acl = Get-Acl \"AD:$((Get-DnsServerResourceRecord -ComputerName $ADServer -ZoneName '$($DC1).$($DC2)' -Name $ListenerName).DistinguishedName)\";\n\n#Retrive SID Identity for CNO to update in ACL\n$identity = (Get-ADComputer -Identity $ClusterName).SID;\n\n# Contruct ACE for Generic Read\n$adRights = [System.DirectoryServices.ActiveDirectoryRights] \"GenericRead\";\n$type = [System.Security.AccessControl.AccessControlType] \"Allow\";\n$inheritanceType = [System.DirectoryServices.ActiveDirectorySecurityInheritance] \"All\";\n$ACE = New-Object System.DirectoryServices.ActiveDirectoryAccessRule $identity,$adRights,$type,$inheritanceType;\n$acl.AddAccessRule($ace);\n\n# Contruct ACE for Generic Write\n$adRights = [System.DirectoryServices.ActiveDirectoryRights] \"GenericWrite\";\n$type = [System.Security.AccessControl.AccessControlType] \"Allow\";\n$inheritanceType = [System.DirectoryServices.ActiveDirectorySecurityInheritance] \"All\";\n$ACE = New-Object System.DirectoryServices.ActiveDirectoryAccessRule $identity,$adRights,$type,$inheritanceType;\n$acl.AddAccessRule($ace); `\n\n#Update ACL for DNS Record of the CNO\nSet-acl -aclobject $acl \"AD:$((Get-DnsServerResourceRecord  -ComputerName $ADServer -ZoneName \"$($DC1).$($DC2)\" -Name $ListenerName).DistinguishedName)\";\n<\/pre>\n<p>In this blog, we saw how to automate the creation and the configuration of CNOs and VCOs in the AD\/DNS.<br \/>\nThis is useful when you have several Clusters to install and several Listeners to configure, and you want to make sure there is no mistake while saving time.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>During the installation of a new SQL Server environment in a Project, we wanted to automate the whole process deployment and configuration when installing a new SQL Server Always On Availability Group (AAG). This installation requires to prestage cluster computer objects in Active Directory Domain Services, called Cluster Name Objects (CNOs) and Virutal Computer Objects&hellip;&nbsp;<\/p>\n","protected":false},"author":14,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"neve_meta_sidebar":"","neve_meta_container":"","neve_meta_enable_content_width":"","neve_meta_content_width":0,"neve_meta_title_alignment":"","neve_meta_author_avatar":"","neve_post_elements_order":"","neve_meta_disable_header":"","neve_meta_disable_footer":"","neve_meta_disable_title":"","neve_meta_reading_time":"","_themeisle_gutenberg_block_has_review":false,"footnotes":""},"categories":[99],"tags":[466,1525,272],"class_list":["post-15818","post","type-post","status-publish","format-standard","hentry","category-sql-server","tag-alwayson","tag-mssql","tag-powershell"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v28.4 (Yoast SEO v28.7) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Automate CNOs and VCOs for SQL Server AAG - dbi services | Blog<\/title>\n<meta name=\"description\" content=\"In this blog, we will see how to automate the creation of Cluster Name Objects and Virtual Computer Objects for an AAG in PowerShell.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.dbi-services.com\/blog\/automate-cnos-and-vcos-for-sql-server-aag\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Automate CNOs and VCOs for SQL Server AAG\" \/>\n<meta property=\"og:description\" content=\"In this blog, we will see how to automate the creation of Cluster Name Objects and Virtual Computer Objects for an AAG in PowerShell.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.dbi-services.com\/blog\/automate-cnos-and-vcos-for-sql-server-aag\/\" \/>\n<meta property=\"og:site_name\" content=\"dbi services | Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/dbiservices\/\" \/>\n<meta property=\"article:published_time\" content=\"2021-02-26T09:20:04+00:00\" \/>\n<meta name=\"author\" content=\"Nathan Courtine\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@dbiservices\" \/>\n<meta name=\"twitter:site\" content=\"@dbiservices\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Nathan Courtine\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/automate-cnos-and-vcos-for-sql-server-aag\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/automate-cnos-and-vcos-for-sql-server-aag\\\/\"},\"author\":{\"name\":\"Nathan Courtine\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#\\\/schema\\\/person\\\/7c4623e3223cf21614c4a06c853ca363\"},\"headline\":\"Automate CNOs and VCOs for SQL Server AAG\",\"datePublished\":\"2021-02-26T09:20:04+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/automate-cnos-and-vcos-for-sql-server-aag\\\/\"},\"wordCount\":317,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#organization\"},\"keywords\":[\"AlwaysOn\",\"mssql\",\"PowerShell\"],\"articleSection\":[\"SQL Server\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/automate-cnos-and-vcos-for-sql-server-aag\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/automate-cnos-and-vcos-for-sql-server-aag\\\/\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/automate-cnos-and-vcos-for-sql-server-aag\\\/\",\"name\":\"Automate CNOs and VCOs for SQL Server AAG - dbi services | Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#website\"},\"datePublished\":\"2021-02-26T09:20:04+00:00\",\"description\":\"In this blog, we will see how to automate the creation of Cluster Name Objects and Virtual Computer Objects for an AAG in PowerShell.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/automate-cnos-and-vcos-for-sql-server-aag\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/automate-cnos-and-vcos-for-sql-server-aag\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/automate-cnos-and-vcos-for-sql-server-aag\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Accueil\",\"item\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Automate CNOs and VCOs for SQL Server AAG\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/\",\"name\":\"dbi services Blog\",\"description\":\"#BeSharing\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#organization\"},\"alternateName\":\"dbi Blog\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#organization\",\"name\":\"dbi services\",\"alternateName\":\"dbi\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/09\\\/dbi-services-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/09\\\/dbi-services-logo.png\",\"width\":512,\"height\":512,\"caption\":\"dbi services\"},\"image\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/dbiservices\\\/\",\"https:\\\/\\\/x.com\\\/dbiservices\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/dbi-services\\\/\",\"https:\\\/\\\/www.youtube.com\\\/user\\\/dbiservices\"],\"description\":\"Swiss IT consulting and services company specialised in efficient data infrastructures and platforms: databases, application servers, cloud, DevOps, digitalization, analytics, data quality and monitoring. Headquartered in Del\u00e9mont with offices in Nyon, Basel, Bern and Zurich.\",\"email\":\"info@dbi-services.com\",\"telephone\":\"+41 32 422 96 00\",\"legalName\":\"dbi services SA\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#\\\/schema\\\/person\\\/7c4623e3223cf21614c4a06c853ca363\",\"name\":\"Nathan Courtine\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/08\\\/NAC_web-min-scaled.jpg\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/08\\\/NAC_web-min-scaled.jpg\",\"contentUrl\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/08\\\/NAC_web-min-scaled.jpg\",\"caption\":\"Nathan Courtine\"},\"description\":\"Nathan Courtine has more than nine years of experience in Microsoft solutions, specializing in SQL Server installation, migration, performance analysis, and automation. He holds Microsoft Certified Solutions Expert (MCSE), Microsoft Certified Azure Administrator Associate, and AWS Certified Solutions Architect Associate credentials. He holds a Computer Science degree from ENSISA Mulhouse. His industry experience covers the public sector, pharma, IT, and banking\\\/financial services.\",\"sameAs\":[\"https:\\\/\\\/www.sequotech.com\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/vincentheimann\\\/\"],\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/author\\\/nathan-courtine\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Automate CNOs and VCOs for SQL Server AAG - dbi services | Blog","description":"In this blog, we will see how to automate the creation of Cluster Name Objects and Virtual Computer Objects for an AAG in PowerShell.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.dbi-services.com\/blog\/automate-cnos-and-vcos-for-sql-server-aag\/","og_locale":"en_US","og_type":"article","og_title":"Automate CNOs and VCOs for SQL Server AAG","og_description":"In this blog, we will see how to automate the creation of Cluster Name Objects and Virtual Computer Objects for an AAG in PowerShell.","og_url":"https:\/\/www.dbi-services.com\/blog\/automate-cnos-and-vcos-for-sql-server-aag\/","og_site_name":"dbi services | Blog","article_publisher":"https:\/\/www.facebook.com\/dbiservices\/","article_published_time":"2021-02-26T09:20:04+00:00","author":"Nathan Courtine","twitter_card":"summary_large_image","twitter_creator":"@dbiservices","twitter_site":"@dbiservices","twitter_misc":{"Written by":"Nathan Courtine","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.dbi-services.com\/blog\/automate-cnos-and-vcos-for-sql-server-aag\/#article","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/automate-cnos-and-vcos-for-sql-server-aag\/"},"author":{"name":"Nathan Courtine","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/7c4623e3223cf21614c4a06c853ca363"},"headline":"Automate CNOs and VCOs for SQL Server AAG","datePublished":"2021-02-26T09:20:04+00:00","mainEntityOfPage":{"@id":"https:\/\/www.dbi-services.com\/blog\/automate-cnos-and-vcos-for-sql-server-aag\/"},"wordCount":317,"commentCount":0,"publisher":{"@id":"https:\/\/www.dbi-services.com\/blog\/#organization"},"keywords":["AlwaysOn","mssql","PowerShell"],"articleSection":["SQL Server"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.dbi-services.com\/blog\/automate-cnos-and-vcos-for-sql-server-aag\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.dbi-services.com\/blog\/automate-cnos-and-vcos-for-sql-server-aag\/","url":"https:\/\/www.dbi-services.com\/blog\/automate-cnos-and-vcos-for-sql-server-aag\/","name":"Automate CNOs and VCOs for SQL Server AAG - dbi services | Blog","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/#website"},"datePublished":"2021-02-26T09:20:04+00:00","description":"In this blog, we will see how to automate the creation of Cluster Name Objects and Virtual Computer Objects for an AAG in PowerShell.","breadcrumb":{"@id":"https:\/\/www.dbi-services.com\/blog\/automate-cnos-and-vcos-for-sql-server-aag\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.dbi-services.com\/blog\/automate-cnos-and-vcos-for-sql-server-aag\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.dbi-services.com\/blog\/automate-cnos-and-vcos-for-sql-server-aag\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Accueil","item":"https:\/\/www.dbi-services.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Automate CNOs and VCOs for SQL Server AAG"}]},{"@type":"WebSite","@id":"https:\/\/www.dbi-services.com\/blog\/#website","url":"https:\/\/www.dbi-services.com\/blog\/","name":"dbi services Blog","description":"#BeSharing","publisher":{"@id":"https:\/\/www.dbi-services.com\/blog\/#organization"},"alternateName":"dbi Blog","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.dbi-services.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.dbi-services.com\/blog\/#organization","name":"dbi services","alternateName":"dbi","url":"https:\/\/www.dbi-services.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2026\/09\/dbi-services-logo.png","contentUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2026\/09\/dbi-services-logo.png","width":512,"height":512,"caption":"dbi services"},"image":{"@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/dbiservices\/","https:\/\/x.com\/dbiservices","https:\/\/www.linkedin.com\/company\/dbi-services\/","https:\/\/www.youtube.com\/user\/dbiservices"],"description":"Swiss IT consulting and services company specialised in efficient data infrastructures and platforms: databases, application servers, cloud, DevOps, digitalization, analytics, data quality and monitoring. Headquartered in Del\u00e9mont with offices in Nyon, Basel, Bern and Zurich.","email":"info@dbi-services.com","telephone":"+41 32 422 96 00","legalName":"dbi services SA"},{"@type":"Person","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/7c4623e3223cf21614c4a06c853ca363","name":"Nathan Courtine","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/08\/NAC_web-min-scaled.jpg","url":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/08\/NAC_web-min-scaled.jpg","contentUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/08\/NAC_web-min-scaled.jpg","caption":"Nathan Courtine"},"description":"Nathan Courtine has more than nine years of experience in Microsoft solutions, specializing in SQL Server installation, migration, performance analysis, and automation. He holds Microsoft Certified Solutions Expert (MCSE), Microsoft Certified Azure Administrator Associate, and AWS Certified Solutions Architect Associate credentials. He holds a Computer Science degree from ENSISA Mulhouse. His industry experience covers the public sector, pharma, IT, and banking\/financial services.","sameAs":["https:\/\/www.sequotech.com\/","https:\/\/www.linkedin.com\/in\/vincentheimann\/"],"url":"https:\/\/www.dbi-services.com\/blog\/author\/nathan-courtine\/"}]}},"_links":{"self":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/15818","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/users\/14"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/comments?post=15818"}],"version-history":[{"count":0,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/15818\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/media?parent=15818"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/categories?post=15818"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/tags?post=15818"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}