In order to provide a simpler example, the error handling has been omitted.
General when I see this error the first thing I think is, “It’s time to break my methods out a little better and to call my SPWeb Object when I really need it.” One example of where this can come into play is in solutions where SPList Item field swaping is required (i.e List Item1 swaps it’s Title field with List Item2).
For every update to a list item the SPList’s “update()” method needs to be called to save the changes.
To accommodate this scenario we simply use the Before I make any changes to demonstrate this script and the modifications we’ll make to it, let’s first see how my user is currently set in the Site Collection: And as shown in the People Picker: Note the “Name”/”Display Name”, “Work e-mail”/”E-Mail”, and “Title” fields.
Now I’ll change these values in Active Directory (make the “p” in my last name capitalized, change the title, and set the email) and then run the script (I saved the script as Sync-SPUser.ps1): (Note that lowercase “p” is the correct spelling for my name, just in case you were wondering ).
Project Description The Share Point list item editor makes it easier for Share Point developers and users to preview, update, insert and delete Share Point list items. This is a small Win Form tool that populates a standard Data Grid View control with the items of Share Point lists.