Is there a way to incorporate the BES Expired Computer Remover utility to run every week and email out a summery of computers deleted based on retrieved property in Web Reports? I don’t need to see individual computer names.
We have created our own retrieved property based on which school or dept they belong to.
So the email output would look something like this:(department name first then number of computers deleted)
Computers Deleted that have not reported in the last 45 days:
Group:
School of Education(45)
School of Medicine (100)
School of Humanities and Science (30)
School of Engineering (20)
Law School (10)
Graduate School of Business (50)
I was thinking I could run it as a scheduled task on the server and separately have a custom report run on web reports prior to the job running, but if there is a all in one solution that would be better.
You could modify the duplicate removal script to grab this data from the database and send an email, but that involves some programming work… Like you said, you can create a scheduled report that gets this info. Create a custom report that looks like this:
Computers Deleted that have not reported in the last 45 days:
<?Relevance unordered list of ( it & " (" & multiplicity of it as string & ")") of unique values of values of (results (bes property "Department Name", it)) of bes computers whose (last report time of it < now - 45 * day)?>
Change the bes property “Department Name” to whatever your property is called. Let me know if that works for you.
It does work and it doesn’t at the same time. When I try to replace department name with my Global Retrieved Property it comes up blank. If I use any other property (OS, Relay, Client Administrator, …) they all seem to work fine. I wonder if something is preventing our retrieved property from being queried.
My relevance needs some tweaking and was hoping another pair of eye could help…
I am getting an error…
<?Relevance unordered list of (it & " (" & multiplicity of it as string & ")" ) of unique values of values of ((if ((exist bes property whose (name of it = "SU Group" ) AND exists result from (bes property whose (name of it = "SU Group" )) of it AND exists value of result from (bes property whose (name of it = "SU Group" )) of it)) then (value of results from (bes property whose (name of it = "SU Group" )) of it) else ( "N/A" ))) of bes computers whose (last report time of it < now - 45 * day) ?>
I think this version will work even when a result doesn’t exist for the property. It will error if the property doesn’t exist at all.
<?Relevance unordered list of (it & " (" & multiplicity of it as string & ")") of unique values of values of results (bes property "SU Group", bes computers whose (last report time of it < now - 45 * day)) ?>
You might have to add one check for existance of a value of the result:
<?Relevance unordered list of (it & " (" & multiplicity of it as string & ")") of unique values of values of results (bes property "SU Group", bes computers whose (last report time of it > now - 45 * day)) whose (exists value of it) ?>
The last thing that might cause an error would be a missing ‘last report time’ value:
<?Relevance unordered list of (it & " (" & multiplicity of it as string & ")") of unique values of values of results (bes property "SU Group", bes computers whose (exists last report time of it AND last report time of it > now - 45 * day)) whose (exists value of it) ?>
I’d be curious which of these 3 version work for you. Will you let us know how you fare?
I think you have one too many “values” in there, but this way might be a bit easier… Try this:
<?Relevance unordered list of ( it & " (" & multiplicity of it as string & ")") of unique values of values of (results (bes property "SU Group", it)) whose (exists value of it and error flag of it = false) of bes computers whose (last report time of it < now - 45 * day)?>
Sorry for not giving you an “error-checked” version when I first gave the relevance.
<?Relevance unordered list of (it & " (" & multiplicity of it as string & ")") of unique values of values of results (bes property "SU Group", bes computers whose (last report time of it < now - 45 * day)) ?>
and Ben’s last sample
<?Relevance unordered list of ( it & " (" & multiplicity of it as string & ")") of unique values of values of (results (bes property "SU Group", it)) whose (exists value of it and error flag of it = false) of bes computers whose (last report time of it < now - 45 * day)?>
They both ended in the same results. The numbers on some of the groups were off by one or two compared to the console. I was wondering how for the last report time would be treated? (included or not included into these numbers) I also figured maybe the web reports cache and was not 100% synced with the BES DB.
The other 2 samples that Jesse sent to me ended up giving me a total count of computers in their respective groups.
I was wondering would there be a way to add one more line in either the above codes to give me a total count?
Right now the reports looks like:
Dept A (5)
Dept B (3)
Dept C (8)
Total (16) <------can we add this to the end or similar?