performance problem

Hi;

I Have a script power shell which read a CSV file in input and create several sites collestion (40) and for each site collection it create about 100 subsites.

Execution of my script is very long :  12 hours !

My question : its possible to improve the execution time (for example : multi-threading or another solution) ?

Regards

  • Edited by soussou97 22 hours 54 minutes ago
February 16th, 2015 8:07am

Soussou97,

Fancy posting your script so we can help you troubleshoot?

Free Windows Admin Tool Kit Click here and download it now
February 16th, 2015 9:39am

Hi;

My code read a CSV file in input and call this function with the 2 parameters :  the name of the site collection ($dscc) and the content base ($database) :

function CreateCollectionSites
{
    param(
        [string]$dscc,
        [string]$database
          )
    $SiteCollectionUrl = $WebAppSharepointUrl + "/sites/" + $dscc
    $SPSite = Get-SPSite -Identity $SiteCollectionUrl -ErrorAction SilentlyContinue
    if($SPSite -eq $null)
    {
       try
          {
            
            New-SPSite -Url $SiteCollectionUrl -OwnerAlias $SPSiteOwner -Language 1036 -Template "STS#0" -ContentDatabase $database
            Import-SPWeb  $SiteCollectionUrl -Path $fichierRTO -UpdateVersions overwrite -IncludeUserSecurity
            Set-SPSite -Identity  $SiteCollectionUrl -OwnerAlias $SPSiteOwner -SecondaryOwnerAlias $SPSiteOwnerAlias
            Install-SPUserSolution -identity "LaPoste.DTC.Intranet.GenericBranding.wsp" -site $SiteCollectionUrl
            Install-SPUserSolution -identity "ModeleSiteCourrier.wsp" -site $SiteCollectionUrl
            $web = Get-SPWeb $SiteCollectionUrl
            if ($web -eq $null)
            {
                $out = "## La collection de sites n'a pas t cre! ## " + $SiteCollectionUrl
                $out | out-file $traceFile -append
                return $false
            }
            else
            {
                $web.Title = $dscc
                $web.Update()
                $out = "## LA COLLECTION DE SITES $SiteCollectionUrl A ETE CREEE AVEC SUCCES DANS LA BASE  $database ##"    
                $out | out-file $traceFile -append
                return $true
            }
          }
        catch
        {
                                        
                $out = "## ERREUR - LA CREATION DE LA COLLECTION DE SITES $SiteCollectionUrl A ECHOUE ##"
                $out | out-file $traceFile -append
                Read-Host  "## ERREUR - LE DEPLOIEMENT A ECHOUE : APPUYER SUR UNE TOUCHE POUR QUITER..."
                return $false
                               
        }
                
    }
    else
    {
         $out = "## LA COLLECTION DE SITES $SiteCollectionUrl EXISTE DEJA ##"
         $out | out-file $traceFile -append
         return $true                      
    }                
}

regards

February 17th, 2015 4:48am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics