Admin Archive

Today I needed to find what templates were being used by each sharepoint site. The problem was related to exporting and importing sites between servers where we had some old sites that were using old templates (Fab 40 templates) that I didn’t want to install on the new server.

So I found the site using this command:

[code]stsadm -o enumallwebs [/code]

which told me which site was using the PROJSING template. I then was able to delete this site, export and import to the new server.

 

 

Be the first to comment

Running Powershell Scripts

Posted May 31, 2012 By Kevin Bennett

Simple but I almost always have to go back and “remember” after a month or two of not working with Powershell.

To run a Powershell script don’t forget to put .\ in front of your script name if you are running it from the directory it is located at. For example:

[code] .\CopyContent.ps1[/code]

 

Be the first to comment

ULViewer – You are my bitch

Posted May 31, 2012 By Kevin Bennett

Let me just say, if you are not using ULViewer or don’t have it in your toolkit .. you should.

What it does: You know that cryptic error message you get in sharepoint .. come on, you know ..the Correlation ID: alksdlkjf-234l3245-0sllksdf-234234. Yeah that awesome error that tells you exactly what is wrong (not)! Well the ULViewer will shed some light on what is happening on your site when that error is generated.

So jump over to your Web Front End server and fire up ULViewer. Select File, Open, ULS Logs. Now Bring up the browser and reproduce that error. Jump back to ULViewer and press pause. Scroll up and look for the event code. You see it … now read the details.

I have found that 4 out of 5 times (that’s the tv version of math, not the scientific) that it will actually tell you what is wrong, either a missing file, missing feature .. etc.

Now use it .. and use it often.

Be the first to comment

Powershell to List Databases used in Sharepoint 2010

Posted May 22, 2012 By Kevin Bennett

Here is a simple PowerShell Command to list all databases used in SharePoint

 

[code]Get-SPDatabase | Sort-Object disksizerequired -desc | Format-Table Name | out-file c:\databases.txt[/code]

 
 
Be the first to comment

What an ordeal. After numerous errors and features that were not installed on the new server I finally get to a point where I believe I can import a site (our intranet) to the development server I have set up.

But , you noticed i said believe .. Another error. This one stating “Error: Cannot import site. The exported site is based on the template SPS#0 but the destination site is based on the template STS#1. You can import sites only into sites that are based on same template as the exported site.”

Well Crap, I vaguely remember running into this in the past and couldn’t for the life of me remember how I fixed it (I had slept since then).

I knew that I didn’t pick the right Site Template (in this case I picked Blank Site) and a quick search confirmed that STS#1 was a Team Site, and SPS#0 was a Sharepoint Server Portal Site but I couldn’t find “Sharepoint Server Portal Site” in my list of Templates to install. Well that is because the Template is obsolete… Great … thank you MS. But don’t fret, although it is obsolete you can still install it, just not with the GUI.

To create a site with Template SPS#0 Do this…

Create a Powershell Script with the following code and run it:

[Code]

Get-SPWebTemplate
$template = Get-SPWebTemplate “SPS#0”
New-SPSite -Url “YourSiteUrl” -OwnerAlias “Domain\UserNameAccount” -Template $template

[\Code]

There you go.

 

Be the first to comment
%d bloggers like this: