Hot to run "Deploy WSP" file through sharepoint Powershell from C# win Application
HI All,
I have create one web part (wsp) and also i have created one window application for deploy wsp file through powershell commands but i am stuck in executing the commands from powershell from c# win app .please let me know any have idea about
this ?
Software developer
Hi,
The following code snippet for your reference:
public string RunPowershell(string powershellText, SPWeb web, string param1, string param2)
// Powershell ~= RunspaceFactory - i.e. Create a powershell context
var runspace = RunspaceFactory.CreateRunspace();
var resultString = new StringBuilder();
try
// load the SharePoint snapin - Note: you cannot do this in the script itself (i.e. add-pssnapin etc does not work)
PSSnapInException snapInError;
runspace.RunspaceConfiguration.AddPSSnapIn("Microsoft.SharePoint.PowerShell", out snapInError);
runspace.Open();
// set a web variable.
runspace.SessionStateProxy.SetVariable("webContext", web);
// and some user defined parameters
runspace.SessionStateProxy.SetVariable("param1", param1);
runspace.SessionStateProxy.SetVariable("param2", param2);
var pipeline = runspace.CreatePipeline();
pipeline.Commands.AddScript(powershellText);
//add a "return" variable
pipeline.Commands.Add("Out-String");
var results = pipeline.Invoke();
//convert the script result into a single string
foreach (PSObject obj in results)
resultString.AppendLine(obj.ToString());
finally
// close the runspace
runspace.Close();
// consider logging the result. Or something.
return resultString.ToString();
More information:
Running Powershell from within SharePoint
http://geekswithblogs.net/Norgean/archive/2012/09/19/running-powershell-from-within-sharepoint.aspx
Best Regards
Dennis Guo
TechNet Community Support
Similar Messages
-
Is there any way to deploy the Sandbox solution .wsp file to sharepoint 2013 online publishing site using powershell or CSOM or any other way?
Hi,
According to your post, my understanding is that you wanted to deploy sandboxed solution .wsp file to sharepoint 2013 online.
"Add-SPSolution" command is not available in SharePoint Online management shell. So, we cannot use PowerShell to update and deploy a solution in SharePoint Online environment. Meanwhile, here is index of Windows PowerShell for SharePoint Online
cmdlets for your reference:
http://technet.microsoft.com/en-us/library/fp161364.aspx
You can CSOM to deploy solution using helper class from CodePlex. The activation code is as follows: SandboxSolutions.ActivateSolution(siteCollectionURl, cookies, "solution_name.wsp");
About the Client Side Object Model (CSOM), it is a development related issue, we have a specific support channel for the SharePoint developers, so I recommend you go to our MSDN forum for further assistance.
Here is a similar thread for you to take a look at:
http://community.office365.com/en-us/forums/156/t/197404.aspx
In addition, if you would like to upload and activate sandbox solution manually, you can refer to:
http://community.office365.com/en-us/forums/154/p/64010/244496.aspx#244496
Best Regards,
Linda Li
Linda Li
TechNet Community Support -
Error while deploying EAR file through SDM
Hi All,
I am deploying EAR file through SDM. Its taking too much time to deploy in the 3rd stage (its just a simple hello file for testing purpose and its still in that stage for 2 hours).
When I see the log, I can see some fata error. Please suggest me what should I do.
==
Oct 15, 2008 4:31:44 PM Info: SDM started successfully.
Oct 15, 2008 4:33:21 PM Info: Opened client connection to sapretail (IP address
sapretail/172.20.177.203, remote port 58645)
Oct 15, 2008 4:33:23 PM Info: Request for Logon as admin accepted
Oct 15, 2008 4:39:07 PM Info: Loading archive '/usr/sap/trans/EPS/sap.comwdtu
torial~ex1.ear'
Oct 15, 2008 4:40:50 PM Info: Actions per selected component:
Oct 15, 2008 4:40:50 PM Info: Initial deployment: Selected development componen
t 'wd/tutorial/ex1'/'sap.com'/'LOKAL'/'0.2008.10.14.12.51.57' will be deployed.
Oct 15, 2008 4:44:41 PM Info: Saved current Engine state.
Oct 15, 2008 4:44:48 PM Fatal: State BeforeNextDeployment can't process event I
nitiateDeployment
The reason I am doing through SDM because while deploying through NWDS its throwing an error
Oct 13, 2008 12:44:41 PM /userOut/deploy (com.sap.ide.eclipse.sdm.threading.DeployThreadManager) [Thread[Deploy Thread,5,main]] ERROR:
[001]Deployment aborted
Settings
SDM host : sapretail
SDM port : 50118
URL to deploy : file:/C:/DOCUME1/231477/LOCALS1/Temp/temp41002sap.comwdtutorial~ex1.ear
Deployment exception : Server sapretail did not accept login request as admin on port 50118. Details: ERROR: Could not establish connection to server sapretail at port 50118: sapretail
Inner exception was :
Server sapretail did not accept login request as admin on port 50118. Details: ERROR: Could not establish connection to server sapretail at port 50118: sapretail
Please suggest a solution.
Regards,
JitenderNow, when I deploy through NWDS, I get the following error.
Result
=> deployment aborted : file:/C:/DOCUME1/231477/LOCALS1/Temp/temp51346sap.comwdtutorial~ex1.ear
Aborted: development component 'wd/tutorial/ex1'/'sap.com'/'LOKAL'/'0.2008.10.15.21.04.16':Caught exception while checking the login credentials for SAP J2EE Engine. Check whether the SAP J2EE Engine is up and running.com.sap.engine.deploy.manager.DeployManagerException: ERROR: Cannot connect to Host: [sapretail] with user name: [J2EE_ADMIN] Check your login information. Exception is: com.sap.engine.services.jndi.persistent.exceptions.NamingException: Exception while trying to get InitialContext. [Root exception is com.sap.engine.services.security.exceptions.BaseLoginException: Cannot authenticate the user.] (message ID: com.sap.sdm.serverext.servertype.inqmy.extern.EngineApplOnlineDeployerImpl.checkLoginCredentials.DMEXC)
Deployment exception : The deployment of at least one item aborted -
I have few PDf files on my computer and I want to add them to my ipod touch, please tell me the procedure on how should I do that? Secondly I want to run these Pdf files through the ibook app, as it also have the Pdf file sections
You should be able to just place them in your Books library in iTunes and check to ensure that your Book library is configured to sync to your iPod when you sync your iPod to iTunes.
-
How do i run a Labview file through a windows phone?
Hello there
How do i run a Labview file through a windows phone or a tablet? is it possible
is there any phone specifications required? or steps?
Thanks alotBlokk wrote:
na1992 wrote:
hahaha my baad
i mean if i have done my labview file on laptop and i want it to connect my file to a microcontroler using usb or any serial connection, i want a way that my labview file will run if i store it on a phone.
i searhced about exe format but i didnt find enough info
Sorry, but you should define more precisely what is your goal:
" i searhced about exe format but i didnt find enough info"
If you build an exe using Labview, that exe will not run on iOS, or Android, if this is what you ask...
Nor Windows Phone or Windows RT. A LabVIEW exe is compiled and linked for x86 or AMD64 architecture with Win32 API architecture and will only run on Windows for x86 or x64 systems.
Windows Phone and Windows RT are despite the similarity in the name technically completely different platforms to the normal Desktop Windows system, just as different as MacOS X or iOS.
Rolf Kalbermatter
CIT Engineering Netherlands
a division of Test & Measurement Solutions -
How to deploy .msp files through SCCM 2012
Team,
Can you please help me to deploy .msp files through SCCM 2012?
Regards,
Mahadev NittureI tried to search and got few things but didn't understand to proceed with.
Please help me with this.
Regards,
Mahadev Nitture
You can use a typical/standard application deployment method (just a minor change because of MSPfile).
Here are some guides, for typical application deployment:
http://technet.microsoft.com/en-us/library/gg682159.aspx
http://www.gerryhampsoncm.blogspot.ie/2013/03/sccm-2012-sp1-step-by-step-guide-part_7075.html
Familiarise yourself with these methods, then return to the example suggested by Torsten for specific steps for MSP:
https://social.technet.microsoft.com/Forums/en-US/3dac27fd-ce4f-4d3d-946b-d08d4c7f5af5/best-way-to-deploy-an-msp?forum=configmanagerapps
Don
(Please take a moment to "Vote as Helpful" and/or "Mark as Answer", where applicable.
This helps the community, keeps the forums tidy, and recognises useful contributions. Thanks!) -
Deploy EAR file through command line
Hello Gurus,
We have external consultants helping us with Java development of a certain application on our CRM system. Usually I would deploy this file through SDM (RemoteGUI). Is there a way to do this on a command line?
Thanks much.
Arvind.Hello Community,
the sdm utility allow this, but it can be executed only if SDM server is stopped and it is in standalone mode... a bit too complicated, but it works
StopServer.sh
sdm.sh jstartup mode="standalone"
sdm.sh deploy file=<full path to file to be deployed>
sdm.sh jstartup mode="integrated"
StartServer.sh
You can find the sdm utility in <sdm_home>/program and the documentation in <sdm_home>/program/doc
Regards,
Valerio -
Error while deploying .par file through system admin
I have tried to modify logon.par file but when I was try deploy that file again through system admin then I got this error...................
Portal Runtime Error
An exception occurred while processing a request for :
iView : N/A
Component Name : N/A
com.sapportals.portal.ume.component.logon.SAPMLogonComponent.
Exception id: 10:19_11/05/07_0006_13454550
See the details for the exception ID in the log file
Please help me out I am using sneak preview 7.0
Detailed Error Log & Trace
=========================================================
Exception ID:08:55_11/05/07_0002_13454550
[EXCEPTION]
com.sapportals.portal.prt.component.PortalComponentException: Error in init method
Component : com.sap.portal.support.browse.default
at com.sapportals.portal.prt.component.PortalComponentContext.init(PortalComponentContext.java:251)
at com.sapportals.portal.prt.core.broker.PortalComponentContextItem.refresh(PortalComponentContextItem.java:267)
at com.sapportals.portal.prt.core.broker.PortalComponentContextItem.getContext(PortalComponentContextItem.java:312)
at com.sapportals.portal.prt.component.PortalComponentRequest.getComponentContext(PortalComponentRequest.java:385)
at com.sapportals.portal.prt.connection.PortalRequest.getRootContext(PortalRequest.java:435)
at com.sapportals.portal.prt.core.PortalRequestManager.runRequestCycle(PortalRequestManager.java:607)
at com.sapportals.portal.prt.connection.ServletConnection.handleRequest(ServletConnection.java:240)
at com.sapportals.portal.prt.dispatcher.Dispatcher$doService.run(Dispatcher.java:522)
at java.security.AccessController.doPrivileged(Native Method)
at com.sapportals.portal.prt.dispatcher.Dispatcher.service(Dispatcher.java:405)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.sap.engine.services.servlets_jsp.server.servlet.InvokerServlet.service(InvokerServlet.java:156)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:390)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:264)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:347)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:325)
at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:887)
at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:241)
at com.sap.engine.services.httpserver.server.Client.handle(Client.java:92)
at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:148)
at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
at java.security.AccessController.doPrivileged(Native Method)
at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
Caused by: com.sapportals.portal.prt.core.broker.PortalComponentInstantiationException: Could not instantiate implementation class com.sapportals.portal.ume.component.logon.SAPMLogonComponent of Portal Component com.sap.portal.support.browse.default because: Could not find implementation class
at com.sapportals.portal.prt.core.broker.PortalComponentItemFacade.getInstanceInternal(PortalComponentItemFacade.java:242)
at com.sapportals.portal.prt.core.broker.PortalComponentItemFacade.getComponentInstance(PortalComponentItemFacade.java:160)
at com.sapportals.portal.prt.core.broker.PortalComponentItem.getComponentInstance(PortalComponentItem.java:732)
at com.sapportals.portal.prt.component.PortalComponentContext.getComponent(PortalComponentContext.java:103)
at com.sapportals.portal.prt.component.PortalComponentContext.init(PortalComponentContext.java:242)
... 26 more
Caused by: java.lang.ClassNotFoundException: com.sapportals.portal.ume.component.logon.SAPMLogonComponent
Found in negative cache
Loader Info -
ClassLoader name: [com.sapportals.portal.prt.util.ApplicationClassLoader@3389d1]
Parent loader name: [com.sapportals.portal.prt.util.ApplicationClassLoader@1b7a6fa]
References:
not registered!
No resources !
at com.sap.engine.frame.core.load.ReferencedLoader.loadClass(ReferencedLoader.java:360)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:219)
at com.sapportals.portal.prt.core.broker.PortalComponentItemFacade.getInstanceInternal(PortalComponentItemFacade.java:228)
... 30 moreHi,
Open ur PAR file then double click on PORTAL-INF -> lib->Select 2 jar files
1.com.sap.portal.runtime.logon_api.jar
2.umelogonbase.jar
Copy those jar file & paste in to lib in ur application.
Regards,
Senthil kumar K. -
Getting error while deploying (.WSP) file
HI ,
I developed timer through VS 2010.When i try to
deploy that WSP file in production server through Stsadm/Powershell commands ,I am getting below
error.
The solution cannot be deployed. Directory "NewsofTheweekMemoTimerJob_Feature1"
associated with feature '675521dc-7b7c-4825-a49c-611d0dce007f' in the solution
is used by feature 'bdc09bc2-f629-41dc-8749-e9fe8f02c613' installed in the farm.
All features must have unique directories to avoid overwriting files.
I saw in Central administration,under system settings i did not find any solution.
Thanks in advance.
help me.
Thanks:It seems that you already have installed a feature with the same name in the farm. Look in the 14-hive (C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14) under TEMPLATE\FEATURES. There you have a folder with the mentioned name. As
long as this folder exists, you can't deploy a feature with the name of the folder.
A simple solution for your problem would be to give the feature another name. So you avoid the naming collision. -
Running an executable file through servlet
Hello People,
I tried searching about this on the Forums, but could not find the right solution.
Please donot get annoyed if you find this to be a repeted topic, which I am sure is not.
I want to run a .sh file in Unix environment through servlet.
Actually i want to do this inorder to schedule a report servet to run a report and generate the output in a particular format on a click of a button.
I tried using Runtime.getRuntime().exec method, (which I know through forum is unreliable)
Can anyone suggest me a method through I can achieve this?
Any suggestion is appreciated.
Regards,
Rohan KamatHi MOD,
Thanks for the quick reply.
Heres what I am doing to schedule.
1) The client selects the necessary parameters from the front end and then saves it in a table.
2) This he will be doing for as many reports as he wants, on an average there will be 200 reports daily.
3) Once he has selected all the parameters for all the reports, he will go to the next screen and fire a script to run the reports at a time.
4) This script will be fired only once. And once it is fired it will generate a PDF files of the reports.
5) On the front end the screen will be refreshed showing the users the status of the reports that he has scheduled to be run
I am using Servlets 2.0 version, and jdk.12
Regards,
Rohan Kamat -
Hot to call forms11g fmx file through Java executable
Hi,
Iam having one file in some folder which will come through FTP , whenever file comes to the folder i should call the some form fmx file through JAVA so that my form will take care rest of the things .
My question is how to call fmx through Java executable in windows environment.
thanks in advance
GVHi All,
Thnaks for the Info. But my requirement is different.
1) whenever i received a file through FTP from other server to my server , some folder say d:\Test
a) some batch program has to trigger and first it should take the backup of the received file to some other folder say d:\archive
b) some batch program has to trigger to call the forms fmx file so that form will take care of reading from the file and put the data to database for the received file in d:\Test.
Assume that it is in windows environment/Linux Environment . How i can achieve these tasks. There should not any user intervention in this , everything is automatic.
Please guide me any solutions
Thanks in advance
GV -
Hi,
I was working with SharePoint 2010 in one of my Virtual machines.Now that the lease for my Virtual Machine is going to expire, I want to shift the entire contents of the project to another machine (local) with SharePoint 2010. Also, I want the pages
in the other machine to be editable.
How can I copy the solution files to the other machine? And I want the exact path where the files are located, so that I can shift them to the other machine.
Thanks in advance....that's not a good approach.
Deploying customisations can be as simple as files being copied onto the file system. Most of the time however there is a lot more happening behind the scenes and simply copying the files won't work.
Also that is assuming that you mean solutions rather than the pages themselves (or the contents of document libraries) in which case you want to copy databases, not just files.
SharePoint isn't a simple thing to move, you may need to look at this a bit harder. -
Playing Video smoothly (youtube or mp4 file) through RemoteApp or RDP into Win 7 from 2012
We're setting up a 2012 R2 RDS, and sending the RemoteApps into Windows 7, both Enterprise and ThinPC. Video playing is a problem - both youtube, and playing video files.
WMP will play fine in a full RDP session, but it becomes very glitchy when piped through a Remote App into Win 7 Thin PC or Enterprise. Youtube or Vimeo are very glitchy both in full RDP session and in IE Remote App.
What options have I got to get this working?
Both the Win 7 Thin PC and the Win 7 Ent clients are running the latest version of the RDP client (6.3.9600), supporting protocol 8.1.
The 2012 R2 hosts are fully up to date. In IE, the Adobe reports the Flash version as 12.0.0.77, same in Chrome. No surprise there, just one thing I was checking in the context of youtube being so glitchy and jumpy.
This termsvc team
blog post talks about seamless multimedia experience on Win 8 & 2012 - but I don't think that it applies in our case since we are using Win 7 clients.
I'm new to terminal services, but from reading up about RemoteFX, it seems like there was a period during which RemoteFX had to be enabled by Group Policy, but that seems to no longer apply to my situation (where the clients support RDP protocol 8.1). Is
that correct, or are there some policies I should be enabling on my 2012 R2 hosts to enable the best multimedia experience for clients using RDP protocol 8.1 in Win 7?While reading up about the latest RDP update - which is installed on the Win 7 Thin PC clients - it seems like they should support RemoteFX from a 2012 RDS host, if I'm understanding it correctly.
http://support.microsoft.com/kb/2592687/en-us#New-Features
New features in RDP 8.0 for Windows 7 SP1
This update introduces the following features for remote computers that are running Windows 7 SP1:
RemoteFX for WAN
This feature offers advanced techniques such as intelligent and adaptive UDP transports, network loss tolerance, and recovery to provide a fast and fluid experience to users on a WAN. For more information, see RemoteFX
for WAN: Overview of Intelligent and Adaptive Transports in Windows 8 and Windows Server 2012.
RemoteFX Network Auto Detect
This feature automatically detects network characteristics and optimizes the user experience. For more information, seeRemoteFX
for WAN: Overview of Intelligent and Adaptive Transports in Windows 8 and Windows Server 2012.
RemoteFX Adaptive Graphics
This feature delivers a rich graphics experience that dynamically adapts to the server load, the client access device load, and network characteristics. For more information, see General
information about RemoteFX Adaptive Graphics in Windows Server 2012 and Windows 8.
RemoteFX Media Streaming
This feature lets users enjoy a smooth media experience on WAN networks for all media content formats. For more information, see General
information about enabling a Seamless Multimedia Experience with RemoteFX Media Streaming in Windows Server 2012 and Windows 8
We're not seeing that - the media playing is glitchy. Would there be anyone around from the termserv team to advise me on what we can do? -
Opening files through mini bridge, from within photoshop.
When opening files/images from within photoshop use adobe mini bridge, the files open slowly with a long delay?
Can't figure out why, but when files are open directly from photoshop it is lightning fast.
Running on a iMac OS X Yosemite
Version 10.10.2Okay.. Yeah, that's why I'm running Windows 7 still
This may have to do with some of the bugs Apple introduced into Yosemite. They are working on a fix. Can't really think of much else, other than make sure everything is up to date. Maybe someone with more knowledge of Mini Bridge will find this post.
Benjamin -
Writing into a file in clients' machine from a jsp application
is it possible to write some data fetched from database into a .CSV file on the clients machine from an JSP application?
signed applets is one possibility , any other possibilities are there?
thanks
Mohammed Rafeeq([email protected])* @(#)ExcelServlet.java
import javax.servlet.http.*;
import javax.servlet.*;
import java.io.*;
import java.util.*;
import java.sql.*;
* @author M.Rajendra
public class ExcelServlet extends HttpServlet {
public void init(ServletConfig config)throws ServletException{
super.init(config);
} // end of init method
public void doGet(HttpServletRequest req, HttpServletResponse res)
throws ServletException,IOException {
doPost(req,res);
} // end of doGet method
public void doPost(HttpServletRequest req,HttpServletResponse res)
throws ServletException,IOException {
HttpSession session = req.getSession(true); // session is already created at loginscreen
OutputStream oout = res.getOutputStream();
res.setHeader("Content-disposition","filename=excel.csv");
//res.setContentType("application/octet-stream");
FileInputStream fis = new FileInputStream("D:\\JRun3.1\\servers\\default\\default-app\\WEB-INF\\classes\\test.csv");
//here i am reading a csv file, we can output whatever format and set filename of ours
byte[] buf = new byte[1024]; //get from statics
int bytesRead = 0;
while((bytesRead = fis.read(buf)) != -1){
oout.write(buf,0,bytesRead);
oout.close();
fis.close();
}//end of doPost method
public void destroy() {
}// end of destroy
} //end of ExcelServlet class
Maybe you are looking for
-
New to SAP Netweaver...Please guide....
Hi all I have recently joined this network. So, not sure wether this is right place to post such a question. I am a fresher in IT field. My level of knowledge is limited to core java and JSP, servlets. Now I am a member of project team which is worki
-
Hi, how do I get a service upgrade to solve my BT problems on my N80,
-
Safari 5 crashes when opening new tab
Just installed the new update bundle and I am running Snow Leopard. No problems prior to the update, but when I click on the + to open a new tab, Safari just shuts down. Any help would be appreciated. Thanks.
-
Problem with applet file loading
I have a problem with loading files into a java applet. import java.applet.*; import java.awt.*; import java.io.*; import java.util.*; import java.net.*; public class main extends Applet { private static ArrayList<String> SGM; public void i
-
Hi All, I am facing one issue while creating a mv. The source for this mv contains more then 1.75 billions records. This source table contain a column TEXT VARCHAR2(2000). If I tried to create without that column mv gets created but with column it is