Category Archives: Scripts

Delete users from User Information List

Delete Users from User information List. Get the user details from previous script matching the criteria and use excel to import from text and get the CSV #This script will remove users specified in the CSV. $CSVFile = Import-CSV D:\Indra\Users.CSV # Change the path Add-PSSnapin Microsoft.SharePoint.PowerShell -EA SilentlyContinue #Get all site collections $Sites = Get-SPSite… Read More »

Get Users matching a Domain

Get Users matching a Domain in User Information List. # Run with SharePoint 2010 Management Shell $webUrl = “http://SharePoint” $web = Get-SPWeb $webUrl #$list = $web.Lists[“User Information List”] $user = Get-SPUser -web $web -Limit All | Where-Object {$_.UserLogin -Like “*AD\*”} | Format-Table -Autosize | Out-File D:\Indra\Users.txt Write-Host Done. Change the URL and out-put file path… Read More »

Blobcache text file

Blobcache.txt # from<br><br><br>function Enable-SPBlobCache {<br><br>param(<br><br> [Parameter(Mandatory=$true, ValueFromPipeline=$true, Position=0)]<br> [Microsoft.SharePoint.PowerShell.SPWebApplicationPipeBind]<br> $WebApplication<br>)<br><br> process {<br><br> $WebApp = $WebApplication.Read()<br> # SPWebConfigModification to enable BlobCache<br> $configMod1 = New-Object Microsoft.SharePoint.Administration.SPWebConfigModification<br> $configMod1.Path = "configuration/SharePoint/BlobCache" <br> $configMod1.Name = "enabled" <br> $configMod1.Sequence = 0<br> $configMod1.Owner = "BlobCacheMod" <br> ## SPWebConfigModificationType.EnsureChildNode -> 0<br> ## SPWebConfigModificationType.EnsureAttribute -> 1<br> ## SPWebConfigModificationType.EnsureSection -> 2<br> $configMod1.Type = 1<br>… Read More »