SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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

In Sharepoint there are many OOB list with a field "Xml". For example, by running this:

$url =
 $site = Get-SPSite $url
 $site.rootweb.lists["User Information List"].items[0].xml

I can get the first record's XML field content, which similar to below:

<z:row xmlns:z='#RowsetSchema' ows_Content
                                     322F4F' ows_Title='Welcome to my blog!' 
                                     ows_Body='&lt;div class=&quot;ExternalClas
                                     ;&lt;p&gt;This is where I&#39;ll be 
                                     sharing my thoughts on topics that matter 
                                     to me. Who knows... I might even share 
                                     pictures, videos and links to other 
                                     interesting stuff.&lt;/p&gt;&lt;p&gt;If I 
                                     catch your interest, let me hear from 
                                     ows_NumComments='0' ows_PostCategory='' 
                                     ows_PublishedDate='2014-02-05 00:31:41' 
                                     ows_RatedBy='' ows_LikedBy='' ows_ID='1' 
                                     ows_Modified='2014-02-04 20:31:41' 
                                     ows_Created='2014-02-04 20:31:41' 
                                     ows_Author='1073741823;#System Account' 
                                     ows_Editor='1073741823;#System Account' 

My question is : 1. What kind of XML is it? Do it has a format name and suggested accessing method? 2. Can I access the value "ows_Author" by powershell?

share|improve this question

The XML represents the inherent configuration of a particular list item.

Generally you wouldn't want to access the values by reading/parsing the XML directly, but rather using the wrapper object.

You can access any of those fields using the "array" accessor for the wrapper field value object.


share|improve this answer
Thank you! I get what I need. But I am not fully understand the syntax. I can get the author value by $_['author'] or $_['ows_author'] but not $_['ows_aut']. Why is it? Any reference for this "wrapper" method? Thanks. – Mark May 2 '14 at 5:47
When you access $site.rootweb.lists["User Information List"].items[0] you get a SPListItem which has the Item property which you can use as $_['fieldname'] to get a fields value from Title, InternalName or StaticName of the field – Per Jakobsen May 2 '14 at 7:53
How can I find out the Title, InternalName or StaticName of the field? – Mark May 2 '14 at 8:01
Title is the fieldname shown in the UI. InternalName is the name after ows_ in the XML. StaticName is the same as InternalName unless it's changed by code. $site.rootweb.lists["User Information List"].Fields will give all the fields with this as attributes. – Per Jakobsen May 2 '14 at 8:07
Thanks. Got it. – Mark May 2 '14 at 8:54

As @Amadeo answers you should use SPListItem.Item aka. "array" property to get fieldvalues.

But in general if you want to access XML values in PowerShell you just have to cast the string to xml then you can just dot your way through elements and attributes like this:

$url =
$site = Get-SPWeb $url
$xml = [xml]$site.lists["User Information List"].items[0].xml

BTW If you need to access the SPWeb at an URL just use Get-SPWeb instead of Get-SPSite and RootWeb

To get the Id of the User as requested in the comment use something like:

$url =
$web = Get-SPWeb $url
$list = $web.Lists["User Information List"]
$item = $list.Items[0]
$author = New-Object -Type 'Microsoft.SharePoint.SPFieldUserValue' -ArgumentList ($web ,$item["Author"])
share|improve this answer
Actually I want to get the member ID which match with the ID returned by Get-SPUser. When I call $_['Member'] it returns a string like "33;#Peter Morris". Can I get "33" directly? – Mark May 2 '14 at 8:26
See addition to answer – Per Jakobsen May 2 '14 at 15:22
Thanks I can get the Author ID. However a member's ID may not be the Author ID (e.g. the administrator add the member to site, the author will be the admin) – Mark May 12 '14 at 5:47
Oh I get get the member id by using ArgumentList ($web,$_["ows_Member"]). Thank you! – Mark May 12 '14 at 5:52

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.