Good day fellows,
I am seeking your assistance in troubleshooting the attached script. This what i'm trying to accomplish:
- Get created time for the VM in order to see how many days the VM has been in production to-date
- Send an email to the business owner if the VM has been deployed for more than a year based on information from Custom Fields. The server (s) Business Owners (BO) are contacted only if the server has been deployed over 365 days AND if they have not been contacted (see Custom Field below, with a value of either "Yes" or "No)
Information on the Custom Fields:
- Application
- Contacted
- Decommission_date
- Business_Owner
- BO_email
- Business_Owner2
Issue:
- Unable to retrieve the value of the "Contacted' CustomField. Though i know how to query the value, i cant get it to compare against another string
- Same as above except that's for the email address value
I've attached the script i've been working on for your review. Your assistance on this will greatly appreciated!!
Attachments:
- Contactowners.ps1 (2.1 K)