- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-24-2022 06:51 AM
I need to automate some Distribution List tasks via ServiceNow however given the minimal work, the cost for the IntegrationHub module will not be approved internally.
I have PowerShell scripts that can do all I need and flow designer plan in place however I can't get SNOW to connect to Exchange Online so the powershell scripts can run without a pasword being hardcoded.
I would prefer an OAuth connection or something similar however happy to have a credential stored in SNOW if required.
The PowerShell will be stored in ServiceNow and executed on one of our 4 Mid Servers.
If I execute the Powershell independently, I need to get the credentials and establish the connection
$Credentials = Get-Credentials
Connect-ExchangeOnline -Credential $Credentials
Can someone please help he setup the trust relationship between SNOW and Exchange Online so the code can execute without additional authentication?
Solved! Go to Solution.
- Labels:
-
flow designer
-
Orchestration

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-07-2022 01:06 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-07-2022 01:06 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-06-2022 03:30 PM
Hi Mark,
I would like to do the exact same thing. Can you share with me how you're doing this? I assume you are creating a connection and credential alias that contains the o365 admin account username and password and an action in Flow designer with a poweshell script step that utilizes a midserver script file with the aformentioned connection alias. Or is that totally wrong. Any information you could provide would be extremely helpful. Thank you in advance!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-11-2022 08:56 AM
Hi Damion
Happy to help. The setup is pretty convoluted given the limitations in MS Graph API. I had to do it in 2 parts. Took me a few weeks to do.
1st: I setup 2 connection's and Alias's
One for MS Graph connection
One for direct Powershell connection on the Mid server
2nd: Setup the credentials
One for the MS Graph connection and it is an OAuth one
No need for one for the Powershell connection
3rd. Installed a certificate on each midserver with a certificate thumbprint
So to get connect and get the information
To read all the information I used a SOAP streaming action (command built using MS Graph explorer) and stored in custom tables (we have over 10,000 so did not want to mess up the groups table but you can use that if you want)
1 table for the DL, One for the user members and one for the nested DL groups
You can't use MS Graph explorer to update the DL's unless they are O365 groups which these are not....
I wrote a powershell action that connected to Exchange online using the certificate thumbprint loaded on to the mid server
I could provide more details on the connections and commands I built if you need it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-03-2024 05:12 PM
Link to SNOW KB results in "Knowledge record not found", 😞