About me
I live in Lund and work, well, at probably the best company in the world
Tag Cloud
Active Directory
AD
ajax
Android
api
app
Apps
ASP.NET
azure
C#
CAML
Chuvash
Client Object Model
codeplex
console
csom
csr
css
css3
database
devtools
extension
git
github
google chrome
html
html5
javascript
jQuery
jQuery tmpl
js
jslink
jsom
json
keyboard
keyboard layout
LINQ
linux
localization
log
masterpage
ModalDialog
monitoring
office365
onet.xml
Performance
Powershel
PowerShell
raspberrypi
REST
rättigheter
script
Serverinstallation
Sharepoint
SharePoint 2010
sharepoint 2013
sharepoint2013
sharepoint apps
sharepoint online
SP.js
spapp
SPField
SPList
SPListItem
spo
SPWeb
subversion
tips
ubuntu
VHD
Visual Studio
webpart
webparts
windows
xml
Top posts
Certiffications


Blog Stats
- 601,379 hits
Recent Comments
Blogs I Follow
- Daniel Chronlund Cloud Tech Blog
- Вула Чăвашла
- Discovering SharePoint
- Bram de Jager - Architect, Speaker, Author
- SharePoint Dev Lab
- GUID(E) To SharePoint
- SharePoint Dragons
- Mai Omar Desouki
- Cameron Dwyer
- paul.tavares
- Share SharePoint Points !
- Simple Stuffs
- Jimmy Janlén "Den Scrummande Konsulten"
- Aryan Nava
- SPJoel
- SharePointRyan
- SharePoint 2020
- Aharoni in Unicode
- ... And All That JS
- blksthl
Thank you for a good blogg! 😉
Very useful. I can also recommend using the property bag, which is a key-value set which you can set on farm, application, site or web level.
usable via code:
//Retrieve a property entry
web.AllProperties[key]
// Add a property entry
web.AllProperties[key] = value;
web.Update();
// Remove a property entry
web.AllProperties.Remove(key);
web.Update();
via powershell:
$site = spsite “http://server”
$web = $site.OpenWeb()
$web.AllProperties
I for one use it in a current project where we set up a custom configuration site in central admin where we store and fetch settings from.
Using: SPAdministrationWebApplication.Local.Properties[“importPersonalRoot”].ToString(); to fetch settings at run time.
/Jens
Thank you Jens for your input!
The property bag of SPWeb or SPWebApplication are handy, indeed. I have used them a lot. Using SPPersistedObject is tricky and when possible should be avoided. I tested this method, and this blog post is just a brain dump 🙂 Maybe it can be useful in the future.
By the way, in powershell, you can a reference to your web directly:
$web = get-spweb “http://server”