0

I cannot access the description of a group like this:

$web = Get-SPWeb "http.//yourUrl"
$web.SiteGroups | %{write-host $_.Name, $_.Description}

According to this, the description value is in fact stored as "About Me" in the DB-table AllUserData.

Using the group web service and $SPService.GetGroupCollectionFromWeb() also retreives groups without description.

How to read the description property of an SPGroup?

3 Answers 3

2

This holds everything to get the group's description. You need this object:

$text = $web.SiteUserInfoList.Fields[($web.SiteUserInfoList.Fields | ?{$_.InternalName -eq "Notes"})]

You fetch the group item based on id and extract the description with the internal name

$groupItem = $web.SiteUserInfoList.GetItemById($_.Id)
$description = $groupItem[$text.InternalName]

The non-pedagogic version of accessing the description field does not deal with my $text variable, and uses this:

$description = $groupItem["Notes"]

If you are about to display this data you should be aware that this is HTML

0

Please try the below code, It displays all the group's description.

$web = Get-SPWeb "your site URL"
$groups=$web.SiteGroups 
foreach($group in $groups)
{
write-host $group.Description
}
1
  • No, I just tried, and did so before, and I know this is what M$ probably thinks should work...BTW: where's the key difference to my script? Commented Jul 29, 2013 at 11:26
0

As the same that you have to do by C#. Basically exist a list where SharePoint save this information. Basically this list is the SiteUserInfoList has @StefG wrote.

There are many fancy thing about this list. For more information take a look here: http://salvatoredifaziosharepoint.blogspot.co.uk/2013/08/how-to-retrieve-spgroup-description.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.