Envoke Exchange Mnagement shell?


I need to run a script that utilze Exchange mgmt shell. Is it somehow possible to envoke the shell via syncro?

Edit: I mean on Onprem Exchanges

As of the last Exchange server I worked on you had to add the PS Snap in (PS v1 version of modules), to your current session to get all the exchange cmdlets. This should work for 2013/2016/2019

Add-PSSnapin Microsoft.Exchange.Management.PowerShell.SnapIn

For more detail this blog goes into a bit more detail Load Exchange Management Shell in PowerShell ISE - ALI TAJRAN



Can you tell me what i am doing wrong here?

Import-Module $env:SyncroModule

Add-PSSnapin Microsoft.Exchange.Management.PowerShell.SnapIn

$MitigationsEnabled = Get-OrganizationConfig | fl *mitiga*

Set-Asset-Field -Name "Exchange MitigationsEnabled" -Value $MitigationsEnabled

Its not working. Not even when I use Backgrounding tools - Powershell

Edit: Its working. I just had to choose an exchange that infact had mitigitions enabled else the field is empty - Thanks