Sharepoint 2010 - refresh list job
문제
I need to refresh all my lists in server daily.
To refresh one list I use this powershell:
$web = Get-SPWeb http://Server/ListLocation
$list = $web.Lists["ListA"]
foreach ($item in $list.Items)
{
$item.UpdateOverwriteVersion();
}
How to refresh all lists? And how do you create a job so it runs daily at 8:00 p.m.?
해결책
You can use the PowerShell command to refresh all lists:
$web = Get-SPWeb Server/ListLocation
$lists = $web.Lists
foreach ($list in $Lists) {
foreach ($item in $list.Items)
{
$item.UpdateOverwriteVersion();
}
}
To run the script daily, I recommend you save the script as ".ps1" file and using Windows Task Scheduler to run the script file daily.
제휴하지 않습니다 sharepoint.stackexchange