Mount vhd file at startup on DC.
I am trying create startup script for mount vhd file in Windows Server 2008 R2. This is DC. 1. Create a VHD on a network share. 2. Create config for diskpart.exe: SELECT VDISK FILE="\\FS\DC\dc-backups.vhd" ATTACH VDISK 3. Create scheduled task. User DOMEN\bck is member of Server Operators and BackupOperators: <?xml version="1.0" encoding="UTF-16" ?> - <Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task"> - <RegistrationInfo> <Date>2010-10-15T12:02:37.6059935</Date> <Author>DOMEN\admin</Author> </RegistrationInfo> - <Triggers> - <BootTrigger> <Enabled>true</Enabled> </BootTrigger> </Triggers> - <Principals> - <Principal id="Author"> <UserId>DOMEN\bck</UserId> <LogonType>Password</LogonType> <RunLevel>HighestAvailable</RunLevel> </Principal> </Principals> - <Settings> <MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy> <DisallowStartIfOnBatteries>true</DisallowStartIfOnBatteries> <StopIfGoingOnBatteries>true</StopIfGoingOnBatteries> <AllowHardTerminate>true</AllowHardTerminate> <StartWhenAvailable>false</StartWhenAvailable> <RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable> - <IdleSettings> <StopOnIdleEnd>true</StopOnIdleEnd> <RestartOnIdle>false</RestartOnIdle> </IdleSettings> <AllowStartOnDemand>true</AllowStartOnDemand> <Enabled>true</Enabled> <Hidden>false</Hidden> <RunOnlyIfIdle>false</RunOnlyIfIdle> <WakeToRun>false</WakeToRun> <ExecutionTimeLimit>P3D</ExecutionTimeLimit> <Priority>7</Priority> </Settings> - <Actions Context="Author"> - <Exec> <Command>C:\Windows\System32\diskpart.exe</Command> <Arguments>-s "C:\vhdmount.txt" > "C:\vhdmount.log"</Arguments> </Exec> </Actions> </Task> 4. When I run this task, I see messages in task log, but disk is not mounted : Task Scheduler successfully completed task "\Mount VHD disk for backups at startup" , instance "{8a2d4061-ffbb-4f75-89d7-f508800fd131}" , action "C:\Windows\System32\diskpart.exe" with return code 2147942405. I think this issue with permissions and add this user to "Perform volume maintenance tasks" in Default Domain Controller Policy, but issue not solved. What permissions are needed to perform this action on DC?
October 15th, 2010 5:35am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics