Windows 2012 R2: Help with Start Up Script(s) - Mount ISO's on Startup and Share


hello,

i have windows 2012 r2 server, used virtual machines (pdc, exchange, etc)

i accomplish following , researching looking see if on right path.

1. mount 10 iso's when server reboots & starts up

2. share these mounted iso's, file server

here thoughts , hoping put together

  • use powershell script mount-diskimage
  • use powershell (check if worked, , share)
  • i apply gpo make 1 machine run thing?

here thoughts (script)

pretending purposely trying mount , share 2 specific iso's

$isovolumeone = "e:\isos\isoone.iso"
$isovolumetwo = "e:\isos\isotwo.iso"

$isoimageone = get-diskimage -imagepath $isovolumeone | get-volume
$isoimagetwo = get-diskimage -imagepath $isovolumetwo | get-volume

$isoonename = "office2016"
$isotwoname = "vstf2015"

new-smbshare –name $isoonename –path $isoimageone –fullaccess administrator -readaccess everyone
new-smbshare –name $isotwoname –path $isoimagetwo –fullaccess administrator -readaccess everyone

questions

  1. does script pretty good? (gonna try out)
  2. i thinking needed add :\ or "new-smbshare" since drive letter wouldn't enough think?
  3. how make run each time starts ups

thanks!

  1. how make run each time starts ups

you can use startup scripts or scheduled tasks.

https://technet.microsoft.com/en-us/library/cc770556.aspx?f=255&mspperror=-2147217396

https://blogs.technet.microsoft.com/heyscriptingguy/2014/05/14/use-powershell-to-create-job-that-runs-at-startup/

for scripting help i'd ask on here.

https://social.technet.microsoft.com/forums/scriptcenter/en-us/home?forum=itcg%2cwinserverpowershell&filter=alltypes&sort=lastpostdesc

 

 

 



regards, dave patrick ....
microsoft certified professional
microsoft mvp [windows]

disclaimer: posting provided "as is" no warranties or guarantees , , confers no rights.




Windows Server  >  Windows Server General Forum



Comments

Popular posts from this blog

WIMMount (HSM) causing cluster storage to go redirected (2012r2 DC)

Failed to delete the test record dcdiag-test-record in zone test.com

Azure MFA with Azure AD and RDS