nightmare....please help

I’m facing a big issue since one week
 
can you help for this particular issue
 the deal is the following :
i should check in folder favourites under contacts in outlook if user toto has reviewer permission ;
if so do nothing
 if not add or modify existing permissions as reviewer
i do this with ews api but this cause me the issue that deleting all other existing users permission after folder.update() is applied
you have an idea to deal with this issue ? part of my code that update the folder (currently delete the user and add again the rights
 
 
############################################################################################################################## if($existingperm -ne $null)
{ output("Removing existing permission to toto on Contacts\Favourites")
$removal = $favouritesFolder.Permissions.Remove($existingperm)
output("Removed existing permission to toto on Contacts\Favourites") }
$newfp = new-object Microsoft.Exchange.WebServices.Data.FolderPermission("toto@toto.com",$ReviewerPermission) $favouritesFolder.Permissions.Add($newfp) $favouritesFolder.Update()

output("Granted Reviewer permission to toto on Contacts\Favourites") }

 

Parents
No Data
Reply Children
No Data