Showing results for 
Search instead for 
Did you mean: 

Alternate to webmail for auditlogs

I am trying to use PowerShell script to download Auditlogs. 

In the script, we have one line which connects to outlook webmail.


$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri -Credential $UserCredential -Authentication Basic -AllowRedirection
Import-PSSession $Session



Webmail's are blocked by my company, so is there any other alternatives that I can use to get this script woring? 

Status: New

Hi @yash1105,


From this article, you can see the script requires connecting to Exchange Online. In your scenario, please contact your IT admin to whitelist Exchange online connection for you. 


Besides to run script get audit log, you can also access your audit log via Office 365 admin center:


Best Regards,
Qiuyun Yu 


@v-qiuyu-msft: Thank you for the reply.


I have already checked with my security team. 

And they mentioned that they cannot whitelist webmail, just for this purpose. And asked me to reachout to MSFT to check if there is any alternative URL to use for on-premises. 


I am already getting the logs manually from the O365 admin portal.

But I want to automate this to put the data in my database. 


Is there any other alternative that I can use to schedule to push the PBI audit logs into my SQL Database on-premises ?