deals with hidden folder - rest

We are a little company in france, and we have developed a add-in for outlook, that used the WS exchange and VSTO. We need to develope this plugins for office 365
How can we deals with hidden folder inside a outlook mailbox ?
With WS Exchange we can hide a folder in the directory of an outlook account. We can send an SingleValueExtendedProperties (0x104f : true) to make that.
Whit the office 365 we can send this same SingleValueExtendedProperties the folder is correctly hide, but after that we can't list them, we can't move them, we can't delete them... a ghost, but when we cant to create a folder whit the same name, we get an error that indicate a folder already exists...
Folder list
GET https://outlook.office.com/api/v2.0/me/MailFolders
create folder
POST
https://outlook.office.com/api/beta/me/MailFolders/{folder_id}/childfolders
{
"DisplayName": "Business"
}
Update folder : rename + hide -> 404 but no floder after that
PATCH https://outlook.office.com/api/v2.0/me/MailFolders/AAMkAGNlZmM5OTBlLTMwZTgtNGQzZS1iM2IzLTRjNWNkZDNlMTU4NAAuAAAAAADp0G8t0SUuQJyWc5hKYYdzAQA76fHUOjd6RImcXSS_fEDDAAAAADIrAAA=
{
"DisplayName": "test",
"SingleValueExtendedProperties":[
{
"PropertyId":"Boolean 0x10f4",
"Value": "true"
}
]
}
after this rest call, folder is hidden and unusable...
Thank's

The behavior is obvious. It won't allow to create new folder with the same name as it is just hiding the folder not removing permanently.
For Office 365 I would rather recommend you to use Outlook Web Add in template and for code Microsoft graph as It is providing all office 365 products api at single place. Then after you won't need to use VSTO Addin. single development will work for both Outlook client application and Outlook online.
screenshot: https://learn.microsoft.com/en-us/outlook/add-ins/images/uiless-command-shape.png
ref : https://learn.microsoft.com/en-us/outlook/add-ins/

Yes we adapt the addins to office 365 with graph api. But this for me is a bug in graph api. We can hide a folder and after all command sent an 404 error, folder not found.
If we have hide a folder, the rest api whould offer the possibility to move, edit, unhide, delete, list this item. In my case with a 365 office cloud instance, i can't made anything whit this folder, the administration panel of my company can't display folders of an user account, the user account administration panel can't edit the folder list. How can i manage this "ghost" folder.

Related

How to get a single file that has been shared with me on OneDrive?

I'm building an app that uses the ms-graph v1.0 API to write data to excelsheets in my OneDrive. It works with excel files that I uploaded to my drive but doesn't work with excel files that've been shared with me.
I know that I can get a list of all shared files with me/drive/sharedWithMe and the file that i want to edit is amongst the files that are being returned.
However, when i try to get one shared drive item using its driveItem property parentReference: driveID like this: /drives/{driveID}/items/{itemID} it returns : 403 - acces denied.
Here are my permissions:
"user.read",
"calendars.read",
"directory.accessasuser.all",
"files.readwrite.all"
I couldn't try the shares path /shares/{shareID} because I don't know how to figure out the shareId. It doesn't seem to be among the properties of the item that is returned by /sharedWithMe. Where can I get it?
Figured it out by myself.
I got the error
"message": "Cannot reference a user's drive from another user's personal site"
so I removed the me/from the route me/drives/{driveID}/items/{itemId} and it worked.

Unable to work with hidden folders in the office365 Graph mail folder API

I have successfully created some mail folder, and then made it hidden with the following update:
patch /users/xxx#xxxx/mailFolders/folderId
{"singleValueExtendedProperties": [{"id":"boolean 0x10f4", "value":"**true**"}]}
(explanations about creating a hidden folder https://msdn.microsoft.com/en-us/library/office/dn659505(v=exchg.150).aspx):
Then I checked it with EWSEditor.exe, which proved the folder was successfully made hidden.
(But the patch call return 404, I think it is some bug of this API, it should return 200 since the update is successful)
After that, if I try to make the folder visible, the update always fails:
patch /users/xxx#xxxx/mailFolders/folderId
{"singleValueExtendedProperties": [{"id":"boolean 0x10f4", "value":"**false**"}]}
And for this hidden folder, there is no way to list it out or find it out. Trying to delete this hidden folder with the remembered ID fails, too.
So, it seems there are some bugs in the Graph mail folder API:
It should be allowed to make a hidden folder visible after a
previous update to hidden from visible.
There should be some API to list the hidden folder.
The Delete API should be able to delete the hidden folder.
Reset this property to false in EWS editor and save. You will be able to get this folder again with graph api.
This feature is now available in Graph Public Beta. You can access hidden mail folders via the /mailFolders API by adding a new query parameter called includeHiddenFolders. ​You can read more about the feature # below links:
About Hidden Folders: https://learn.microsoft.com/en-us/graph/api/resources/mailfolder?view=graph-rest-beta#hidden-mail-folders
Get a list of hidden mailFolders: https://learn.microsoft.com/en-us/graph/api/user-list-mailfolders?view=graph-rest-beta&tabs=http#example-2-include-hidden-folders-in-the-signed-in-users-mailbox

Exchange 2016 - Unable to Send As on Mail Public Folder

Exchange 2016 using Outlook 2016 client
Created a new Public Folder titled
Mail-enabled the public folder:
Enable-MailPublicFolder -Identity "\PublicFolder"
Added Send As permissions.
Add-ADPermission PublicFolder -User domain\jsmith -Extendedrights "Send As"
Added permissions to receive mail.
Add-PublicFolderClientPermission -identity "\PublicFolder" -User Anonymous -AccessRights CreateItems
Set Hidden from address lists false:
Enable-MailPublicFolder -Identity "\PublicFolder" -HiddenFromAddressListsEnabled $False
The user jsmith is an owner of this public folder. He can add the public folder and the public folder can receive emails but nobody is able to "Send As" the public folder.
Under EAC I have verified that the public folder exists, permissions are in place, and the folder is mail-enabled.
I have tried disabling Mail Settings and re-enabling. I am also completely unable to select "PublicFolder" in my "From" field in OWA. It gives no option to enter a custom name and also doesn't have an option for the PublicFolder. I did add it to my Favorites.
The user receives the message "This message could not be sent. Try sending the message again later, or contact your network administrator. You do not have the permission to send the message on behalf of the specified user. Error is [0x80070005-0x0004dc-0x000524]."
The user has both Send As and Send on Behalf Of permissions.
The issue has lasted more than 24 hours so I am fairly certain that it is not a replication issue.
This kind of issues might be caused by a wide range of issues:
Make sure that you use the correct permissions as explained in KB 3045224
Make sure that you cleaned the client AutoCache as explained in KB 287623.
Make sure your GAL is updated (but I would say that should be the case after the 24 hours you waited)
Download the OAB by hand on the affected clients
Try to remove the mailbox / shared folder and re-add it on the client
Try to remove the email address from the list (there should be a X near that) and re-add it on the client to force a recheck from the config
Recheck/Reset the permissions via powershell to ensure you are using the correct one
Check KB 3131416 if it apply to your environment
There seamed to be some issues with hidden elements in Exchange. So check out the following URL if that apply to your situation.
Make sure the user has only "Send As" and not additional to that "Send on Behalf Of" rights.
More infos can be found in the source URL.
Outcome:
In your situation it looks like this is caused because the user has both "Send As" and "Send on Behalf Of" permissions. So please check solution 1 and fix the permission.
After long hours of research about this issue, this is the way to solve error 0x80070005-0x0004dc-0x000524 given by a send as on public folder.
Delete outlook Profile
rename in .OLD the folder c:\users\username\appdata\roaming\outlook or c:\users\username\appdata\roaming\microsoft\outlook
Create the new profile
If exists, Delete the autocomplete entry on field "from" with the little cross on the right.
Try to send
It works for me and hope it will be the same for you.
=> Works for Exchange 2013 and Outlook 2010 & 2013.

List folder contents of 'Shared with Me' folder from Office 365 OneDrive (Sharepoint) for Business and Education using the REST api?

Is there a way to get the contents of the 'Shared with Me' folder from the Office 365 (Sharepoint) REST api ?
I can't see anything in the api reference reagrding this.
https://msdn.microsoft.com/office/office365/APi/files-rest-operations
Found the solution to this...
Instead of using the files api you must use the sharepoint search api.
The following endpoint with the KQL query parameters can be used to get a list of files 'shared with me'
https://{tenant}-my.sharepoint.com/_api/search/query?querytext='(SharedWithUsersOWSUSER:{UserAccountName} AND contentclass:STS_ListItem_MySiteDocumentLibrary)'
This above will get a list of files 'shared with me' but not anything inside a shared folder. To get the items inside a shared folder you can use the following endpoint.
https://{tenant}-my.sharepoint.com/_api/search/query?querytext='(ParentLink:{ParentLink})'
Make sure the parent link is url encoded. You can retrieve the parent link from the folder properties.
Finally to get the account name used in the first request you can make a request to the sharepoint webs api.
https://{tenant}-my.sharepoint.com/_api/web/CurrentUser

TFS email notification

When I add a bug (Work Item) in TFS, and assign it to a user, I want an email sent to that user.
Also if an existing bug has the "Assigned To" changed, I want that user to get an email.
Is it possible to send Alerts to users when they're assigned changed bugs in TFS 2008?
In VS 2005 at least, on the Team menu you will find a Project Alerts... item which allows users to specify an email address that will be notified when My work items are changed by others, which covers both the situations you mention. I imagine VS 2008 will have a similar thing.
Unfortunately, TFS doesn't have anything built out of the box for this to be done without recipient intervention. Richard Ev comment can work, but is not really sustainable. Each person needs to create this or you need to do it for them and continue doing it for all new team members.
Instead, you're better off creating an Event Subscriber. Here's a very helpful post http://www.codeproject.com/Articles/110292/Team-Foundation-Server-2010-Event-Handling-with-Su.
You'll want to use the IIdentityManagementService to retrieve the corresponding users' email. An example:
using (var projectCollection = TfsTeamProjectCollectionFactory.GetTeamProjectCollection(collectionUri, new UICredentialsProvider()))
{
var gss = projectCollection.GetService<IGroupSecurityService>();
var ims = projectCollection.GetService<IIdentityManagementService>();
var validUsersId = ims.ReadIdentity(IdentitySearchFactor.AccountName, "Team Foundation Valid Users", MembershipQuery.Expanded, ReadIdentityOptions.IncludeReadFromSource);
var validUsers = gss.ReadIdentities(SearchFactor.Sid, validUsersId.Members.Select(x => x.Identifier).ToArray(), QueryMembership.None);
foreach (var member in validUsers)
{
Console.WriteLine("{0}: {1}", member.AccountName, member.MailAddress);
}
}
In VS 2010, if you have the TFS 2010 Power Tools installed you can go to the Team menu and select Alerts Explorer. That will allow you to create new alerts.
I know your post is for 2008, but it's an old post and hopefully you're on 2010 now.
For TFS 2010 there is an easy solution for you now, via a plugin which can be downloaded from
CodePlex - Team Alert
It's a simple copy-paste solution which can take you 5 minutes to put in place using the configuration extract listed in the post below:
This post will show the exact configuration you need to perform what you want.
Notify AssignedTo user of new work (for a specific TFS project)