Hi All,
I'm trying to have a scheduled task email the helpdesk a list of machines from AD that have no description. I created a script and it runs the way I want it to however I stupidly ran it in the Adaxes scheduled task without realising that the task runs on each object. I only need to script to run once each day and I dont need it ot run on an object. I'll paste in the script below so you can see what I've done. I converted this script from powershell ISE to work with adaxes so I changed the module and command, my original command was just Get-Adcomputer.
Import-Module Adaxes
$nodesc = Get-AdmComputer -Filter * -Properties description,name| Where-Object {$_.description -Like ""} | Select -Property Name,description | out-string
Send-mailmessage -From someemail@somedomain.co.uk -To helpdesk@somedomain.co.uk -SmtpServer "exchangeserver.somedomain.co.uk" -Subject "No AD Description Machines" -body $nodesc
Obviously the helpdesk recieved alot fo emails when I ran the task haha! :O
Is there a way to have Adaxes retrieve the list of all no description machines and put that list into just one email. Id like to run that in scheduled task if possible.
Many thanks,
Will