Use Powershell to list all mailbox users contacts from their contact folder with all attributes - powershell

I am on Office 365 and I (Admin of the site) have to run a query that takes a users mailbox (e. g: 'john.doe#example.com') and lists all of its contacts from the contact folder with all available attributes like name, email-address and so on. After searching heavily with Google and co. I found nothing regarding powershell handling contacts except importing and exporting. Is there a way?

You need to use an API like Exchange Web Services to access that level of information. You can use the EWS Managed API from Powershell. As it turns out, Glen Scales has a good write-up on exporting contacts that way.

Related

Shared Contacts from a Mailbox in outlook Permissions

I have a problem with a shared user account that I need some help with:
In outlook, we use a user mailbox for our company contacts that I have restricted to be only accessible by a few people. Problem is that some people need access to this and we put the account on their phone, but then they have full control and can add and remove contacts at will.
Is there a way to restrict (for example an iPhone) access to the outlook account to be read only?
I have tried using the ECP (no applicable settings) and made the user a "reviewer" to their own box, but the phone still has full access.
The problem with access from a phone is that the build and applications and even the Outlook app for iPhone and Android doesn't have the ability to access Shared Mailboxes.
So the only way of getting it working on a phone, outside of having the users open the webmail which is not a nice experience on a mobile devices despite Microsofts best efforts, is to give the mailbox an Exchange license and provide the user with a username and password for the mailbox.
However doing this will give the user full access to all folders in the mailbox.
I would recommend a solution like
CiraSync, where you could sync contacts between folders directly to the users own mailbox or from the GAL directly to the users.
I would recommend other vendors that does the same but this is the only vendor that I have tested myself on customers and I have good experiences with.

Powershell script to create Contacts inside Exchange account?

Is it possible with Powershell to create Contacts inside a Exchange account?
Im not talking about creating a Contact in Active Directory, but a contact in the Exchange account there will be visable by Outlook, Webmail, and Mobile sync.
The reason for this, is that a customer wants a easy way to deploy some static adresses, without the use of using contacts in the Global Address list.
You can do this using the EWS Managed API library with Powershell for this, I have a module on GitHub which should work okay https://github.com/gscales/Powershell-Scripts/tree/master/EWSContacts
Cheers
Glen

How to manage office 365 accounts in windows azure web site

I'd like to deploy a Office 365/Exchange Online management portal in the WAWS(Windows Azure WebSite) which could create new user/group/mailbox or change some property of specific user, etc. Is it possible to deploy this kind of web application in the WAWS environment? Should I call PowerShell and Office365 cmdlet in the ASP.NET environment? Or there are any better way to do this?
As the #Matt alludes to in his comment, there is already a web-based management portal for both of these. However, since you ask this question, I'm going to assume that you want additional functionality/customization.
The short answer is yes, you can.
User accounts in Office 365 are, behind the scenes, accounts in Azure Active Directory. So, for creating users, contacts, security groups and adding licenses, you will need to use the Azure Active Directory Graph API:
Getting Started With Windows Azure Active Directory Graph
For managing Exchange Online, you will probably want to use the Exchange Web Services Managed API 2.0. You'll probably only need this if you need to create distribution groups or manage individual users' contact folders (mailboxes for users get created when you assign an Exchange license from Azure Active Directory).
Get started with EWS Managed API client applications
Update: the Office 365 APIs were recently announced, and are now in Preview. They are a RESTful API, which can be used to manage (for now), mail, contacts and calendar items. Depending on your use case, this may be easier to deal with than the EWS Managed API 2.0.
Using the Mail, Calendar, and Contact REST APIs to work with emails, calendar items, and contacts

Get folder permissions in a user's mailbox

Is it possible to get a list of who has permissions to a folder in a user's mailbox in exchange 2007?
As far as I know it is not possible via exchange management shell. It is possible however in E2k10+ using the Get-MailboxFolderPermission. This is not available in E2k07.
If it is not possible in powershell, is there any other softwares available that can accomplish this.
You can use the EWS managed API with PowerShell to get the folder delegates for the mailbox. Glen Scales has some excellent articles on using this API with PowerShell, including one on getting delegate informtion:
http://gsexdev.blogspot.com/2012/03/ews-managed-api-and-powershell-how-to.html#!/2012/03/ews-managed-api-and-powershell-how-to.html
I just tried on Exchange 2007, and it works:
$permissions = Get-Mailbox $first.$last | Get-MailboxPermissions

How do I set up a searchable email distribution list, accesible via webpage?

I work for a large company, which uses MS Exchange for Email. We have a distribution list for people to post questions, where anyone can answer. I am looking for a way to maintain a copy of this distribution list so that anyone can search it. Ideally, this would be searchable from within Outlook as well as by going to a webpage, but I will take either one. Someone has proposed to create a dummy email account, which just gets the distribution list traffic. Everyone interested in this distribution list could then attach this account. While this may work, there are several challenges with this approach:
1) It becomes problematic when you have several hundred people attaching a single email Inbox/account.
2). I need this account to be read-only, so someone doesn't accidentally delete an email from this account, thinking that it is in their personal account.
3). Our company has an auto-archive policy. This account would need to be exempt from that policy.
Any ideas?
Thanks
GS
The dummy mailbox is not a bad idea. You can give the people appropiate permissions to the Inbox folder of that mailbox.
To work around the permission issue you could either
1) create a transport agent which monitors the mailflow and dumps all messages to a database or CMS/SharePoint/whatever.
2) Create the dummy mailbox and setup a service which monitors this mailbox using push/pull/streaming notifications and dump the messages to a database/CMS/SharePoint/whatever.
The SharePoint solution would make the search option a piece of cake. But if you don't already have a SharePoint instance up and running this might be overkill.