Question

I am trying to launch outlook from PS, but I get 3 areas of code that ask for me to Allow or Deny to proceed. Is there a way to bypass these warnings? My group's status on the domain is a slightly stripped down version of a Domain Admin.

$ol = New-Object -comObject Outlook.Application
$mail = $ol.CreateItem(0)  
$Mail.Recipients.Add("me@me.com")
$Mail.Subject = "PS1 Script TestMail" 
$Mail.Body = " PS Test "
$Mail.Attachments.Add("C:\scripts\test.txt")
$Mail.Send() 
Was it helpful?

Solution

You either need to make sure an up-to-date anvirus product is installed (if you can control the client environment) or use Redemption or Clickyes to work around the security prompts. See http://www.outlookcode.com/article.aspx?id=52 for more details.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top