In order to be able to write events into the Windows Application Event log a provider (source) is needed. This is created transparently for the user at the first run of the script. This source can be removed using the same script if the user desires so (i.e. to address a naming conflict).
The script creates a catalog of the available Shadow Copies and removes those older than the desired number of days.
-olderthandays
Default value = is two days.
-currentdate
Default value is the time the script is ran
-mysource
Default CustomShadowsManager Windows Alert Event source under which the script events are fired.
-removesource
may be used in conjunction with the -mysource parameter. Removes the desired event source
.\manageShadows
(all Shadows copies older than 2 days from the moment the script is launched are removed. If needed a source with the name of CustomShadowsManager is created; otherwise the new generated events are logged under the CustomShadowsManager source)
.\manageShadows -olderthandays 30 -mySource "newCustomShadowsRemover"
(all Shadows copies older than 30 days from the moment the script is launched are removed. If needed a source with the name of newCustomShadowsRemover is created; otherwise the new generated events are logged under the newCustomShadowsRemover source)
.\manageShadows -removesource
(the CustomShadowsManager is removed and the script exits)
.\manageShadows -removesource -mysource "customsource"
(the customsource is removed and the script exits)
The script is attached to this KB.
To Schedule the task execution using Windows Task Scheduler, use this Knowledge Base Article
Disclaimer: This script is provided "as is" for the purpose of illustrating how RpidRecovery/AppAssure tasks may be performed in conjunction with Powershell. Quest Software shall not be liable for any direct, indirect, incidental, consequential, or other damage alleged in connection with the furnishing or use of this script or of the principles it demonstrates.
© ALL RIGHTS RESERVED. Feedback Terms of Use Privacy Cookie Preference Center