Deleting a contact list item through Powershell in sharepoint 2010 synced with outlook 2010, does not delete the item from outlook.

hi All,
I have a requirement for updating the contact list from CSV file and updating/ adding and  deleting the changes in the SharePoint list using PowerShell script. List is also synced with outlook.
The problem arises, when we delete an item from the list using PS, the item (which was earlier synced with outlook) is not getting deleted from outlook.
Strange behavior : when we perform the same deletion operation manually from the SharePoint UI, every thing works fine as required.
Please refer the below PS
#Adding the records from SharePoint not in CSV file
if($flag -ne 1)
Get-Member -InputObject $csvRow -MemberType NoteProperty | ForEach-Object {
$property = $_.Name
$newItem.set_Item($property, $csvRow.$property)
$newItem.Update()
#Deleting the records from SharePoint not in CSV file
CreatePSLog "Deleting the records from SharePoint not in CSV file"
foreach($itm in $List.items)
$del = 0
$items | ForEach-Object {
if($itm["SAP Ansprechpartnernr"] -eq $_."SAP Ansprechpartnernr")
$del++;
if(!$del)
$List.GetItemById($itm.Id).Delete()
$List.Update();
$Web.Update();
many thanks in advance, Please suggest as I am completly stuck on this :(
Regards, Arun kumar

Hi Kumar,
Please remove the codeline $List.Update();, then run your code again, it works for me.
You may need to firstly delete the synced contacts list within Outlook to remove those undeleted accounts, then re-connect the SharePoint contacts list to outlook, then run your modified Powershell code.
Thanks
Daniel Yang
TechNet Community Support

Similar Messages

  • I have iphone 3gs ios 6.1.3 .. I have a problem I can not look contact profile and save it. I already sync with outlook and windows books also can not be seen. I tried to add a contact on the contact menu, but the result like restart ... (but not restart

    I have iphone 3gs ios 6.1.3 .. I have a problem I can not look contact profile and save it. I already sync with outlook and windows books also can not be seen. I tried to add a contact on the contact menu, but the result like restart ... (but not restart the device, not just stored). I am confused about this issue ... please help ..
    thank you in advance.

    Your suggestion worked perfectly.  I can't believe there is nothing in any of the instructions I have seen online at the Yahoo and Apple help sites about the making sure the right default account is checked.  I don't think I was even aware there was a "default account" setting.  Thank you so much.

  • Ever since enabling Soft Delete on one of my tables, the logs are flooded with "... does not support the 'deleted' system property"

    I enabled Soft Delete on one of my Azure Mobile Services tables, and ever since then, the logs are flooded with tons of warnings that say something like this:
    The table 'Section' does not support the 'deleted' system property.
    Is there a way to suppress these warnings, or is it advisable to enable soft delete for all of my tables?
    As a follow on, is there a way to export the logs so that it's easier to peruse through them and search?
    Thanks :)

    Hi
    You can set your logging level in Azure Admin portal to be Error only, so it only logs errors and warnings will be ignored.
    Regards
    Aram

  • SSIS ETL does not pick the file from Share point when it execute through SQL Agent job

    I have created one SSIS packages, which pick the file from the Share point document library. its work successfully, once it execute through the VS project application. 
    But when i create a job in SQL Server Agent for this package then it does not pick the file and job getting fail. 
    Just for more update, SQL Server has been install in Cluster mode and using BIDS 2012 with SQl Server 2012.

    Hi PriyankGupta,
    SQL Server Integration Services is not cluster awareness, and does not support failover from one cluster node to another. So, in your clustered environment, make sure SSIS is installed on each node in the cluster. In other word, SSIS must be installed on
    the server where the SQL Server Agent job is created. 
    If you use any third party task/component or drivers, make sure they are installed on the SQL Server Agent job server. Besides, also pay attention to the protection level of the package as well as 32-bit or 64-bit runtime mode of the package. For more information,
    please see:
    http://social.technet.microsoft.com/Forums/systemcenter/en-US/e13c137c-1535-4475-8c2f-c7e6e7d125fc/how-do-i-troubleshoot-ssis-packages-failed-execution-in-a-sql-agent-job 
    If the issue persists, please post the error message in the job history for further analysis.
    Regards,
    Mike Yin
    TechNet Community Support

  • Deleting calendar invites does not remove the event from calendar

    i regularly get calendar invites that i do not want cluttering my calendar.  on my PC, i can easily delete or decline them without sending a response, which is the easiest way to deal with them.  but if i open the invite mail message on my iphone, the event gets added to my calendar automatically.  what's worse, if i delete the email message containing the invite, the event stays on my calendar.  if i tap the event, i'm given the choices of accept, maybe, or decline.  if i decline, it sends a message to the organizer.  this actually leads to more problems, like a senior person wondering why i declined their event, or a junior person sending invites to the entire office and complaining about all the declines.  it's even worse if a client sends an invite for a project i'm not involved with.
    is there some setting i need to enable to ensure that when i delete an email containing a calendar/outlook invite, the event is deleted (or better yet, never added) to my calendar? 

    Why has no one helped? This is a reasonable question but all similar strands are left unanswered. Why wouldn't people want to hold on to the information about old appointments?

  • Ive deleted contacts from my contacts list but they still pop up when i go to text and type in the name of a current contact. .  How can i delete them off my phones memory for good?

    Ive deleted contacts from my contacts list but they still pop up when i go to text and type in the name of a current contact. .  How can i delete them off my phones memory for good? iPhone 4S

    At the present time, the only way to clear that is to restore the phone as new.  Perhaps a future iOS update will give us the option to clear that cache.

  • How to copy List item from one list to another using SPD workflow using HTTP call web service

    Hi,
    How to copy List item from one list to another using SPD workflow using HTTP call web service.
    Both the Lists are in different Web applications.
    Regards, Shreyas R S

    Hi Shreyas,
    From your post, it seems that you are using SharePoint 2013 workflow platform in SPD.
    If that is the case, we can use Call HTTP web service action to get the item data, but we cannot use Call HTTP web service to create a new item in the list in another web application with these data.
    As my test, we would get Unauthorized error when using Call HTTP web service action to create a new item in a list in another web application.
    So I recommend to achieve this goal programmatically.
    More references:
    https://msdn.microsoft.com/en-us/library/office/jj164022.aspx
    https://msdn.microsoft.com/en-us/library/office/dn292552.aspx?f=255&MSPPError=-2147217396
    Thanks,
    Victoria
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • SP2013: List does not exist / The page you selected contains a list that does not exist. It may have been deleted by another user

    There are dozens of entries regarding "
    List does not exist / The page you selected
    contains a list that does not exist. It may have been deleted by another user" and none of them are really SP 2013 so i thought I would create this entry. 
    I am getting the error above after creating a simple list with 4 columns.  the list is created during a new site definition activation but when I click on my list, I get the error above.  the list works if I deactivate the feature and re-activate
    it.  but has the error whenever the new site definition is created.  
    Has anybody encountered this issue on SP 2013?

    Hi,
    For your issue, there are plenty of possible reasons offered when we search this issue online.
    Here are similar issue posts, check whether they are helpful:
    http://sharepoint.stackexchange.com/questions/98239/list-does-not-exist-error-when-opening-the-views
    http://sharepoint2u.com/?p=56https://shareyourpoint.wordpress.com/2012/04/12/list-does-not-exist-the-page-you-selected-contains-a-list-that-does-not-exist-it-may-have-been-deleted-by-another-user-sharepoint-2010-error/
    http://spnovice.blogspot.com/2012/10/list-does-not-exist-or-does-it.html
    Best Regards,
    Lisa Chen
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Lisa Chen
    TechNet Community Support

  • I am using the desktop screensaver and a file from dropbox for photos.  Does the list of screen savers actually use the file, or just link to it.  If I delete the file from the dropbox, will the screen saver be lost?

    Using the desktop slideshow, I have added a file from dropbox for the slideshow.  If I delete the dropbox file, does that delete the file from the list on the slideshow?  Do I need to leave the file on the computer itself rather than in the dropbox and then delete it from the dropbox?

    If you are going to delete the file from Dropbox, you will need the file on your computer.
    You will probably need to put the file in Library/Screen Savers

  • How to delete the files from server through OAF page

    Hi All,
    I have a requirement in which i am creating files on server through my CO code.
    Now once the page is rendered, i want to delete the files from the server.
    Just wondering how can we achieve this.
    Kindly advice!
    Thanks,
    Sachin

    Hi Sachin
    all the methods in the processRequest() are called during loading of the page.
    all the methods in the processFormRequest() are called during any action events on the page.
    So Use the method in processFormRequest() : write a method in
    that on which action you want to delete the file.
    regards
    sridhar

  • How to delete the apps from your iPhone's purchased list in ios 7

    How to delete the apps from your iPhone's purchased list in ios 7

    You would need to set up the Hotmail account as a IMAP instead of a POP3 account.

  • I would like to know, on the ringtone page, where you can select songs out of your music library, is there a way to remove a song from the list after its selected? I would thin there would be a way to "delete" the songs from the list. (Clock app)

    I would like to know, on the ringtone page, where you can select songs out of your music library, is there a way to remove a song from the list after its selected? I would thin there would be a way to "delete" the songs from the list. (Clock app)
    Let me explain:
    In the clock app for ios 6.0.2 I am a little confused. It allows you to go into your music library, and create a ringtone using any songs you choose. However, I cannot find a way to remove a song from this list, just like I cannot delete one of the preset ringtones (which I'm not trying to do, but just as an example)
    Thanks for your time! If you need more information just ask.
    (I believe both my iPod and iTunes are up to date)

    I believe you just are able to delete them from iTunes.
    Hope it will be helpful

  • Bought a new iphone and i cant activate it unless the previous owner deletes the account from their icloud but i lost contact with the previous owner how can i fix this?

    bought a new iphone and i cant activate it unless the previous owner deletes the account from their icloud but i lost contact with the previous owner how can i fix this?

    Take it back where you got and and get your money back.
    As has been pointed out, if there was a "previous owner", the phone is not "new". Thephone you purchased is most likely stolen. If whoever you bought it from won't give you your money back, turn it over to the police.

  • When using Time Machine, if I delete items from my computer, will they still be backed up to access later on my external hard drive? In other words, when time machine backs up again, will it delete the files from the back up?

    When using Time Machine, if I delete items from my computer, will they still be backed up to access later on my external hard drive? 
    In other words, when time machine backs up again, will it delete the files from the back up that I have deleted from my computer?

    No, I do not believe so. Time Machine would keep all those now-deleted files in previous backups, and as time goes by those backups might be deleted if you needed room, but it would still keep one backup from each day in last month, as well as one from each week forever, as long as you don't start running out of room, then just the oldest would be deleted to make room if needed.
    I use a backup drive about double the size of my drive to be backed up, so I would guess it will never get to the point where deleted files being replaced by new ones being backed fill up that drive to the point where backups actually have to get deleted.

  • Whem i'm doing the backup it automaticaly saves contacts.....because i've synced with another computer anf it deleted all my contacts...and i really need them!!!!!

    Whem i'm doing the backup it automaticaly saves contacts.....because i've synced with another computer and it deleted all my contacts...and i really need them!!!!!

    If you haven't been using your phone as recommended, then you've lost all your contacts.  Contacts should be synched to your computer (Address Book, Outlook) or a cloud service (MobileMe, Google) for safekeeping.  The iPhone was never intended to be a storage device.
    If you haven't been using your phone as recommended and synching your contacts as above, frankly, you've no one to blame for your loss of data but yourself. 
    On that topic, are you making regular backups of your computer's data as well?  Hard drives WILL fail.

Maybe you are looking for

  • EJB 3.0 JNDI lookup gives ClassCastException

    The object returned by the JNDI lookup of a EJB 3.0 Statefull Session Bean is not of the expected type, but rather of an obviously generated Proxy type (ejb_DistributionProcessor_LocalProxy_4h350 instead of expected DistributionProcessor). Does anybo

  • Deleting records from a versioned table slow.

    Hi, I have a problem the sql statement delete * from version_table slows down considerably as the number of history entries increase. 10g advises that an index should be created on the primary key column and creation time to improve performance. My q

  • After Loading and Calc'ing the database error in data Preview

    I am doing my Developer on my laptop and the transfering the object to the server I have loading and calc'd about 4 years of data on Bith My laptop and the Server when i try to Preview the data I get this error Duplicate Member names with data previe

  • How to call BSP pages from a BSP application of another package

    Hi, I have a BSP application in one package and I want to call pages from another BSP application in a different package. Is it possible? How it would have to do it? Thanks in advance Regards

  • Deploying static HTML files

    I would like to deploy an applet in Weblogic 92. Could you point me to the documentation to do achieve this. There is one html file which has the applet definition and the jars that it references...