Rob Chartier ~ Contemplation...

.NET, C#, Work, etc.

News

www.flickr.com
This is a Flickr badge showing public photos from Rob & Kat Chartier. Make your own badge here.


Website Counter

Even Quicker Links

Virtual Server : Attach an ISO as a DVD Drive (Scripting)

Here is a quick function I put together:

'Name is the name of the virtual machine itself
'ISOPath is the full file path to the ISO
function AttachISOAsDVD(Name, ISOPath)

 on error resume next
 Set objVS =  CreateObject("VirtualServer.Application")
 Set objVM = objVS.FindVirtualMachine(Name)
 'add the new DVD ROM
 set objDVDDrive = objVM.AddDVDROMDrive(0,1,0)
 'attach the ISO
 objDVDDrive.AttachImage(ISOPath)

 'clean up
 set objDVDDrive = nothing
 set objVM = nothing
 set objVS = nothing

end function

More scripts can be found here at the Script Repository: Virtual Server.  If you notice there is a link in the Script Repository under Virtual Hard Disks to Add a DVD Drive to a Virtual Machine which is broken, it forwards you to the "Add a Hard Disk Connection to a Virtual Machine".  The function I posted above should be good enough to help with that if you need it.

 

Comments

No Comments

Leave a Comment

(required) 

(required) 

(optional)

(required)