Forum Discussion
Create Power BI Gateway restart Automation script by power shell
- 3 months ago
Happy to help clarify.
From address => This is just the sender name that appears in the email, it doesn't have to be a real mailbox, but it should look professional, just replace [email protected] with your actual company domain, something like [email protected] you can think of it like a "no-reply" email address.To address => You already have this right, just put your admin group email [email protected] there and everyone in that group will receive the alert.
SMTP & Port => Since you're on Office 365, keep smtp.office365.com and port 587 as they are, these are Microsoft's default settings for sending emails securely, nothing to change here.
Credentials => Use your admin account that has an Office 365 mailbox and to avoid the script asking for your password every time it runs, do this once:
Get-Credential | Export-Clixml -Path "C:\Scripts\gateway-cred.xml"
Then swap
(Get-Credential) in the script with:Import-Clixml -Path "C:\Scripts\gateway-cred.xml"You would not need Azure App Registration at all for this setup.
Did it work? 👍 A kudos would be appreciated
🟨 Mark it as a solution to help spread knowledge 💡
Happy to help clarify.
From address => This is just the sender name that appears in the email, it doesn't have to be a real mailbox, but it should look professional, just replace [email protected] with your actual company domain, something like [email protected] you can think of it like a "no-reply" email address.
To address => You already have this right, just put your admin group email [email protected] there and everyone in that group will receive the alert.
SMTP & Port => Since you're on Office 365, keep smtp.office365.com and port 587 as they are, these are Microsoft's default settings for sending emails securely, nothing to change here.
Credentials => Use your admin account that has an Office 365 mailbox and to avoid the script asking for your password every time it runs, do this once:
Get-Credential | Export-Clixml -Path "C:\Scripts\gateway-cred.xml"
Then swap (Get-Credential) in the script with:
Import-Clixml -Path "C:\Scripts\gateway-cred.xml"
You would not need Azure App Registration at all for this setup.
Did it work? 👍 A kudos would be appreciated
🟨 Mark it as a solution to help spread knowledge 💡
Hi v-nmadadi-msft , DataVitalizer I have another doubt can I use my email and password in the Get credential or use admin account O356 mail box like [email protected] and password or something else.