SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm looking for a powershell script that allows me to set the default value for a column in SharePoint. Thanks

share|improve this question
up vote 8 down vote accepted

The main point here is that you can work with SharePoint Object Model from PS. So, your task is just to find out the way to change default field value using SharePoint Object Model, and translate it to PS notation.

The default value for a column in SharePoint object model is set using SPField.DefaultValue property.

So, let's try use this knowledge in PS. I have SampleList2 of type Contacts on my local SharePoint portal, and will try to change default value for a 'First Name' field.

Below is my PowerShell script:

$w = Get-SPWeb http://localhost
$l = $w.GetListFromUrl("/Lists/SampleList2/AllItems.aspx")
$f = $l.Fields["First Name"]
$f.DefaultValue = "my default name"

Let's try to create new item using GUI now:

enter image description here

Enjoy! :)

share|improve this answer

Check this blog post Use PowerShell to Manage Lists, Views, and Items in SharePoint on how to update SPListItem via PowerShell.


We can assign additional values to fields as well. In the next example, we add values to the TextField and ChoiceField, which we created earlier in this example:

PS > $spListItem["TextField"] = "Hey hey" 

PS > $spListItem["ChoiceField"] = "First Choice"
#Finally, we use the Update() method to create the new list item:
PS > $spListItem.Update()
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.