Notification

I'm running a computer clean up that deletes computers that haven't logged on in over 90 days. How do i add to the notification how many machines were deleted? I'm using Active Roles 7.3. 

  • Can you share a bit more about how you have implemented this cleanup?  For example, are you using an AR workflow to search for machines to be deleted?  If yes, then you could leverage the notifications built-in there.  Otherwise, a bit of Powershell might be needed.

  • Yes, I'm using and AR workflow. I have the notification set and it alerts me once the job completes but that's all it states. I would like to see the machines and or the number of machines it deleted on the notification. 

  • I don't think that this would be possible through "conventional" means, meaning that I don't believe that there would be any way to accomplish this through the UI.

    That said, it strikes me that it could be possible, but no guarantee without testing. You could have a notification event that included a scripted component that queried the edsvaRunHistoryReportXML attribute of the workflow. One possible problem that such an attempt might encounter is that this attribute may not necessarily be updated until all of the activities contained in the workflow are completed - which means after your notification activity has executed. If you encountered that problem, then I would probably do something like have Workflow 1 launch Workflow 2 as the final activity in the workflow (Workflow 2 containing your notification event), but making sure that the workflow is launched asynchronously by using something like Register-ScheduledJob (to prevent Workflow 1 from waiting for Workflow 2 to complete before completing and updating run history).

    Maybe there is an easier way; that's just what came to mind off hand for me.

  • You could make yourself an additional very simple AR workflow that triggers on computer deletes (that would be your start condition - note that in your start condition you might also have to look for the specific account that is performing the deletes).  Within this new workflow, just add a script activity containing the following policy script:

    Function RecordComputerDeletion ($Request)

    {

    $DeletedComputerName = $Request.DN

    Add-Content C:\Temp\MyComputerDeleteLog.txt $DeletedComputerName

    }

    It's not a full solution but I think it will give you some food for thought.  Slight smile