Hi mates,
few weeks ago a friend asked me to prepare a report that recaps every single external consultant situation.
For "situation" she meant some information that could help her to have a quick view on the status of the account, expiration date and who's internally responsible to "manage" the partner.
Having a lot of project "on going" she wanted to be sure that all nominal accounts have a related internal manager defined.
Since she usually put an expiration date for consultants she wants to be sure that every single manager receive, weekly, a report that
shows what's the current situation.
So first of all I've defined few variables, then putted them inside an array.
After I've retrieved the crucial information that I need (for example she wanted to exclude disabled users)
querying a specific OU.
At this point I've created the loop : for each manager scan the list of the users captured before.
If the manager's name is the same of the Manager that I'm streaming (first part of the loop)
take it in consideration and add it, with all other info, to the hash table created before.
After that I've piped the container to an external CSV and I've resetted some variables for the next loop (starting always from the manager).
Next you have one the my favourite CSS style used to format the output, and at the end the final loop, starting always from the managers,
that send an email to each single internal reference with the CSV attached and in a table format inside the body of the email.
No complications, no tricks, only the essential.
Hope this helps.
See you soon.
No comments:
Post a Comment