In the jobs window in the System Center Virtual Machine Manager (SCVMM) console , the following warning appeared:
Warning (10803) Recommended Action |
The warning means that the ISO file is in use by one or more VM’s. To find the VM’s that are using the ISO file I created the following PowerShell script:
Import-module VirtualMachineManager
Get-SCVMMServer -ComputerName VMMSERVER
Get-SCVirtualMachine | Get-SCVirtualDVDDrive | Where-Object {$_.Connection -eq "ISOImage"} | Select Name, Connection, ISO
The script displays all the VMs that have an ISO file attached. The script is tested against a SCVMM 2012 R2 server.
After changing the VMs Virtual DVD drive to “No media” the hourly (default) refresh of the library went without a warning.
This does not work try this as it will work.
PS C:\Users\jjones> Get-SCVirtualMachine -VMMServer “yourscvmmserver.yourcompany.local” | Get-SCVirtualDVDDrive | Where -Object {$_.Connection -eq “ISOImage”} | Select Name, Connection, ISO
This all can be avoided if you run it from the VMM server ;
Get-SCVirtualDVDDrive -All | Where-Object {$_.connection -notlike “” -and $_.ISO -notlike “”} | Select Name, ISO