Translate

Sunday, June 30, 2013

Can't Save site as a template - getting error about the first list; albeit announcements or some other custom list that was created.

If you're trying to save a site as a template, so that you can use it in a workflow, (e.g for Project Server new site creation, or just as some sort of custom site for your users) and are unable to do so due to an error about first list; usually announcements or some other custom list that was created, this should work:


Run the SharePoint 2010 Management Shell as Administrator.  Run the following command to disable the default content type feature:
Disable-SPFeature –Identity ctypes –url http://SiteCollection
Then enable the content type feature:
Enable-SPFeature –Identity ctypes –url http://SiteCollection
If you look at your content types, they should now all be there.  Try saving the subsite as a template again, it should succeed.

Sunday, June 23, 2013

SharePoint Virtual Labs and SP 2010 vs 2013

Sorry to be blogurgitating this week.

Here's a really good technet site with a load of virtual labs:

SharePoint Server 2010



Here's a really good msdn site with a ton of virtual labs: 

SharePoint Server 2010 Virtual Labs on MSDN

SharePoint Server 2010 vs 2013




Sunday, June 16, 2013

SharePoint 2010 Script - UPA rem'd out

Here is a copy of the script that was used during the creation of this video found in the earlier blog post, from today. 

<skip>

The entire script replaces the initial configuration wizard.  Another way to think of it, is it replaces the actions that are kicked off when a user selects yes to the question asking if they would like SharePoint to configure everything. 

The difference is this script generates clean (GUID free) databases.  That is, SharePoint databases without GUID's.

</End skip>

The User Profile Application is remarked out, as there are known issues with creating the user profile sync service app with powershell.

The parts in green are attempting to demonstrate what would be needed to only create the managed metadata service application.  This is true for the remaining service apps, with the exception of search.  In other words, if you wanted to only create the search application, you would need the parts in green, minus the metadata part, and then everything between ##Start Search and ##End Search

To use this, just copy it into a notepad file and then save the notepad file with a .ps1 extension.

Here's a good video of this script in action

#####################################################
This script replicates most of the functionality found in the SharePoint Products Configuration Wizard with the EXCEPTION of the USER PROFILE SERVICE

#####################################################

Add-PSSnapin Microsoft.SharePoint.PowerShell -erroraction SilentlyContinue

## Settings you may want to change ##
$databaseServerName = “2010SQL”
$searchServerName = “2010WEB1” #Front end Server that will run central admin, the server you’re on right now
$saAppPoolName = “SharePoint Web Services Default”
$appPoolUserName = “DOMAIN\MyFarmer” #farm admin account for Timer and Central admin, check that both services are running under this account before
# running this script

## Service Application Service Names ##
$accesssSAName = “Access Services”
$bcsSAName = “Business Data Connectivity Service”
$excelSAName = “Excel Services Application”
$metadataSAName = “Managed Metadata Web Service”
$performancePointSAName = “PerformancePoint Service”
$searchSAName = “SharePoint Server Search”
$stateSAName = “State Service”
$secureStoreSAName = “Secure Store Service”
$usageSAName = “Usage and Health Data Collection Service”
$userProfileSAName = “User Profile Synchronization Service”
$visioSAName = “Visio Graphics Service”
$WebAnalyticsSAName = “Web Analytics Service”
$WordAutomationSAName = “Word Automation Services”



$saAppPool = Get-SPServiceApplicationPool -Identity $saAppPoolName -EA 0
if($saAppPool -eq $null)
{
Write-Host “Creating Service Application Pool…”

$appPoolAccount = Get-SPManagedAccount -Identity $appPoolUserName -EA 0
if($appPoolAccount -eq $null)
{
Write-Host “Please supply the password for the Service Account…”
$appPoolCred = Get-Credential $appPoolUserName
$appPoolAccount = New-SPManagedAccount -Credential $appPoolCred -EA 0
}

$appPoolAccount = Get-SPManagedAccount -Identity $appPoolUserName -EA 0

if($appPoolAccount -eq $null)
{
Write-Host “Cannot create or find the managed account $appPoolUserName, please ensure the account exists.”
Exit -1
}

New-SPServiceApplicationPool -Name $saAppPoolName -Account $appPoolAccount -EA 0 > $null

}





Write-Host “Creating Usage Service and Proxy…”
$serviceInstance = Get-SPUsageService
New-SPUsageApplication -Name $usageSAName -DatabaseServer $databaseServerName -DatabaseName “UsageDB” -UsageService $serviceInstance > $null




Write-Host “Creating Access Services and Proxy…”
New-SPAccessServiceApplication -Name $accesssSAName -ApplicationPool $saAppPoolName > $null
Get-SPServiceInstance | where-object {$_.TypeName -eq “Access Database Service”} | Start-SPServiceInstance > $null




Write-Host “Creating BCS Service and Proxy…”
New-SPBusinessDataCatalogServiceApplication -Name $bcsSAName -ApplicationPool $saAppPoolName -DatabaseServer $databaseServerName -DatabaseName “BusinessDataCatalogDB” > $null
Get-SPServiceInstance | where-object {$_.TypeName -eq “Business Data Connectivity Service”} | Start-SPServiceInstance > $null




Write-Host “Creating Excel Service…”
New-SPExcelServiceApplication -name $excelSAName –ApplicationPool $saAppPoolName > $null
Set-SPExcelFileLocation -Identity “http://” -ExcelServiceApplication $excelSAName -ExternalDataAllowed 2 -WorkbookSizeMax 10 -WarnOnDataRefresh:$true
Get-SPServiceInstance | where-object {$_.TypeName -eq “Excel Calculation Services”} | Start-SPServiceInstance > $null




Write-Host “Creating Metadata Service and Proxy…”
New-SPMetadataServiceApplication -Name $metadataSAName -ApplicationPool $saAppPoolName -DatabaseServer $databaseServerName -DatabaseName “MetadataDB” > $null
New-SPMetadataServiceApplicationProxy -Name “$metadataSAName Proxy” -DefaultProxyGroup -ServiceApplication $metadataSAName > $null
Get-SPServiceInstance | where-object {$_.TypeName -eq “Managed Metadata Web Service”} | Start-SPServiceInstance > $null




Write-Host “Creating Performance Point Service and Proxy…”
New-SPPerformancePointServiceApplication -Name $performancePointSAName -ApplicationPool $saAppPoolName -DatabaseServer $databaseServerName -DatabaseName “PerformancePointDB” > $null
New-SPPerformancePointServiceApplicationProxy -Default -Name “$performancePointSAName Proxy” -ServiceApplication $performancePointSAName > $null
Get-SPServiceInstance | where-object {$_.TypeName -eq “PerformancePoint Service”} | Start-SPServiceInstance > $null


##START SEARCH

Write-Host “Creating Search Service and Proxy…”
Write-Host ” Starting Services…”
Start-SPEnterpriseSearchServiceInstance $searchServerName
Start-SPEnterpriseSearchQueryAndSiteSettingsServiceInstance $searchServerName

Write-Host ” Creating Search Application…”
$searchApp = New-SPEnterpriseSearchServiceApplication -Name $searchSAName -ApplicationPool $saAppPoolName -DatabaseServer $databaseServerName -DatabaseName “SearchDB”
$searchInstance = Get-SPEnterpriseSearchServiceInstance $searchServerName

Write-Host ” Creating Administration Component…”
$searchApp | Get-SPEnterpriseSearchAdministrationComponent | Set-SPEnterpriseSearchAdministrationComponent -SearchServiceInstance $searchInstance


##Crawl
Write-Host ” Creating Crawl Component…”
$InitialCrawlTopology = $searchApp | Get-SPEnterpriseSearchCrawlTopology -Active
$CrawlTopology = $searchApp | New-SPEnterpriseSearchCrawlTopology
$CrawlDatabase = ([array]($searchApp | Get-SPEnterpriseSearchCrawlDatabase))[0]
$CrawlComponent = New-SPEnterpriseSearchCrawlComponent -CrawlTopology $CrawlTopology -CrawlDatabase $CrawlDatabase -SearchServiceInstance $searchInstance
$CrawlTopology | Set-SPEnterpriseSearchCrawlTopology -Active

Write-Host -ForegroundColor white ” Waiting for the old crawl topology to become inactive” -NoNewline
do {write-host -NoNewline .;Start-Sleep 6;} while ($InitialCrawlTopology.State -ne “Inactive”)
$InitialCrawlTopology | Remove-SPEnterpriseSearchCrawlTopology -Confirm:$false
Write-Host



##Query
Write-Host ” Creating Query Component…”
$InitialQueryTopology = $searchApp | Get-SPEnterpriseSearchQueryTopology -Active
$QueryTopology = $searchApp | New-SPEnterpriseSearchQueryTopology -Partitions 1
$IndexPartition= (Get-SPEnterpriseSearchIndexPartition -QueryTopology $QueryTopology)
$QueryComponent = New-SPEnterpriseSearchQuerycomponent -QueryTopology $QueryTopology -IndexPartition $IndexPartition -SearchServiceInstance $searchInstance
$PropertyDatabase = ([array]($searchApp | Get-SPEnterpriseSearchPropertyDatabase))[0]
$IndexPartition | Set-SPEnterpriseSearchIndexPartition -PropertyDatabase $PropertyDatabase
$QueryTopology | Set-SPEnterpriseSearchQueryTopology -Active


Write-Host ” Creating Proxy…”
$searchAppProxy = New-SPEnterpriseSearchServiceApplicationProxy -Name “$searchSAName Proxy” -SearchApplication $searchSAName > $null


#####END SEARCH


Write-Host “Creating State Service and Proxy…”
New-SPStateServiceDatabase -Name “StateServiceDB” -DatabaseServer $databaseServerName | New-SPStateServiceApplication -Name $stateSAName | New-SPStateServiceApplicationProxy -Name “$stateSAName Proxy” -DefaultProxyGroup > $null




Write-Host “Creating Secure Store Service and Proxy…”
New-SPSecureStoreServiceapplication -Name $secureStoreSAName -Sharing:$false -DatabaseServer $databaseServerName -DatabaseName “SecureStoreServiceAppDB” -ApplicationPool $saAppPoolName -auditingEnabled:$true -auditlogmaxsize 30 | New-SPSecureStoreServiceApplicationProxy -name “$secureStoreSAName Proxy” -DefaultProxygroup > $null
Get-SPServiceInstance | where-object {$_.TypeName -eq “Secure Store Service”} | Start-SPServiceInstance > $null




#Write-Host “Creating User Profile Service and Proxy…”
#$userProfileService = New-SPProfileServiceApplication -Name $userProfileSAName -ApplicationPool $saAppPoolName -ProfileDBServer $databaseServerName -#ProfileDBName “ProfileDB” -SocialDBServer $databaseServerName -SocialDBName “SocialDB” -ProfileSyncDBServer $databaseServerName -ProfileSyncDBName “SyncDB”
#New-SPProfileServiceApplicationProxy -Name “$userProfileSAName Proxy” -ServiceApplication $userProfileService -DefaultProxyGroup > $null
#Get-SPServiceInstance | where-object {$_.TypeName -eq “User Profile Service”} | Start-SPServiceInstance > $null




Write-Host “Creating Visio Graphics Service and Proxy…”
New-SPVisioServiceApplication -Name $visioSAName -ApplicationPool $saAppPoolName > $null
New-SPVisioServiceApplicationProxy -Name “$visioSAName Proxy” -ServiceApplication $visioSAName > $null
Get-SPServiceInstance | where-object {$_.TypeName -eq “Visio Graphics Service”} | Start-SPServiceInstance > $null




Write-Host “Creating Web Analytics Service and Proxy…”
$stagerSubscription = “”
$reportingSubscription = “”
New-SPWebAnalyticsServiceApplication -Name $WebAnalyticsSAName -ApplicationPool $saAppPoolName -ReportingDataRetention 20 -SamplingRate 100 -ListOfReportingDatabases $reportingSubscription -ListOfStagingDatabases $stagerSubscription > $null
New-SPWebAnalyticsServiceApplicationProxy -Name “$WebAnalyticsSAName Proxy” -ServiceApplication $WebAnalyticsSAName > $null
Get-SPServiceInstance | where-object {$_.TypeName -eq “Web Analytics Web Service”} | Start-SPServiceInstance > $null
Get-SPServiceInstance | where-object {$_.TypeName -eq “Web Analytics Data Processing Service”} | Start-SPServiceInstance > $null



Write-Host “Creating Word Conversion Service and Proxy…”
New-SPWordConversionServiceApplication -Name $WordAutomationSAName -ApplicationPool $saAppPoolName -DatabaseServer $databaseServerName -DatabaseName “WordAutomationDB” -Default > $null
Get-SPServiceInstance | where-object {$_.TypeName -eq “Word Automation Services”} | Start-SPServiceInstance > $null

############################################## End Script

Saturday, June 15, 2013

Setup and Initial configuration of SharePoint 2010

Pre-requisites:

  • 64 Bit Server running Server 2008 R2
  • 64 Bit SQL
  • Account that has db_creator, sysadim, securityadmin rights in SQL server, and is local admin on front end server
  • Copy of SharePoint 2010
Steps:
  • Install SQL on the SQL server
  • Run pre-requisite installer on WFE
  • Run setup installer on WFE, only after all pre-requisites are installed
  • Configure farm using powershell - this video demo's the steps
  • PLEASE NOTE:  This procedure does not cover least privilege, which, as a best practice, should be performed before farm is used in production.

Sunday, June 9, 2013

What to do when your site has windows update blocked or turned off, via group policy or some sort of proxy


Sorry about the brevity of my posts lately, it's been busy graduation party season:
 
Problem is defined as:, some sites have Windows update turned off. 
 
Here is the link to the Windows Update catalog where you can search for Windows Updates, download them and run them locally - http://catalog.update.microsoft.com/v7/site/Home.aspx.


SharePoint 2010 versions and downloads by Todd Carter -  "Good Site"
 

Saturday, June 8, 2013

Creating a Hyper-V virtual server running Server 2012

Pre-Requisites: 
  • Obtain a copy of the operating system in ISO format,
  • Have admin access to the physical host

1. Open the Hyper-V manager (%windir%\system32\virtmgmt.msc)
2. Click new > Virtual Machine from the Actions menu
 

3. Click next if prompted by the "Before you Begin" Page
4. Give the virtual machine a name and pay attention to the default folder location where your virtual machines will be stored, make sure that it has enough space for snapshots.  click next
5. When it comes to resources and memory, always try to give the VM more than the minimum recommended by the operating system, in MB  (http://technet.microsoft.com/en-us/library/jj200132.aspx) in this picture I'm allocating less than the minimum due to my laboratory not having enough resources, though.
6. Check the box to "Use dynamic memory for this virtual machine".  NOTE:  it's not checked in the above picture. click next
7. Select a network connection, click next
8. Accept the default hard drive size of 127 GB or change it to the recommended 160 GB,  click next
9. Select "Install an operating system from a boot CD/DVD-ROM", select Image file (.iso):, navigate to the location where you stored your operating system ISO file, select the file, click next
10. Click Finish and proceed with the Operating system installation
11.  Power the machine on by right clicking on the machine and clicking on start
12.  Right click on the machine and click connect
13.  Accept the default language choices by clicking next
14.  click Install now and then enter the product key when prompted
15.  Choose Server with a GUI if you are installing SP 2013 after the OS is installed, the picture shown here has server core selected.  You do not want server core if you're going to install SharePoint 2013, from an ease of install point of view.
16.  Accept the agreement, and select custom install, then select the drive.  It should be reflective of the size you specified in step 8.
17.  Now sit back and wait for the install to complete, create an admin password, and then login with that password.
18.  During step 17, images similar to this one will appear and the screen will possibly go completely black, just let the process continue until you are presented with the settings screen

Sunday, June 2, 2013

Enumerate an Active Directory Group w/ Get-AdGroupMember

When the need to list out the members of an active directory group arises, say management asks, who are the members of this group, and you dont have a third party utility or don't want to pipe a few ds commands, you can use get-adgroupmember.

Here are the steps:

1. Make sure you computer has active directory users and computers installed.  One way to determine this is to run dsa.msc and see if ADUC opens.  If not install it from control panel > programs > Turn windows features on or off and add the RSAT utilities, if you dont see them, you might not be a meber of a domain

2. Open powershell as admin and verify that the Active Directory module is available for your session, by running get-module -listavailable

3. Import the module into your session by typing import-module activeDirectory

4. type Get-AdgroupMember nameOfGroup  or Get-ADgroupMember "Name Of Group with Quotes if the group name has spaces"  e.g.


to use Get-AdgroupMember for a group named WSSAdmins, you could type

Get-AdgroupMember wssAdmins

If the group was named wss admins, you'd need to surround that with "double quotes"

Get-AdgroupMember "Wss Admins"

after you've got this working, you should pipe it to get-member, like this

Get-adgroupmember | get-member

This will show you all the properties and methods that are available for this commandlet. 

You can then extract more or less information in your results by piping the cmdlet to Format-list,

For example, get-adgroupmember "EnterPrise Admins" | format-list name, Sid

Or, even cleaner, just a list of names get-adgroupmember "EnterPrise Admins" | format-table name



Recipe to create a Home Lab and run a SharePoint Farm (very high level overview)


Ingredients:

Virtual Server Host - This is what I currently use in my lab
Server Software - Subscribe to TechNet (Note: for lab use only, not for production)


High Level Overview

1. Either install Windows Server 2012 Datacenter on your host or run VMware ESX-something version

2. Once DataCenter is installed, install the Hyper-V Role

3. Create a couple VM's (I'll create a future post that lists these steps)

4. Install Windows Server 2012 Datacenter on these VM's if you're creating a SP 2013 lab, use Windows Server 2008 R2 if you're creating an earlier version of SharePoint Farm.

5. After you have two VM's that are running an OS, install the appropriate SQL version on one (2012 SQL if you want all the bells and whistles in SP 2013) and then install SharePoint on the other VM.

I'll write up the detailed steps in future posts.

 

Popular Posts