Posts

Showing posts from May, 2015

PowerShell Script to find out Dead sites from SharePoint

This script will pull out the list of dead sites acording to inputs provided in number of days. It will export information in .CSV file such as Site admin name, Site name, Last modified, email address of Site admin. $daysInActive = Read-Host “Enter in number of days to check since last modified” $date = (Get-Date).AddDays(-$daysInActive).ToString(“MM/dd/yyyy”) Write-Host $date $webApps = Get-SPWebApplication foreach($webApp in $webApps) { Write-Host $webApp.URL foreach($siteColl in $webApp.Sites) { [Microsoft.SharePoint.SPSecurity]::RunWithElevatedPrivileges({ #Write-Host “in sitecollection” #if($siteColl.URL -ne $null) # { #Write-Host “url is not null” foreach($web in $siteColl.AllWebs ) { #Write-Host $web.URL if($web -ne $null) { if ($web.LastItemModifiedDate -le $date) { $SiteAdminsEmail = “”; $SiteAdminsNames = “”; foreach($siteAdmin in $web.SiteAdministrators) { $SiteAdminsEmail+= $siteAdmin.Email+”;” $SiteAdminsNames+=$siteAdmin.DisplayName+”;” } $web.Url + “|” ...

Disable Loopback Check Powershell

Run this script on all SharePoint servers by using PowerShell to Disable Loop Back Check. New-ItemProperty HKLM:\System\CurrentControlSet\Control\Lsa -Name "DisableLoopbackCheck" -value "1" -PropertyType dword

Merge Log file in to one file

Merge-SPLogFile -Path C:\mergelog\log.txt -Correlation b0428e3b-d8a1-4187-b7a6-4b84b82c5a4b​​ Merge-SPLogFile -Path "E:\FarmMergedmLog0311.log" -Overwrite -StartTime "11/3/2016 4:52" -EndTime "11/3/2016 4:55"

Copy Group Permissions

Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue   #Input variables $SourceWebURL = "https://abc.def.com/sites/test/" $TargetWebURL = "https://def.hij.com/sites/Test2" $SourceGroupName="T7D Owners" $TargetGroupName="E7R Owners"   #Get the Webs $SourceWeb = Get-SPWeb $SourceWebURL $TargetWebURL= Get-SPWeb $TargetWebURL   #Get the Source and Target Groups $SourceGroup = $SourceWeb.groups | where {$_.name -eq $SourceGroupName } $TargetGroup = $TargetWebURL.groups | where {$_.name -eq $TargetGroupName }   #Iterate through each users in the source group foreach ($user in $SourceGroup.users) {    $TargetGroup.AddUser($user)     Write-Host "Copied $user from $SourceGroup to $TargetGroup"     #To move users, Just remove them from source group     #$SourceGroup.RemoveUser($user) } $SourceWeb.Dispose(); $TargetWebURL.Dispose();

Enable Taxonomy feature on Site collection

If you are getting this error when try to add a custom column of the Managed Metadata type to your site collection then simply use the following command to activate this feature: STSADM -o activatefeature -id 73EF14B1-13A9-416b-A9B5-ECECA2B0604C -url http:// -force Where the feature is the name of the server, since this is a farm feature. If you are more inclined to use Powershell, and why wouldn’t you be, then use this cmdlet: Enable-SPFeature -id 73EF14B1-13A9-416b-A9B5-ECECA2B0604C  -URL ​​

Sync Taxonomy Hidden list on Site Collection

$siteUrl = " http://abc.def.com/sit es/test/ " $site = Get-SPSite $siteUrl [Microsoft.Shar ePoint.Taxonomy .TaxonomySessio n]::SyncHiddenL ist($site) $site.dispose() ​

Extract all WSP from Sharepoint farm

Hi All,Attached script will help you to take backup of all WSP installed in your farm.You need to specify the path where the WSP should be extracted. It will also generate .txt file with the names of WSP and show output in Powershell console.Hope this will help you !!If you like ​$dirName = "D:\Production Farm Backup\All_Prod_WSP\"  Write-Host Exporting solutions to $dirName   foreach ($solution in Get-SPSolution)   {       $id = $Solution.SolutionID       $title = $Solution.Name       $filename = $Solution.SolutionFile.Name      Write-Host "Exporting ‘$title’ to …\$filename" -nonewline     $title >> ".\WSP_List.txt"      try {           $solution.SolutionFile.SaveAs("$dirName\$filename")           Write-Host " – done" -foreground green       }       catch     ...

Missing scrollbar on Sharepoint 2010 startpage

I found out something myself when using developer tools in IE9. It's all about the v4master ... I removed the v4master in developer tool in the following line: as soon as the like was the scrollbars appeared and was fully functional. I have been looking into the v4.master in our _catalogs/masterpage/ directory, but I can't find anywhere to just set the scrollbar functions.​

Get SharePoint Workflow Queue Count

This script will output the Workflow Queue count for each queue. This can be used for tuning the SharePoint Workflow Engine. #-------------------------------------------------------------------------------------------  # Name:            Get-SPFarmWorkflowQueue.ps1 V1  # Description:     This script provide the number of Workflow SPWorkItems for each db  # Usage:        run .\Get-SPFarmWorkflowQueue.ps1  # By:             Ivan Josipovic, softlanding.ca  #-------------------------------------------------------------------------------------------  #WorkflowTaskType         bdeadf08-c265-11d0-bced-00a0c90ab50f  #WorkItemHostType         bdeadf09-c265-11d0-bced-00a0c90ab50f  #WorkflowFailover         bdeadf17-c265-11d0-bced-00a0c90ab50f  #WorkflowTimerType     ...

Error when attempting to access Configure service accounts - SharePoint 2010/2013

Image
Error when attempting to access Configure service accounts. SharePoint 2010/2013 Issue: Attempting to configure service accounts errors – Correlation ID shows the following error syntax “Application error when access /_admin/FarmCredentialManagement.aspx, Error=Some or all identity references could not be translated. at system.security.principal.NTAccount….” The story: Being a diligent admin, I was cleaning up unused accounts for simplicity and tracking. We are in the middle of deploying a large scale BI deployment and if you have done so, you understand the importance of keeping track of your service accounts. The service account I deleted was an afterthought account. An account that would possibly be used for an unattended Performance Point set up. So, first thing I did was go to good old Active Directory and removed the account, I would get to CA later… J Well later came and in the midst of many projects and tasks, and age… it got off my radar. When the time came to get ...

How to find out All Site collection size in Particular web application

Get-SPWebApplication http://webapplicationurl | Get-SPSite -Limit all | select url, @{label="Size in MB";Expression={$_.usage.storage/1MB}} | Sort-Object -Descending -Property "Size in MB" | Format-Table –AutoSize​ > C:\sitesize.csv ​

Import / Export Managed Metadata Service Application

Import Managed Metadata Service Application ================================================================================= Add-PsSnapin Microsoft.SharePoint. Powershell -ErrorAction SilentlyContinue $mmsApplication = Get-SPServiceApplication | ?{$_.TypeName -eq "Managed Metadata Service"} $mmsProxy = Get-SPServiceApplicationProxy | ?{$_.TypeName -eq "Managed Metadata ServiceConnection"} if ((read-host "WARNING: Running this script will overwrite all existing Terms in the chosen Managed Metadata Service, type Y to confirm otherwise press any key") -eq "Y") {    Import- SPMetadataWebServicePartitionD ata -Identity $mmsApplication.Id -ServiceProxy $mmsProxy -Path "\\sysldns012\sharepoint\ backups\15-07-2014\MMS_15-07- 2014.cab" -OverwriteExisting;  #Enter valid location to export to }​ ​ ============================================================== Export Managed Metadata Service application Add-PsSnapin M...