Search-Mailbox for "private" emails - email

I have need to search for emails in a shared mailbox and delete any that are flagged with the "private" flag.
After consulting the documentation
https://technet.microsoft.com/en-gb/library/dd298173(v=exchg.150).aspx
However there is nothing relating to filtration by flag in the KQL query documentation.
Does anyone know what value i can query to identify messages with the "private" flag ?

Not sure that you can do it with Search-Mailbox cmdlet.
But you can do it using EWS (exchange web services protocol).
Take the first part of this script to find private messages:
https://gallery.technet.microsoft.com/office/Clear-Private-Flag-on-3cac4d50

Related

Address List which emailed from

I'm currently organizing the Google groups that our account has and would like to see where each group received the email.
As far as I'm looking at the public API, it seems that there is no way to know when a group received an email or how many it already received.
For example, if a member has been a member of a group since the beginning, it would be possible to create a list from the member's email archive, but I don't want to do that for each group.
Does anyone have a better idea?
Maybe one of the solutions is here, and I'll check it.
Download all messages from a Google group

Mapping user email to ADO user/descriptor

With a git commit, I have access to the author and committer's email and I wish to map that to a user in Azure DevOps. I've done some due diligence in searching this up but I cannot find anything concrete. I've basically reached the same state as the following post: Getting user/users details based on user name/alias as parameter in azure devops
I can see on the Graph API page (https://learn.microsoft.com/en-au/rest/api/azure/devops/graph/?view=azure-devops-rest-5.1) that this is not yet officially supported. The problem is as follows: is there a way to get back a user descriptor from simply an email?
Searching by UPN or Display Name
COMING SOON!
Often, identities are represented simply as display names such as
Jamal Hartnett or UPNs such as jamal#contoso.com. These are not
unique at any scope. Search is an resource that will take a text
string and run a search across an account or project to find all
potential matches. The more distinct the input, the better chance the
resource will return a single result. The search resource will accept
display names, aliases, UPNs, and email style strings such as Jamal
Hartnett jamal#contoso.com.
If the commit author email matches the pushed by email, I can use the IdentityRef object from that. But for other cases where this does not apply, I'm at a loss on how to map to a descriptor.
The problem is as follows: is there a way to get back a user descriptor from simply an email?
As far as I know, the official Rest API doesn't support obtaining descriptors by email.
But based on my test, it seems that this requirement is available.
You could get this Rest API in Browser Console tab when you filter the user in Organization Settings -> Users.
Rest API sample:
https://vsaex.dev.azure.com/Organization name/_apis/UserEntitlements?%24filter=name%20eq%20%27user#domain.com%27&%24&api-version=5.1-preview.3
Then you could get the user descriptor in the API result.
In addition , the official Rest API supports to list all user Graph. You could get the user descriptor in the result too.
Hope this helps.

How do I query the Exchange Online REST API for a list of users, mailboxes and/or calendars?

Background
I'm able to query outlook.office365.com/api/v1.0/me/ for the current user that is logged in. But I'm unable to find a query that would give me a list of users. Below are the following queries I've tried without any luck.
outlook.office365.com/api/v1.0/users/
outlook.office365.com/api/v1.0/me/users/
This is the error I receive when I'm doing either of the queries.
https://www.dropbox.com/s/64o0mwj1w3uigk8/Screenshot%202015-07-09%2013.07.22.png?dl=0
Goal
I would like help finding the correct REST API queries for a list of users, mailboxes, and calendars.
Extra Findings
Note that while I was referring to https://msdn.microsoft.com/en-us/office/office365/api/complex-types-for-mail-contacts-calendar#RESTAPIResourcesUser I received the error listed above for the query'../me/users/$count' when trying to count the number of users.
We don't allow enumerating the list of users in a tenant using the outlook endpoint. you can however do this using the AAD graph api. For example:
https://graph.windows.net/contoso.com/users?api-version=2013-04-05
For calendars, you can see all calendars of a given user by enumerating those from ../me/calendars
Thanks for mentioning the $count issue, it was a bug which has been fixed. You should see it rolled out soon worldwide. But note that this will still not allow you to get a count of users as that collection is not enumerable. The $count will help with queries like ../me/messages/$count

Email Settings API - How to delete Send-as alias

The Google Apps Email Settings API describes creating and retrieving Send-as aliases, but not how to delete them. Is it possible to do this via the API, or is there a workaround?
I'm using the Directory API to add and delete user aliases, which takes care of whether someone can receive at an alias, but I'm stuck on how to remove their Send-as alias.
The ability to delete send-as aliases has been added to the API, though I haven't tested it myself - https://developers.google.com/gmail/api/v1/reference/users/settings/sendAs/delete
There is no sendas delete method. Users must manually delete the sendas from the UI.
The Directory API has a method to "delete all aliases". Not sure if that includes "sendas" alias but might be worth checking.

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