Leave a Reply

4 comments

  1. was looking around for something to do this for a good while before coming across your post – thanks a lot for sharing! Worked perfectly

    sohungee Reply

  2. Very useful post Mark, It would be great if i could some how get the path of the ISO, My problem is I have a iso file with very large name when it is copied to host its name is correct in the path but SCVMM restricts it to 64 characters so when I tried to mount with the full file name it is unable to find the file name. is there a way to find out the path of iso and check if it contains the file name and mount instead of checking for name some thing like $_.Path.contains(MYfilename). Pardon my language, waiting for response

    Hussain Reply

    • Hi Hussain, To list the SharePath or the folders you could try something like the following:
      Get-VirtualDVDDrive -VMMServer [YourVMMServer] -All | Where-object {$_.ISO -ne $null} | select-object Name, ISO, ISOLinked, @{Name="SharePath";Expression={$_.ISO.SharePath}}, @{Name="Directory";Expression={$_.ISO.Directory}} | Sort-object -Property Name | Out-GridView

      In this case I ported the results to a gridview to get a better view. You need powershell ISE on the machine where you run this command to display the grid. It will also work without the ‘Out-Gridview’.

      As for the mounting part, you could use a partial match of the filename of pathname if you are positive this will only return one result.
      This can be done as follows:
      $ISO = get-ISO | where-object {($_.Name -match ‘[PartOfFileName]’) -and ($_.LibraryGroup -eq ‘[YourLibrarygroup]‘)}
      OR
      $ISO = get-ISO | where-object {($_.SharePath -match ‘[PartOfFileName]’) -and ($_.LibraryGroup -eq ‘[YourLibrarygroup]‘)}

      The above commands look almost similar to the original ones in the post, except for the ‘-match’ instead of ‘-eq’.

      Hope this helps,
      Mark

      Mark Wolzak Reply

  3. Thanks a lot Mark. You saved me a lot of time.

    Ilkin Jamalli Reply