Restart Sharepoint Management Shell - sharepoint

I would like to know if it is possible to restart Sharepoint Management Shell, so that i can reload a new App Domain ?

it is ok, i found it, just using : Powershell.exe -File script.ps1

Related

How to add a application pool in iis by command line?

I want to create a application pool in IIS by using command line. I don't know the command line to create it. Please help me if you did.Thanks so much!
Even easier if you use New-WebAppPool from the Web Server (IIS) Administration Cmdlets.

Get-SPSite in Powershell Script

I am writing a script to deploy my solution which has some "Site" scoped features. In my script I am trying to get hold of Site Collection first like
$SiteCollection=Get-SPSite http://<server>/mysite
When I check SiteCollection -ne $null it always returns null but the same cmdlet works fine at command prompt.
Do not know whats wrong with my script.
This could be a permissions issue. When run from the command prompt, you have permission to get the Sharepoint site. Investigate how you're running your script when it doesn't work. Make sure the user has permission.

How to freeze a service for sometime in nsis?

My requirement is to freeze a servise group for around a minute(60 secs). How can I do that in nsis?
I guess it would be something like this:
hagrp -value Service Frozen...
You can execute applications with Exec/ExecWait:
Exec '"$instdir\myapp.exe" /param1 "par am2" /param3'
If you want to execute a console application without showing the console window then you have to use one of he exec plugins: nsExec, ExecDos
or ExecCmd.
Edit:
There are several plugins and scripts to choose from if you want to manipulate a Windows service...

run sharepoint powershell from c# on another PC?

If the C# application is on the same server as sharepoint, I know we can use RunSpace to run the pwoershell script, but what if the C# app. and sharepoint server are on different PCs?
Is this possible?
thanks
yes, its possible, though messy. In Powershell 2.0+, there's a feature called remote powershell, so you can effectively, via c# code, send Powershell commands to your local powershell instance, and use that to log into the remote instance.
A slightly less insane idea would be to simply create a web service on the remote machine, and have that run the remote powershell commands, from the web service.
And even less crazy idea is just to write a web service, and have that run code on the remote server. : )
Good luck!
If you are administrator on the remote box, you can try combining PsExec and PowerShell.

Web frontend to my Powershell scripts for helpdesk

I'd like to have a web frontend to my powershell scripts for helpdesk.
These scripts would typically be user-creation scripts and scripts to restart a specific service on a specific server.
Where should I start? What would I need?
There is no problem for me to set up a IIS for this purpose if needed. We also have Sharepoint on a dedicated server.
Hoping for some startup-tips:)
You can consider Powershell Web Access feature on Powershell V3.0
http://technet.microsoft.com/en-us/library/hh831611.aspx
This is a robust solution, factoring in IIS, security and shell access.
You can use PowerShell Remoting. You can open a PS session that would look like a local PS console to you but it would be running on the remote machine. You can type PS code to be executed remotely and launch a buch of ready-to-run ps1 scripts for SP administration there too. Have a look at those links, for example:
http://www.computerperformance.co.uk/powershell/powershell_remote.htm,
http://blogs.technet.com/b/heyscriptingguy/archive/2011/11/17/learn-how-to-manage-remote-powershell-sessions.aspx
--- Ferda

Resources