Solved

Sharepoint 2010 creating sites using powershell code - cmdlet not recognized

Posted on 2011-09-05
2
701 Views
Last Modified: 2013-06-07
I am trying to set Sharepoint 2010 up on a test server. when I run powershell to create the application the code I am using comes back with 'The term 'New-SPSStateserviceDatabase' is not recognized as the name of the cmdlet.........

I am using http://www.harbar.net/articles/sp2010mt5.aspx

I am trying to set up a SP as a hosted environemt and have Win 2008 R2 with SQL Express installed and Sharepoint install without running the wizard. the code creates the Farm but will not go any further.

I fail when I try to run the code  - see attached. Error returned after running code
Write-Host "Creating $stateName Application and Proxy..."
$stateDB = New-SPStateServiceDatabase -Name $stateDBName
$state = New-SPStateServiceApplication -Name $stateName -Database $stateDB
New-SPServiceApplicationProxy -Name "$stateName Proxy" -ServiceApplication $state -DefaultProxyGroup

Open in new window

0
Comment
Question by:pflook
  • 2
2 Comments
 
LVL 8

Expert Comment

by:vaderj
ID: 37064753
It sounds like you need to register the sharepoint module with powershell:

http://www.sharepointedutech.com/2010/02/13/the-first-steps-to-sharepoint-2010-powershell-heaven/

Get-Command  –PSSnapin “Microsoft.SharePoint.PowerShell”
0
 
LVL 8

Accepted Solution

by:
vaderj earned 500 total points
ID: 37064765
hmm, here it says another command:
http://technet.microsoft.com/en-us/library/ee806878.aspx#section2

Add-PSSnapin Microsoft.SharePoint.PowerShell

I just did this the other day in my own SPF'10 instance, but cant remember the exact one
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A question that is asked often, is how to generate sequential numbers in InfoPath Forms. The best way to achieve this is to use a SQL database, along with a stored procedure and a web service to connect Forms Services to the DB. The first thing t…
For SharePoint sites, particularly public-facing ones, there are times when adding JavaScript, Meta Tags, CSS Styles or other content to the page <head> section is more practical than modifying master pages.  For instance, you could add the jQuery l…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question