Thursday, October 31, 2013

Powershell to list all webs with UI version 3 for sharepoint 2013 upgrade purpose


Add-Pssnapin Microsoft.SharePoint.Powershell
 
$s | Get-SPSite -limit all | ForEach-Object {$site =$_;

$site | Get-SPWeb -limit all | ForEach-Object {

if($_.UIVersion -eq 3)

{

write-host "UI version : " $_.UIVersion  $_.Url

}

}}

SharePoint 2010 and Project Web app error provisioning

Had a strange error the other day with provisioning a Project Web Application (PWA).  

The errors didn't really say much except these three event log items.  Errors below. 

To resolve I have to create the PWA site on another environment and then do a back up and restore to a site collection in the environment that was breaking.   then run the provisioning on central admin.  Everything works great after. 


- <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">

- <System>

<Provider Name="Microsoft-SharePoint Products-Project Server" Guid="{B2178104-...}" />

<EventID>7381</EventID>

<Version>14</Version>

<Level>2</Level>

<Task>20</Task>

<Opcode>0</Opcode>

<Keywords>0x4000000000000000</Keywords>

<TimeCreated SystemTime="2013-10-23T21:08:38.396865600Z" />

<EventRecordID>251151</EventRecordID>

<Correlation ActivityID="{DE39B42B...}" />

<Execution ProcessID="7972" ThreadID="4988" />

<Channel>Application</Channel>

<Computer>xxx.domain.com</Computer>

<Security UserID="S-1-5..." />

</System>

<EventData />

</Event>
-----------------------------------------------------------------
- <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">

- <System>

<Provider Name="Microsoft-SharePoint Products-Project Server" Guid="{B2178104..}" />

<EventID>6966</EventID>

<Version>14</Version>

<Level>2</Level>

<Task>20</Task>

<Opcode>0</Opcode>

<Keywords>0x4000000000000000</Keywords>

<TimeCreated SystemTime="2013-10-23T21:08:39.100031100Z" />

<EventRecordID>251152</EventRecordID>

<Correlation ActivityID="{DE39B42B...}" />

<Execution ProcessID="7972" ThreadID="4988" />

<Channel>Application</Channel>

<Computer>xxx.domain.com</Computer>

<Security UserID="S-1-5..." />

</System>

- <EventData>

<Data Name="string0">PW</Data>

<Data Name="string1">Microsoft.Office.Project.Server.Administration.ProvisionException: Post provisioning setup failed. at Microsoft.Office.Project.Server.Administration.PsiServiceApplication.CreateSite(ProjectProvisionSettings provset)</Data>

</EventData>

</Event>
-------------------------------------------------------------------------------------------------
- <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">

- <System>

<Provider Name="Microsoft-SharePoint Products-Project Server" Guid="{B2178104...}" />

<EventID>6971</EventID>

<Version>14</Version>

<Level>2</Level>

<Task>20</Task>

<Opcode>0</Opcode>

<Keywords>0x4000000000000000</Keywords>

<TimeCreated SystemTime="2013-10-25T18:11:34.919153600Z" />

<EventRecordID>252921</EventRecordID>

<Correlation ActivityID="{27BA856F...}" />

<Execution ProcessID="9040" ThreadID="2700" />

<Channel>Application</Channel>

<Computer>xxx.domain.com</Computer>

<Security UserID="S-1-5..." />

</System>

- <EventData>

<Data Name="string0">/PWA</Data>

<Data Name="string1">Microsoft.Office.Project.Server.Administration.ProvisionException: Post provisioning setup failed. at Microsoft.Office.Project.Server.Administration.PsiServiceApplication.CreateSite(ProjectProvisionSettings provset)</Data>

</EventData>

</Event>

Thursday, October 17, 2013

Simple powershell to set key/value pair in the web application properties

-Don't forget to add the snap in if not using the sharepoint ps console.

function SetPropertyBag ($webAppUrl, $key, $value) {

    $spwebApp=Get-SPWebApplication -Identity $webAppUrl
    Write $spwebApp

    if($spwebApp.AllProperties.ContainsKey($key) -eq $False)
    {
        $spwebApp.AllProperties.Add($key,$value);      
    }
    else
    {$spwebApp.AllProperties[$key]=$value; }

    Write-Host -foregroundcolor Green "value set in "  $key  " = "  $spwebApp.AllProperties[$key]  

    }

$webAppUrl= Read-Host 'Enter the web application url';

$keystring= Read-Host 'Enter the key string';
$valuestring= Read-Host 'Enter the value string';
SetPropertyBag $webAppUrl $keystring $valuestring;