Search code examples
powershellwindows-clustering

Rename Services & Application in Failover Cluster Manager Using Powershell


PS C:\Users\sup> Get-ClusterGroup | Where-Object {$_.name -ilike "*scvmm*"}

Name                       Owner                         State
----                      ---------                      -----
scvmm..rtrtry.exported      n01                           Offline
scvmm..rtrtry566.exported   n02                           Offline

Hi All, i wanted to rename the services & application in Failover cluster manager which have the words scvmm & exported in it using powershell, for example the above names should be changed to ..rtrtry. & ..rtrtry566., could some one help me out?


Solution

  • You can get the objects you want with a regex match and set the name property:

    get-clustergroup | 
        where {$_.Name -match "scvmm\.(.*)\.exported"} | 
        foreach {$_.Name = $matches[1]}