Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Mount VHD (with fallback)
#1
Brick 
The attached extension allows to mount a VHD at logon, and use it to cache (large amounts) of files efficient. This is way more efficient than using them on a (redirected) networkshare. It mounts the VHD-disk to the B:-drive (you never used it in the past years anyway, right?). After mounting, use this drive to store your cache files

One of the most practical uses for this extension would be mounting the VHD and place the Office 365 Cache files (Outlook OST, OneNote caching, ...) to this disk. But it could also be the cache for a CAD application. If the VHD could not be mounted (already in use on another system?), it SUBSTs a temp folder to hold the cache.

There are a few restrictions to this extension:
  • It uses powershell, so it will only work on Win8.x/10/Server 2012/2016
    Similar: the used simple approach of mounting it to the B:-drive does not work in Multi-user situations (RDS servers, …)
  • The demo uses a VHD on the (local) D:-trive (demo purposes)
    Change the location in the mount (@logon) and unmount (@logoff) extensions
  • The VHD has to exist, it has to be formatted and the drive assignment for the partition has to be B:
    The script only mounts the disk, it does not assign the driveletter (who extends the script). Similar the SUBST-fallback-action should be part of the mount-process, so it is a single activity. I left it separate as the SUBST can be practical in other situations as well.
  • It could be desired to have a template-copy operation.
    Create a template VHD, put it in a common location and during the mount, if the disk should be mounted but not yet exists: copy the template...
Feel free to extend this script and make it multi-user aware (by using symbolic links/mountpoints instead of a predefined driveletter)


Attached Files
.spk   Mount_User_VHD.spk (Size: 3,22 KB / Downloads: 0)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)