Posted On July 23, 2020

Hyper-V: De-register Storage File Share and/or Removing Paths from VMM

kimconnect 0 comments
blog.KimConnect.com >> Virtualization >> Hyper-V: De-register Storage File Share and/or Removing Paths from VMM
# vmmDeregisterFileSharePath.ps1

$pathSearch='\\DECOMMISSIONED-FILESHARE008'
$unregister=$true
$remove=$false

$fileShares=Get-SCStorageFileShare|?{$_.SharePath -like "*$pathSearch*"}
$thisLibraryServer = Get-SCLibraryServer
if($unregister){$fileShares|%{Unregister-SCStorageFileShare -StorageFileShare $_ -LibraryServer $thisLibraryServer}}
if($remove){$fileShares|%{Remove-SCStorageFileShare -StorageFileShare $_}}

# Un-resolvable errors due to certain decommed dependencies being unavailable for VMM to make changes
# Unregister-SCStorageFileShare : The file share is not associated to (Error ID: 26187)
# Remove-SCStorageFileShare : The file share could not be removed because it is not currently managed by VMM. (Error ID: 26240)

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

Fixing an Issue On Windows Server 2019 Hyper-V with Uneven Distribution of Available CPU Cores

Issue: When guest-VMs are being migrated between Hyper-V Hosts within a cluster, CPU core scheduling…

VMWare: Provisioning New Guest Virtual Machines

Overview: The process of provisioning a guest virtual machine (VM) template in a cluster follows…

PowerShell: Restart a Service on All Hyper-V Hosts of a Cluster

$serviceName='vmms' $clusterName='HyperV-cluster001' function restartServiceAllClusterNodes($service='vmms',$clusterName){ function restartService($serviceName){ $waitSeconds=40 $isValidProcess=try{[bool](get-service $serviceName -EA Stop)}catch{$false} if($isValidProcess){ try{ $process=Start-Process -FilePath…