2016-09-09 1 views
-2

を使用して、SharePointリストを繰り返し処理し、私は次の列 ID、名前を持っている「リスタ」と呼ばれるSharePointリストを持っている、当社及びパワーシェル

アドレスのリストは、多くのレコードが含まれていると私は内のすべての項目を取得したいです会社名「C」に基づいてリストを作成し、アイテム名を書き込んでください。 SharePoint Powershellスクリプトを使用してリストを反復処理するにはどうすればよいですか?あなたはここで、オンプレミスのSharePointファームを持って提供

+1

の可能性のある重複した[PowerShellを使用してSharePoint Onlineのリストから項目を取得する方法](http://stackoverflow.com/questions/32699338/)および[クライアント側のSharePoint PowerShell - リスト項目の取得](http://stackoverflow.com/questions/37788615)および[すべての項目の更新] PowerShellを使用したリスト](http:// http://stackoverflow.com/questions/9946801)と[ドキュメントライブラリ/リスト内のアイテムのコレクションを取得](http:// http://stackoverflow.com/questions/ 31843222) – TessellatingHeckler

答えて

0

は、あなたが探している何を取得する必要があります簡単な抜粋です:

# Define the URL of the site collection you will be querying 
$siteURL = "http://yourfarm.domain.com/" 
# Define the Title of the web that hosts your list 
$webTitle = "TheWebTheListIsOn" 
# Define the Title of the List that you will be querying 
$listTitle = "ListA" 

# Create a unique file name for the csv export 
$date = Get-Date -UFormat "%Y%m%d" 
$csvFilePath = "$($webTitle.Replace(' ',''))_$($listName.Replace(' ',''))_$($date).csv" 

# Query the list based on a criteria and export to csv 
$items = Get-SPSite -Identity $siteURL ` 
    | select -ExpandProperty AllWebs ` 
    | where { $_.Title -eq $webTitle } ` 
    | select -ExpandProperty Lists ` 
    | where { $_.Title -eq $listTitle } ` 
    | select -ExpandProperty Items ` 
    | where { $_['Company'] -like "C*" } ` 
    | select Id, Name, Company, Address ` 
    | Export-Csv -NoTypeInformation -Path $csvFilePath 
関連する問題