Sometimes it is useful to know when a specific SharePoint group or user was created, and who has created it. Although the standard SharePoint objects (SPGroup / SPUser) does not contain this type of information, we can access it through the hidden user information list, where each of these objects are represented as simple list items.
The PowerShell scripts below provide examples how to access the information for a group:
$usersList = $site.RootWeb.SiteUserInfoList
$groupName = "MyGroup"
$groupId = $site.RootWeb.SiteGroups[$groupName].ID
$group = $usersList.GetItemById($groupId)
Write-Host Created by: $group["Author"]
Write-Host Created on: $group["Created"]
Write-Host Last modified by: $group["Editor"]
Write-Host Last modified on: $group["Modified"]
And for a specific user:
$usersList = $site.RootWeb.SiteUserInfoList
$loginName = "domain\user"
$userId = $site.RootWeb.AllUsers | ? { $_.UserLogin -eq $loginName } | % { $_.ID }
$user = $usersList.GetItemById($userId)
Write-Host Created by: $user["Author"]
Write-Host Created on: $user["Created"]
Write-Host Last modified by: $user["Editor"]
Write-Host Last modified on: $user["Modified"]
As you can see, I write out the editing information as well, but it is important to point out, that this data does not reflect modifications for example in group membership, only changed information in the list item, for example, renaming of a group or change e-mail address for a user.
