Many ways to send an Email with PowerAutomate/Flow

Hi All,

There are many ways to send Emails from PowerAutomate (aka Flow).
In this Blog Article i will show you three ways to send an Email.
I reccomend to use Variant 2 and use your M365 Mailbox to send Emails.

Variant 1 - Sendmail

Create a new Cloud Flow


Manual Trigger and Flowname is "Demo01"


Add a Step


Search for: "Mail"
And select "E-Mail-Benachrichtigung versenden (V3)"


Apparently this is done by Sendgrid Infrastructure so i have to accept


Then i can add the Recipient, Subject and Messagebody.
Save the Flow and go back to "My Flows"


Let's run that Flow





If you look at the Details - it didn't work


There is an Error


Flow connectors Sendmail


Microsoft does not recommend to add IP's or Senders to be added to an Allowlist.
So it's odd they recommend it here

If you want to Configure that it's in the Antispam Policies in the Connection Filter Policy


Variant 2 - "Send Email (Office365)"

Create a new Cloud Flow "Demo02" with a Manual trigger


Add a new Step


Search for "Email" and select "E-Mail senden (V2)" Office 365 Outlook.
This requires an M365 Mailbox.


Now you can add the Recipient, Subject and Mailbody


Let's run that Flow





The Email is sucessfully sent over my M365 Mailbox. Even see the Item in my "Sent Items" Folder.


Variant 3 - Sendgrid

You can send Mails via Sendgrid. How to setup Sendgrid in Azure i've alredy blogged about that

Setup SendGrid Mail Service in Azure




Hope you learned something today.

Regards
Andres


Detect if your PowerShell code is running in Windows Terminal

Hi All,

Ever wanted to detect if your PowerShell Script is running in a WindowsTerminal Session?
As you can see, the default Font is a bit bigger than in the other PowerShell Windows

Here is some code to detect that

if ($env:WT_SESSION) {
    Write-Host "Windows Terminal detected"
} else {
    Write-Host "Windows Terminal not detected"
}


Windows Terminal


PowerShell 5


PowerShell 7


PowerShell ISE



Regards
Andres Bohren


Exchange Managed Availability

Hi All,

Since Exchange 2016 the Monitoring of Exchange is built in and is based on "Managed Availability"

Managed availability


To get an overview of your Exchange Environement use the following Command

#Get Exchange HealthReport
Get-HealthReport -Identity $env:Computername | where {$_.state -ne "NotApplicable"}



Show all Components from a specific Server that are not Healthy use the following command

Get-ServerHealth -Identity $env:Computername | where {$_.CurrentHealthSetState -ne "NotApplicable" -AND $_.AlertValue -ne "Healthy"}


Let's dig into the Error

Get-ServerHealth -Identity $env:Computername | where {$_.CurrentHealthSetState -ne "NotApplicable" -AND $_.AlertValue -ne "Healthy"} | fl


You can find the Monitoring Events also in Eventviewer


I've fixed the Problem with a Certificate that has a Subject Alternative Name that contains the specified Hostname

Now let's restart the Service "Microsoft Exchange Health Manager

Restart-Service MSExchangeHM


The Tests giving positive Results back


But it takes a while until all tests have been completed. While that time the AlertValue is "Unknown"

Get-HealthReport -Identity $env:Computername | where {$_.state -ne "NotApplicable"}


After a few Minutes all Alert Values are Healthy

Get-HealthReport -Identity $env:Computername | where {$_.state -ne "NotApplicable"}


Same applies to Get-ServerHealth. It takes about 10 to 15 Minutes until all Tests have been invoked

Get-ServerHealth -Identity $env:Computername | where {$_.CurrentHealthSetState -ne "NotApplicable" -AND $_.AlertValue -ne "Healthy"}


Let's do a final check - yes we're all set.

Get-ServerHealth -Identity $env:Computername | where {$_.CurrentHealthSetState -ne "NotApplicable" -AND $_.AlertValue -ne "Healthy"}



Regards
Andres Bohren


Microsoft Teams TimeZone Settings

Hi All,

Did you notice the Timezone Information in your Teams Contacts within your Organization.
But where does that come from?


The User can set the Timezone in his Account Settings



Basically it's the Timezone from Exchange/Outlook. You can set that in Outlook on the Web


You can show a List ov available Timezones with the following Command

$TimeZone = Get-ChildItem "HKLM:\Software\Microsoft\Windows NT\CurrentVersion\Time zones" | foreach {Get-ItemProperty $_.PSPath}; $TimeZone | sort Display | Format-Table -Auto PSChildname,Display



Let's look at the Timezone Settings of the Account

Get-MailboxRegionalConfiguration -Identity m.muster@icewolf.ch


Let's change it to Russion Standard Time (UTC+3)

Set-MailboxRegionalConfiguration -Identity m.muster@icewolf.ch  -TimeZone "Russian Standard Time"
Get-MailboxRegionalConfiguration -Identity m.muster@icewolf.ch



By the way, if you change the TimeZone, you probably also want to change the Timezone here

Set-MailboxCalendarConfiguration -Identity m.muster@icewolf.ch -WorkingHoursTimeZone "Russian Standard Time"
Get-MailboxCalendarConfiguration -Identity m.muster@icewolf.ch


The Timezone has also changed in the Accountsettings of the User and in Outlook on the Web



It takes several hours before the changed TimeZone is visible in the Teams Contact

We're in " W. Europe Standard Tim" UTC +1 but it's summer Time (+ 1 Hour).
We end up having 1 Hour diffrence to "Russian Standard Time" (UTC +3).



Regards
Andres Bohren



Enable Tenant-level Analytics in Power Plattform (Preview)

Hi All,

Since a few Days you can enable Tenant-level Analytics in Power Plattfom as a Preview Feature.

Tenant-level analytics (Preview)

Power Plattform admin center





Now you have to wait 24 Hours. After that you can switch between "Tenant level analytics" and "Environement level analytics"


Yo can see better Screenshots (with data) from the Article below

Tenant-level Analytics for Power Apps (preview)



Regards
Andres Bohren


Exchange Redirect in Messagetrace

Hi All,

Recently i had a call from a Collegue. He had the following Scenario:
An Email was redirected via Exchange Transport Rule (ETR)
Something similar to this one


When you now look at the Messagetrace you will see Events like that:
Receive
Transport Rule
Redirect
Fail
Drop

He was a little concerned about the Fail and Drop Events. But that's absolutely fine. Redirect means, the Mail will not reach the orginal Recipient - therefore Fail and Drop.

Get-MessageTrace -StartDate (get-date).AddDays(-4) -EndDate (get-date) -RecipientAddress m.muster@icewolf.ch | where {$_.subject "Test Redirect"}

Get-MessageTrace -StartDate (get-date).AddDays(-4) -EndDate (get-date) -RecipientAddress m.muster@icewolf.ch | where {$_.subject -eq "Test Redirect"} | Get-MessageTraceDetail | Sort-Object date | fl


If you check Messagetrace for the Redirection Address you will see the delivery Event.

Get-MessageTrace -StartDate (get-date).AddDays(-4) -EndDate (get-date) -RecipientAddress andres.bohren@gmail.com

Get-MessageTrace -StartDate (get-date).AddDays(-4) -EndDate (get-date) -RecipientAddress andres.bohren@gmail.com | Get-MessageTraceDetail | Sort-Object Date


If you look at the details you see the Send External 250 ok

Get-MessageTrace -StartDate (get-date).AddDays(-4) -EndDate (get-date) -RecipientAddress andres.bohren@gmail.com | Get-MessageTraceDetail | Sort-Object Date | fl



Regards
Andres Bohren


Microsoft Teams Camera Brightness and Soft-Focus Filters

Hi All,

Did you notice, that you can adjust the Camera Settings in Teams?
I am running Teams in the Preview Mode and have the following Settings there: "Brightness" and "Soft focus"


I think that's a good improvement.


You can even activate that when you join a Meeting. Click on the gear Icon and then the change it in the Device Settings Menu on the right hand side.



Regards
Andres Bohren


Microsoft.Graph PowerShell Modules 1.9.5 released

Hi All,

Yesterday Microsoft has released a new Version of theyr Microsoft.Graph PowerShell Modules. Just a few days after releasing 1.9.4... I like the fact that they fixed a bug in "user-agent", but maybe it shows somee missing quality control.

Microsoft.Graph 1.9.5

Release notes

Check the installed module and what's published in PowerShell Gallery

Get-InstalliedModule Microsoft.Graph
Find-Module Microsoft.Graph


If you uninstall the Microsoft.Graph Module, you don't uninstall the sub modules

Uninstall-Module Microsoft.Graph
Get-InstalledModule Microsoft.Graph*


I've created a Script on my GitHub Repo to clean up the Microsoft.Graph Modules


Even it did throw an Error due to dependent Modules it worked at the end

Get-InstalledModule Microsoft.Graph*



Regards
Andres Bohren


MicrosoftTeams PowerShell Module 4.2.0 released

Hi All,

Did you notice, that there is already a new Microsoft Teams PowerShell Module Available?
Microsoft Released 4.2.0 into GA.Two Weeks ago they published 4.1.0.

I like the Fact that they fixed issues. On the other Hand, they might invest a bit more in Quality Control and don't have to release that often.


For Installing use "Install-Module". If you want Side-By-Side (Multiple Versions of the Module) then you need to use the "-Force" Parameter

Find-Module MicrosoftTeams
Install-Module MicrosoftTeams -Force


My usual Testpattern

Connect-MicrosoftTeams
Get-Team
Get-CsOnlineUser -Identity a.bohren@icewolf.ch | fl *Ent*,*host*,*voice*, *um*



To be honest i am a bit worried about the cadense of theyr releases.
How should we keep up with that especcially in Automation?



I've also tested to sign-in with Accesstokens and Application Permissions (Not Delegated as in the Connect-MicrosoftTeams) Article - still no luck. Me and some customers are waiting for that since more than a Year!

Connect-MicrosoftTeams



Regards
Andres Bohren