SharePoint 2010: Problem trying to install web part using power shell - deployment

I'm trying to deploy my first web part on 2010. I developed a web part using VS2008 and tested it on SP2007.
I copied the CAB to the 2010 server and tried to use the power shell to install it:
PS C:\Users\sa_portalt> Install-SPWebPartPack -LiteralPath "c:\transfer\webparts\redirectwebpart.cab" -Name "RedirectWebPart"
Install-SPWebPartPack : Parameter set cannot be resolved using the specified named parameters.
At line:1 char:22
+ Install-SPWebPartPack <<<< -LiteralPath "c:\transfer\webparts\redirectwebpart.cab" -Name "RedirectWebPart"
+ CategoryInfo : InvalidArgument: (:) [Install-SPWebPartPack], ParameterBindingException
+ FullyQualifiedErrorId : AmbiguousParameterSet,Microsoft.SharePoint.PowerShell.SPCmdletInstallWebPartPack
What am I doing wrong? Is this the right way to install web parts?

If you can, I recommend you upgrade to Visual Studio 2010 which has built-in support for SharePoint 2010. When you build a project built from the SharePoint template it will create the wsp for you. You can also immediately deploy to the local server from VS2010 so you never need to get into PowerShell on your local development machine.
When you need to deploy to a different server, you can then run
Add-SPSolution -LiteralPath C:\webparts\MyWebPart.wsp to add the solution to Central Administation
and then
Install-SPSolution -Identify MyWebPart.wsp -WebApplication http://mySharePointserver to deploy the solution to the specified web application

This was the first article I found that provided the actual answer, however, in the Install-SPSolution, there is a typeo, the -Indentify parameter should be -Identity
Also, in most cases (if adding to the GAC) need to add the -GACDeployment to the Install-SPSolution.
So the line should look like:
Install-SPSolution -Identity BasicWebPart.wsp -WebApplication http://vsp -GACDeployment

Related

How do I correctly install the PowerShell MSOnline module in Windows 8.1 Enterprise?

I'm trying to write some scripts for Azure Active Directory / Office online, and I'm completely unable to install the MSOnline powershell module. I've installed the Office Sign In Assistant version 7.2 (64-bit for my 64-bit machine). When I try to run the MSI installer for the PowerShell module, it says it can't find the sign in assistant. When I install the powershell module through PowerShellGet, and then run the commands, it fails with:
Connect-MsolService : The Microsoft Online Services Module is not configured properly. Please uninstall and then reinstall the module.
At line:1 char:1
+ Connect-MsolService
+ ~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (:) [Connect-MsolService], InvalidConfigurationException
+ FullyQualifiedErrorId : Microsoft.Online.Administration.Automation.InvalidConfigurationException,Microsoft.Online.Administration.Automation.ConnectMsolService
Connect-MsolService : Object reference not set to an instance of an object.
At line:1 char:1
+ Connect-MsolService
+ ~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (:) [Connect-MsolService], NullReferenceException
+ FullyQualifiedErrorId : System.NullReferenceException,Microsoft.Online.Administration.Automation.ConnectMsolService
Is there any way to get this installed ? I've even changed the language of my system to US-English and installed the correct language pack (because I've run into issues before with things not installing correctly if the system language is not US English)
Found at least a partial answer here that worked (at least got the module working again for one of my accounts, the other one still fails and remains a mystery):
MSOnline can't be imported on PowerShell (Connect-MsolService error)
In my case, some registry keys were missing (I don't know why) and reinstalling didn't help. I imported the registry keys with one path adaption from another system and now it works. I used the following registry keys (just copy to a file powershell.reg, change InstallPath if necessary, and import):
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSOnlinePowerShell]
"Version"="1.0.0"
"InstallPath"="c:\\Program Files\\WindowsPowerShell\\Modules\\MSOnline\\1.0\\"
"InstallLanguage"="en-us"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSOnlinePowerShell\Path]
"WebServiceUrl"="https://provisioningapi.microsoftonline.com/provisioningwebservice.svc"
"FederationProviderIdentifier"="microsoftonline.com"
Follow the steps to install the Azure AD Module here

Can't change neo4j database location

Neo4j version: Community Edition 2.3.2
Starting neo4j ce 2.3.2 by provided visual tool works correct while using a custom DB directory.
For example:
database location: C:\Neo4jDB
database tuning file: C:\Neo4jDB\neo4j.properties
server configuration file: C:\Users\leo\AppData\Roaming\Neo4j Community Edition\neo4j-server.properties
here I set: org.neo4j.server.database.location="C:/Neo4jDB"
Starting neo4j ce 2.3.2 by Windows PowerShell works correct ONLY if I use default configuration (data/graph.db), but if I change C:\Neo4j\conf\neo4j-server.properties file setting to
org.neo4j.server.database.location="C:/Neo4jDB"
(like while using provided visual tool) Windows PowerShell rises the following error:
Start-Service : Service 'Neo4JLEO (Neo4JLEO)' cannot be started due to the
following error: Cannot start service Neo4JLEO on computer '.'.
At C:\neo4j\bin\Neo4j-Management\Start-Neo4jServer.ps1:142 char:30
+ $result = Start-Service <<<< -Name $ServiceName -PassThru
+ CategoryInfo : OpenError: (System.ServiceProcess.ServiceController:ServiceController) [Start-Service], ServiceCommandException
+ FullyQualifiedErrorId : CouldNotStartService,Microsoft.PowerShell.Commands.StartServiceCommand
Windows uses back-slashes as path delimiters. Try replacing the forward-slash in your configuration with back-slash.
I.e. org.neo4j.server.database.location="C:\Neo4jDB"
Actually previous answer is partially correct. Windows uses "\", but the neo4j.conf file should have "c:\\Neo4jDB" (double slash) in it. That is what I am using, this way the service is able to start.
It has nothing to do with powershell limitations, the manually starting it from services.msg will present same error. It has more to do with service vs application (what you call visual tool).

Azure App Service Scaling powershell

I have app service in my environment named "Standard" . Currently the app service is configured in standard tier small 1 instance.
Using powershell I am trying to scale the app service which will in turn scale the web apps inside this app service.
I want to change size to Medium and instances to 2.
Here is my snippet.
Login-AzureRmAccount
Set-AzureRMAppServicePlan -Name Standard -ResourceGroupName
MyWebAppRG - NumberofWorkers 2 -WorkerSize Medium
When I run this command I am getting following error
Set-AzureRMAppServicePlan : Could not load file or assembly 'Microsoft.Rest.ClientRuntime.Azure.Authentication, Version=0.11.0.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
At line:11 char:1
+ Set-AzureRMAppServicePlan -Name Standard -ResourceGroupName MyWebAppRG -Numbero ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Set-AzureRMAppServicePlan], FileNotFoundException
+ FullyQualifiedErrorId : System.IO.FileNotFoundException,Microsoft.Azure.Commands.WebApps.Cmdlets.AppServicePlans.SetAzureAppSe
rvicePlanCmdlet
I am not sure, what's wrong here? and what exactly this error means.
For the information, I am able to run other powershell commands just fine,example set-AzureRMResource and others. so isn't an environment issue.
Any help appreciated..
Thanks
What version of the Azure Powershell are you using? This was a known issue in Azure Powershell 1.0.0. If you are using that version, use the version below instead. Do post back if you still see issues.
https://github.com/Azure/azure-powershell/releases/tag/v1.0.1-November2015

Set-SPBusinessDataCatalogThrottleConfig : Cannot bind parameter 'Identity'

If you are working with a larger external list (more than 2000 items) in dev environment it works perfectly, but when you work in production environment, it throws error
"Unable to display this Web Part. To troubleshoot the problem, open this Web page in a Microsoft SharePoint Foundation-compatible HTML editor such as Microsoft SharePoint Designer. If the problem persists, contact your Web server administrator. Correlation ID: ...........".
So start to working to fix the BCS limit through powershell.
When I enter below command in powershell I get error in cmd. Any idea?
PS C:\Program Files\Nintex\Nintex Workflow 2010> Set-SPBusinessDataCatalogThrott
leConfig -Identity Get-SPBusinessDataCatalogThrottleConfig -Scope ThrottleType I
tems Database-GUID-ServiceApplicationProxy 5222b2db-fdd1-43f5-accb-7f039155f654-
8000-default maximum 6000
Set-SPBusinessDataCatalogThrottleConfig : Cannot bind parameter 'Identity'. Can
not convert the "Get-SPBusinessDataCatalogThrottleConfig" value of type "System
.String" to type "Microsoft.SharePoint.BusinessData.SharedService.ThrottleConfi
g".
At line:1 char:50
+ Set-SPBusinessDataCatalogThrottleConfig -Identity <<<< Get-SPBusinessDataCat
alogThrottleConfig -Scope ThrottleType Items Database-GUID-ServiceApplicationPr
oxy 5222b2db-fdd1-43f5-accb-7f039155f654-8000-default maximum 6000
+ CategoryInfo : InvalidArgument: (:) [Set-SPBusinessDataCatalogT
hrottleConfig], ParameterBindingException
+ FullyQualifiedErrorId : CannotConvertArgumentNoMessage,Microsoft.SharePo
int.BusinessData.SharedService.SPSetSPBusinessDataCatalogThrottleConfig
At first glance there seems to be some issues in your PowerShell syntax. You specify another cmdlet as value for the -Identity parameter, and that won't work. Sharepoint is not really my expertise, but this article by lionelro on the msdn blogs looks like a good place to start. Especially since the start of the article describes your issue online appearing on the production environment. Hope it helps.

Export SPWeb SharePoint 2010 weird dll error

Ik get a weird error when running the following command:
PS C:\> Export-SPWeb -Identity http://dfz-85:81/ -Path "C:\temp.cmp"
This is the error i get, the .dll file keeps changing every time i try the command.
Export-SPWeb : Could not find file 'C:\Users\cmsadmin\AppData\Local\Temp\mlilsk
gt.dll'.
At line:1 char:13
+ Export-SPWeb <<<< -Identity http://dfz-vm85:81/ -Path "C:\tmep.cmp"
+ CategoryInfo : InvalidData: (Microsoft.Share...CmdletExportWeb:
SPCmdletExportWeb) [Export-SPWeb], FileNotFoundException
+ FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletExportWeb
Any help is appreciated.
I faced the same error. Could not find the reason but could successfully export from central admin > backup restore option.
Came across this issue and eventually resolved it. Not sure what the actual solution was but the steps I took were:
Add logged in user as SP Shell Admin on the content database you're exporting/importing from/to
Close the SharePoint 2010 Management Shell window
Reopen the SharePoint 2010 Management Shell window with the Import system modules option (right click on the icon in Windows 7)
I ended up avoiding the issue and exporting/importing with SharePoint designer.
This can only be done under "All Files" and on each individual file, afaik.