Imagine a scenario where you need to monitor a folder for specific file extensions so that when all of the file extensions you are expecting are present, the next action in Orchestrator will be kicked off. Opalis had the capability to perform this as it performed an ‘AND’ for ‘Folder Monitor’, but in Orchestrator this has been changed to an ‘OR’ operation. So how can we do this today?
Simple: Place a ‘Monitor File’ in a Runbook and under ‘Details’ enter the path to watch and a file extension of ‘*.*’. Then under ‘Triggers’ place a check in ‘Created’. To the right of ‘Monitor File’ place a ‘Run .Net Script’ activity. Under ‘Details’ choose ‘PowerShell’ as the type, then enter the following script. In this example we are monitoring the ‘C:\Temp’ directory. ‘$test’ in the script is the case sensitive variable name you will use in the next step.
set-location -path c:\temp
$test = (Test-Path *.fund) -and
(Test-Path *.rating) -and
(Test-Path *.position) -and
(Test-Path *.issuer) -and
(Test-Path *.security) -and
Under ‘Published Data’ click ‘Add’. Under ‘Name’ create a variable name to capture output. Under ‘Variable Name’ enter a variable that will be used; do not place a $ in front of the variable name; the variable name is case sensitive.
To see the results of the script choose the ‘Details’ tab. Under ‘Summary’ or ‘Details’ right click and choose to subscribe to ‘Published Data’. A ‘Published Data’ window will pop up. Choose the variable name you created previously here. Results of the run will show up under ‘Events’ in Orchestrator Designer.
Jonathan Jordan | Senior Support Escalation Engineer | Management and Security Division
App-V Team blog: http://blogs.technet.com/appv/
ConfigMgr Support Team blog: http://blogs.technet.com/configurationmgr/
DPM Team blog: http://blogs.technet.com/dpm/
MED-V Team blog: http://blogs.technet.com/medv/
Orchestrator Support Team blog: http://blogs.technet.com/b/orchestrator/
Operations Manager Team blog: http://blogs.technet.com/momteam/
SCVMM Team blog: http://blogs.technet.com/scvmm
Server App-V Team blog: http://blogs.technet.com/b/serverappv
Service Manager Team blog: http://blogs.technet.com/b/servicemanager
System Center Essentials Team blog: http://blogs.technet.com/b/systemcenteressentials
WSUS Support Team blog: http://blogs.technet.com/sus/
The Forefront Server Protection blog: http://blogs.technet.com/b/fss/
The Forefront Endpoint Security blog : http://blogs.technet.com/b/clientsecurity/
The Forefront Identity Manager blog : http://blogs.msdn.com/b/ms-identity-support/
The Forefront TMG blog: http://blogs.technet.com/b/isablog/
The Forefront UAG blog: http://blogs.technet.com/b/edgeaccessblog/