I need a library/API allowing me to connect to a SMTP/IMAP server with authentication using powershell.
I need to adapt a powershell script that uses EWS to access an Exchange server.
This Exchange Server will be shut down and we need to adapt that script for SMTP/IMAP.
This script looks into a mailbox for inbox and sent email and search some mail from their subjects using the EWS objects.
Thanks guys, but i can't find what i need with the APIs you gave me.
Closing the question.
Related
I need to get a list of all mailboxes.
Can I get this list with EWS and PowerShell?
Exchange online shell will not be installed on the server where I run the script.
Thanks for your support
With PowerShell you can just simple call the Get-MailBox powershell command.
This is working for on-premise and O365 mailboxes as well. For O365 environment sooner or later you will need to transfer to modern authentication, but basic authentication will still work for a while. This is the easier way of I can think of.
Based on my knowledge it's not possible to list all mailboxes using entirely with EWS.
So I can successfully run commands to manage our Microsoft 365/AzureAd/Exchange Online - this involves assigning and removing license, converting user to a shared mailbox, delegating access to a mailbox, etc. I followed the guide here for authentication. But that's me actually logging in with my credentials + MFA (Multi-factor authentication) for authentication.
I want to have a script that does these type of actions triggered by a schedule. I believe I can include the credentials but how to do MFA? Tried to follow this but getting error clientid is not a guid I have registered an app in https://portal.azure.com/ and able to do Graph API calls using that. No luck in PowerShell authentication though. Any thoughts? Thanks!
Maybe try this? It should allow you to connect to all Microsoft online services and includes support for MFA. If it does not work, the website has many other scripts you can try
This is not possible. A potential solution is to set some rules where in specific case, MFA will not be required.
I am trying to access the Outlook mail to manage it through powershell script and it works fine but when script tries to access the content of mail,outlook is asking for permission to allow access to script.Is there any way so that I can allow only my script to access the Outlook mail content.
Most probably you get a standard security prompt in Outlook when accessing some sensitivity properties from the Outlook object model.
There are several ways for suppressing such prompts:
Use a third-party components for supressing Outlook security warnings. See Security Manager for Microsoft Outlook for more information.
Use a low-level API instead of OOM. Or any other third-party wrappers around that API, for example, Redemption.
Develop a COM add-in that has access to the trusted Application object. And then communicate from a standalone application with an add-in using standard .Net tools (Remoting).
Use group policy objects for setting up machines.
I am trying to get connection logs from exchange online via powershell.
I have managed to log in to exchange online with powershell, but do not know any cmdlets that would allow me to obtain a list of connections made. What I am trying to achieve is to see a log entry when someone has logged in to their mailbox and downloaded their emails. Ideally I am looking for their IP.
get-logonstatistics no longer works (exchange 2013).
Any help at all would be greatly appriciated!
For On-Premise Exchange you are looking forMailbox Transport service logs which sit in
%ExchangeInstallPath%TransportRoles\Logs\Mailbox\Connectivity
but you have to explicitly enable them first.
This article will get you started
http://technet.microsoft.com/en-us/library/bb124500(v=exchg.150).aspx
You can't really do that in O365 without raising a ticket with MS, the only available cmdlets are:
http://help.outlook.com/en-us/140/dd575549.aspx
Does any one know a way to give userA full access to userB's mailbox with the exception of one folder in the userB's mailbox using PowerShell.
Thanks in advance
You cannot use the Add-MailboxPermission cmdlet to give full access to a mailbox and then restrict access to one mailbox folder. The Add-MailboxFolderPermission is available in Exchange 2010 and up. You could try using Exchange Web Services (EWS). Read this blog, there might be code from that script you can use.
http://gsexdev.blogspot.com/2008/10/exchange-reverse-permission-audit.html#!/2008/10/exchange-reverse-permission-audit.html