Tag Info

Hot answers tagged


I think you mean that result item collection is empty: $itemsCollection = $list.GetItems($spQuery) if($itemsCollection.Count -eq 0) { Write-host " No results were found" }


Let $web be the SPWeb object where your list is, and let $item be the SPListItem that your script is working on. Here is how to extract the SPUser from $item: Function Add-SPUserFromListToOwnersGroup { param ( [Parameter(Mandatory=$true,ValueFromPipeline=$true,ValueFromPipelineByPropertyName=$true)] [Microsoft.SharePoint.SPListItem] ...

Only top voted, non community-wiki answers of a minimum length are eligible