I want to send daily reminders to users who have tasks assigned to them. It seems like a simple way to do this would be to write a Powershell script that sends an email for each item, and set up a scheduled task to run the script once a day. However, the script below returns something like 1;#John Doe
(full name) for each item.
Is there a way to get the user's email address, or Windows username, from the task list item using Powershell? I think there must be, since SharePoint is able to send mail to the assignee when the task is created.
$web = Get-SPWeb http://mysharepointsite
$list = $web.Lists["Task List Test"]
foreach ($item in $list.items)
{
if ($item["Status"] -ne "Completed")
{
write-host $item["Assigned To"]
}
}