PowerShell Exchange 2007 Outlook 2010 Full mailbox access except 1 folder - powershell

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

Related

Exchange Hybrid - All Remote Mailboxes - Populating msexchExternalDirectoryObjectId for get-remotemailbox

We have a hybrid exchange environment that has all it mailboxes online. ExternalDirectoryObjectId is present in the results for EXO or Azure Powershell user management tools.
However, when i run Onprem Exchange PowerShell tools such as get-remotemailbox against users, the ExternalDirectoryObjectId property is listed but blank.
I have synced msDS-ExternalDirectoryObjectId back from Azure and this populates ExternalDirectoryObjectId for local AD get-aduser commands but not OnPrem Exchange tools.
I think i need to populate the AD user property msexchExternalDirectoryObjectId but i am unsure exactly how to set this up in in AD connect or what online property to sync with?
Has anyone had this issue before and can offer any advice on how to resolve it?

Exchange online can I get a list of all mailboxes

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.

Bringing a converted user-shared mailbox to an Office 365 cloud shared mailbox

We use AD Connect to sync to O365. Within O365, we converted a user's mailbox to a shared mailbox, however, that mailbox is still connected to the user in AD. We need to detach the user with the shared mailbox and bring the shared mailbox completely in the cloud into O365.
We are trying to to do this the best way possible. The first idea is to delete the user and restore as a O365 shared mailbox.
Get-MsolUser -ReturnDeletedUsers | Restore-MsolUser
Delete user, then restore to O365 shared mailbox vs it being a converted mailbox in a hybrid environment.
You can Disable the mailbox.
Disable-Mailbox <MailboxIdentity>
When you disable a mailbox, all Exchange attributes are removed from the associated user account in Active Directory. The disconnected mailbox is permanently deleted based on the MailboxRetention property value for the mailbox database (the default value is 30 days).
refer here for more information https://learn.microsoft.com/en-us/exchange/recipients/disconnected-mailboxes/disable-or-delete-mailboxes?view=exchserver-2019
if you want to permanently delete the mailbox.
Remove-Mailbox -Identity <Identity> -Permanent $true
See here:
https://learn.microsoft.com/en-us/exchange/recipients/disconnected-mailboxes/permanently-delete-mailboxes?view=exchserver-2019#use-the-exchange-management-shell-to-permanently-delete-an-active-mailbox[enter link description here]1

Accessing a SMTP/IMAP mailbox using powershell

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.

Find owner of shared Office 365 shared mailbox with PowerShell

Is it possible to find the owner of a shared mailbox hosted in Office 365 with PowerShell as a non-admin user? I am able to find this information manually through Outlook, but that is not a feasible approach for a large number of shared mailboxes. So I thought that it must be some way to get this information through PowerShell.
It seems that Microsoft offers a lot of PowerShell cmdlets that you can run on the Exchange server itself, but I don't have admin access to it, and I don't want it either. So is this possible to solve as a normal user?