Sunday, February 23, 2014

SharePoint 2010 to 2013 Upgrade/Migration - Resource Links

SharePoint 2010 to 2013 Upgrade/Migration Microsoft TechNet resource links. I have gone through these excellent TechNet resources and found them helpful.

Resource links:


1.       Overview of Upgrade Process: http://technet.microsoft.com/en-us/library/cc262483.aspx
3.       Classic Authentication to Claims Based Authentication: http://technet.microsoft.com/en-us/library/gg251985.aspx
4.       Upgrade Service Applications: http://technet.microsoft.com/en-us/library/jj839719.aspx
5.       Upgrade Databases from SP 2010 to SP 2013: http://technet.microsoft.com/en-us/library/cc303436.aspx
6.       Changes from SP 2010 to SP 2013: http://technet.microsoft.com/en-us/library/ff607742(v=office.15).aspx
7.       Best Practices to upgrade from SP 2013: http://technet.microsoft.com/en-us/library/cc261992.aspx
8.       Trial Upgrade to SP 2010 Farm: http://technet.microsoft.com/en-us/library/cc262155.aspx
10.   Checklist for Database Attach method: http://technet.microsoft.com/en-us/library/ff607663.aspx

12.   Manage Site Collection Upgrades: http://technet.microsoft.com/en-us/library/jj219599.aspx

Monday, January 13, 2014

Nintex Database SQL Queries - Nintex Workflow Constants, Nintex Workflow Schedules

The SQL query returns Nintex Workflow constants and Nintex Workflow schedules from the Nintex Workflow database.

First I would like to start off with a PowerShell script that you can use to find a list of GUIDs for each of your site collections for use with the SQL queries. Run this command from your SharePoint management Shell:

Get-SPSite | Select Url,ID, RootWeb

Nintex Workflow Constants:
This first query will give you a list of all of the workflow constants in the 2007 DB that are not credentials.

SELECT  Title,Description,Value,Sensitive,SiteId,WebId,Type,AdminOnly
FROM [NW2007]..[WorkflowConstants]
WHERE Type != 'Credential'
ORDER BY SiteID

The next query will give you a list of [workflow constant] credentials only:

SELECT  Title,Description,Sensitive,SiteId,WebId,Type,AdminOnly
FROM [NW2007DB]..[WorkflowConstants]
WHERE Type = 'Credential'
ORDER BY SiteID

Nintex Workflow Schedule:
This last query will give you a list of all of the scheduled workflows in your environment sorted by site ID. This should allow you to target specific sites and recreate the schedules.

SELECT   SiteId,ListId,WebId,WorkflowId,ItemId,NextRunTime,Schedule,StartData,ModifiedBy,IsBroken,
IdentityUser
FROM [NW2007DB]..[WorkflowSchedule]
ORDER BY SiteID

Please run each of these queries against the Nintex 2007 database. Happy programming :)

Thursday, December 26, 2013

Setting your SharePoint Farm in Read-Only mode

Listed below are steps to put SharePoint Farm into Read Only mode. You might want to do this activity at the time of cut-over to a new version of SharePoint like 2007 to 2010/2013 upgrade or performing a maintenance activity on the servers to block user traffic etc. Its advisable to put only SharePoint Content databases in Read Only mode during such a cut-over activity, since you might still want other services like User Profile, Search, Managed Metadata, Excel services etc to be operational in the farm.

1. Put all the SharePoint Servers (App, WFE, Search servers) in Maintenance Mode using SCOM/Spectrum

2. Unschedule Search Crawls & User Profile Synch jobs - Do not stop On-going Search Crawls. Let it complete successfully and then un-schedule it. You may choose to keep Search Crawls unscheduled, as there will not be any new content added during Read-Only mode.

3. Unschedule all Windows Task Scheduler Jobs (related to SharePoint). Again do not stop the on-going scheduled jobs and let them complete successfully prior to un-scheduling them.

4. Disable the following Timer Jobs: (You can develop a PowerShell script to programmatically disable the following timer jobs, if they are enabled at webapps. In my case, I did develop a script to disable timer jobs)
Bulk workflow task processing
Change Log
Database Statistics
Dead Site Delete
Disk Quota Warning
Expiration policy
Hold Processing and Reporting
Immediate Alerts
Information management policy
Profile Synchronization
Quick Profile Synchronization
Records Center Processing
Recycle Bin
Scheduled Approval
Scheduled Page Review
Scheduled Unpublish
Search and Process
Shared Services Provider Synchronizing Job
Site Collection: Delete
Usage Analysis
Variations Propagate Page Job Definition
Variations Propagate Site Job Definition
Windows SharePoint Services Watson Policy Update
Workflow
Workflow Auto Cleanup
Workflow Failover
Nintex Workflow Scheduler (if you have Nintex Workflows installed)
Any third party timer jobs related to SharePoint

5. Stop SharePoint 2010 Applications
 @echo Stopping services...
NET STOP SPAdminV4
NET STOP SPTimerV4
NET STOP SPTraceV4
NET STOP SPUserCodeV4
NET STOP SPWriterV4
NET STOP SPSearch4
NET STOP OSearch14
NET STOP "IIS Admin Service"
NET STOP w3svc
NET STOP smtpsvc
@pause

6. DBA to put SharePoint Content in Read-Only mode. A list of Content DBs associated to several site collections can be identified using the following STSADM command:
stsadm.exe -o enumsites -url {WebApp URL} > ".\Report\webappname-$(Get-Date -Format MM-dd-yyyy-HH-mm).xml"

You might also have third party components like Nintex, DocWay etc, databases related to these components should also be put in Read-Only mode.

7. Start SharePoint 2010 Application (Run the Start batch script)
 @echo Starting services...
NET START SPAdminV4
NET START SPTimerV4
NET START SPTraceV4
NET START SPUserCodeV4
NET START SPWriterV4
NET START SPSearch4
NET START OSearch14
NET START "IIS Admin Service"
NET START w3svc
NET START smtpsvc
@pause

8. Disable Kerberos authentication from Default zones/Custom zones

9. Take Servers out of maintenance mode using SCOM/Spectrum

10. Enable User Profile Synch Job and Search Crawls for User Profiles (sps3:mysites)
This would ensure that newly added users during the Read Only period are still available in the Profile and you can access them, if you have custom People Search that could directly access User Profile store.
To ensure newly added users have access to the SharePoint farm for your public facing sites, you would want to have All Authenticated Users permissions set for those intranet/internet facing sites.

11.Smoke Test (Ad-hoc testing on Read Only scenarios)

At the end, you can put all these steps in your Quality center site and run them as Test cases and make it a standardized process.

Next part will cover, Rollback steps and PowerShell script to Disable/Enable Timer jobs

Friday, July 19, 2013

Powershell script to print All User Profiles properties/values - SharePoint User Profile Store

This script prints all User Profile properties/values available inside SharePoint User Profile store.

1.  Loops through all site collection to save usernames to a hash table
2.  Loops through the UserProfiles and output user profile values to log file

Script Usage: .GatherMySiteProfileInfo.ps1 -farm [dev|test|prod] -log

Copy Powershell script as shown below and replace parameters marked in red with proper values:
-----------------------------------------------------------------------------------------------
param($farm, $log)

if($farm -ne $null)
{
    switch($farm)
    {
       "prod" {$SSPName="Enter Prod SSPName"
               $MySiteURL = "https://mysite.sharepointfix.com/"}
       "test" {$SSPName="Enter Test SSPName"
               $MySiteURL = "https://mysite-test.sharepointfix.com/"}
    "dev" {$SSPName="Enter Dev SSPName"
              $MySiteURL = "https://mysite-dev.sharepointfix.com/"}
        default {"`nfarm incorrect, SYNTAX: .GatherMySiteInfo.ps1 -farm [dev|test|prod] -log `n"; exit}
    }
}

#Load the SharePoint assemblies
[void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.Office.Server")| out-null
[void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.Office.Server.UserProfiles")| out-null
[void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")| out-null

# Setup the UserProfileManager object
try
{
    $ServerContext = [Microsoft.Office.Server.ServerContext]::GetContext($SSPName)
    $UPManager = new-object Microsoft.Office.Server.UserProfiles.UserProfileManager($ServerContext);
}
catch
{
    Write-Host "Can't access User Profile Manager"
    exit;
}

$logName  = "." + "AllUserProfiles" + "-" + $(Get-Date -Format MM-dd-yyyy-HH-mm) + ".csv"

# Get an enumerator and loop through all the profiles
$enumProfiles = $UPManager.GetEnumerator()

$i = 0
$per = 0
$profileCount = $UPManager.Count;

foreach ($up in $enumProfiles)
{
  #Get all User Profile Property values. You can define your own properties as well
  [String]$userName = $up.Item("Accountname") #example: amjsaito, Needs to be a string so we can parse
  [String]$employeeType = $up.Item("employeetype")
  [String]$orgStatus = $up.Item("organizationalStatus")
  [String]$mgmtCtr = $up.Item("MgtCenterName")
  [String]$costCenName = $up.Item("CostCenterName")
  [String]$costCenNum = $up.Item("CostCenterNumber")
  [String]$building = $up.Item("Building")
  [String]$locationCode = $up.Item("LocationCode")
  [String]$aboutme = $up.Item("AboutMe")
  [String]$resp = $up.Item("SPS-Responsibility")
  [String]$skills = $up.Item("SPS-Skills")
  [String]$projects = $up.Item("SPS-PastProjects")
  [String]$memberships = $up.Item("ProfessionalMemberships")
  [String]$schools = $up.Item("SPS-School")
  [String]$interests = $up.Item("SPS-Interests")
  [String]$pictureURL = $up.Item("PictureURL")
  [String]$myFunction = $up.Item("MyFunction")
  [bool]$hasMySite = $false

  #strip off the domain name
  $URLBreak = $userName.LastIndexOf('');
  $user = $userName.SubString($URLBreak+1);

  Write-Output "`"$username`",`"$employeeType`",`"$orgStatus`",`"$mgmtCtr`",`"$costCenName`",`"$costCenNum`",`"$building`",`"$locationCode`",`"$hasMySite`", `"$aboutme`",`"$resp`",`"$skills`",`"$projects`",`"$memberships`",`"$schools`",`"$interests`",`"$pictureURL`",`"$myFunction`"" | Out-File $logname -append

  $i++

  #if ($i -lt $profileCount) {
    $per = ($i/$profileCount) * 100;
  #}

   $per = "{0:N2}" -f $per
   Write-Progress -Activity "Print All User Profiles" -PercentComplete $per -CurrentOperation "$per% complete" -Status "Looping Through User Profiles"
 }

Saturday, March 2, 2013

Powershell script to report all SharePoint Farm Feature Definitions in a Grid View

The PowerShell script below generates a Grid View report on all SharePoint Features installed within a Farm.

Copy the script below and paste it into a .ps1 file.
==================================================================

Add-PsSnapin Microsoft.SharePoint.PowerShell

## SharePoint DLL
[void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")
[void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Administration")

## Creating SharePoint Farm
$farm = [Microsoft.SharePoint.Administration.SPFarm]::Local
$farm.FeatureDefinitions | Select ID, DisplayName, RootDirectory | Out-GridView

Remove-PsSnapin Microsoft.SharePoint.PowerShell
==================================================================

Alternatively, you can also generate a CSV report, based on the above script.