Advertisement
In this article we are going
to learn how to Get Random SharePoint items using PowerShell.
PowerShell is a Powerful
scripting language, we can do our work/tasks easily, having so many built-in
commands are available in PowerShell. In that we are using Get-Random command
to get the random SharePoint list items.
add-pssnapin
microsoft.sharepoint.powershell
$web = get-spweb -identity
"http://dotnetsharepoint.com /sites/sharepoint/getrandom "
$Employeelist =
$web.lists["Employee"];
$listitemsTotal =
$Employeelist.Items.Count
$getvalues =
$Employeelist.Items
if($listitemsTotal -gt 0)
{
$Random=Get-Random -Count
$listitemsTotal -InputObject(1..$listitemsTotal)
}
for($j=0;$j -lt
$listitemsTotal;$j++){
$RandomVal=$Random[$j]
$EmpNameName=$getvalues[$RandomVal]["EmployeeId"];
Write-host $RandomVal
write-host $EmpNameName
}

1B072FBA3B
ReplyDeleteÜcretli Şov
Whatsapp Ücretli Show
Görüntülü Show
Fantastic content! Looking forward to more.
ReplyDeleteC34E06FA
ReplyDeleteAydın
Hakkari
Düzce
NevÅŸehir
Isparta
Zonguldak
NiÄŸde
Yalova
Malatya
8FD8105E
ReplyDeleteSusurluk
Demetevler
Araban
Dalaman
Tire
Darıca
Nusaybin
Bandırma
Beykoz