Solved

Sharepoint 2010 creating sites using powershell code - cmdlet not recognized

Posted on 2011-09-05
2
681 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

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…
The vision: A MegaMenu for a SharePoint portal home page The mission: Make it easy to maintain. Allow rich content and sub headers as well as standard links. Factor in frequent changes without involving developers or a lengthy Dev/Test/Prod rel…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

757 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now