http error 503 the service is unavailable

I got this error while opening Sharepoint 2010 Central admin in IE with IIS 7.

I tried restarting the application pool , but no luck.

In the event viewer, I found the following log entry.

Application pool SharePoint Central Administration v4 has been disabled. Windows Process Activation Service (WAS) encountered a failure when it started a worker process to serve the application pool.

Solution

If you have changed your windows password recently

and you didn't updated you managed account, then you are likely to get this error.

To fix this, go to identity of the application pool, and change it giving the latest password.
and restart the app pool.You are done!!!

Loading Sharepoint PowerShell Snapin

Environments like SharePoint Foundation add their own custom cmdlet library by installing a PowerShell Snap-in. When you install SharePoint Foundation, it installs its core PowerShell snap-in named Microsoft.SharePoint.PowerShell. However, you have to ensure that Microsoft.SharePoint.PowerShell is loaded before you begin to call its cmdlets.

Microsoft Foundation provides a specialized version of the PowerShell console known as the SharePoint 2010 Management Shell. You can launch the SharePoint 2010 Management Shell from a shortcut that SharePoint Foundation adds to the Windows Start menu> All Programs > Microsoft SharePoint 2010 Products > SharePoint 2010 Management Shell


The main difference between the standard PowerShell console window and the SharePoint 2010 Management Shell console has to do with what PowerShell providers get loaded automatically. More specifically, the SharePoint 2010 Management Shell automatically loads the SharePoint provider named Microsoft.SharePoint.PowerShell while the standard PowerShell console does not. In general, you cannot always rely on Microsoft.SharePoint.PowerShell being loaded automatically so you need to learn how to explicitly load it within a PowerShell script.

Let's say you have just launched the standard PowerShell console window and you attempt to execute one of the cmdlets built into SharePoint Foundation such as the cmdlets named Get-SPWebApplication. The call to this cmdlet will fail unless you have already loaded the SharePoint PowerShell snap-in named Microsoft.SharePoint.PowerShell. Before calling the Get-
SPWebApplication cmdlets, you need to load the SharePoint Foundation PowerShell snap-in using the Add-PSSnapin cmdlet .

Add-PSSnapin Microsoft.SharePoint.PowerShell

Windows Live Tags: Loading Sharepoint PowerShell Snap-in

Blogger Labels: Loading Sharepoint PowerShell Snap-in

Enabling PowerShell Integrated Scripting Environment (ISE) on Windows Server 2008

Windows Server 2008 or Windows Server 2008 R2 includes a powerful utility named PowerShell Integrated Scripting Environment(ISE).It allows to debug PowerShell Scripts in a very efficient manner.But unfortunately it doesn’t give intellisense support.

SharePoint Foundation installs the PowerShell runtime ,but does not automatically install the PowerShell ISE. You have to explicitly enable it by adding a windows feature

enabling ISE

Blogger Labels: PowerShell Integrated Scripting Environment(ISE),Enabling PowerShell Integrated Scripting Environment(ISE) on Windows Server 2008

Enabling PowerShell Integrated Scripting Environment (ISE) on Windows Server 2008

Windows Server 2008 or Windows Server 2008 R2 includes a powerful utility named PowerShell Integrated Scripting Environment(ISE).It allows to debug PowerShell Scripts in a very efficient manner.But unfortunately it doesn’t give intellisense support.

SharePoint Foundation installs the PowerShell runtime ,but does not automatically install the PowerShell ISE. You have to explicitly enable it by adding a windows feature

enabling ISE

Blogger Labels: PowerShell Integrated Scripting Environment(ISE),Enabling PoerShell Integrated Scripting Environment(ISE) on Windows Server 2008

Power Shell cmdlets and pipelining

PowerShell is based on reusable libraries containing functions known as cmdlets (pronounced command lets). Cmdlets have names which follow the convention of a common verb followed by a noun. For example, the built-in PowerShell libraries provide a cmdlet named Get-Process which returns a collection of objects representing the Windows processes running on the current machine.

PS D:\Users\Administrator> Get-Process

Handles  NPM(K)    PM(K)      WS(K) VM(M)   CPU(s)     Id ProcessName
-------  ------    -----      ----- -----   ------     -- -----------
    400      45   217700     223408   461   299.30   5172 Acrobat
     80      10     1696       5188    72     0.03   5520 acrotray
     66       9     1632       4712    68     0.03   1780 Adobelm_Cleanup.0001
     66       9     1636       4672    68     0.03   6100 Adobelm_Cleanup.0001
     54       7     1104       3060    28     0.00   5176 Adobelmsvc
     41       4     1012       2508    15     0.00   1692 AESTSr64
     48       6     2136       4972    54     0.73   1680 conhost
     31       4      928       2392    22     0.00   4468 conhost

Pipelining in an important concept to understand when executing cmdlets. The basic idea is that every cmdlets returns an object or a collection of objects. Pipelining allows you to take the results of one cmdlets and pass it to a second cmdlet. The second cmdlets can run and then pass its results to a third cmdlets and so on. You create a pipeline by typing a sequence of cmdlets separated by the | (pipe) character.

cmdlet1 | cmdlet2 | cmdlet3

Example

if (dir | where {$_.length –gt 10kb}) {
“There were files longer than 10kb”
}

Blogger Labels: Pipelining in PowerShell,PowerShell cmdlets

Power Shell Common syntaxes

There are two common ways in which you can use PowerShell. First, you can execute commands interactively using the PowerShell console window. Second, you can write scripts to automate administration tasks.

Accessing PowerShell Console window

Start > All Programs > Accessories > Windows PowerShell > Windows PowerShell

Common Help

  • Use the “exit” keyword to exit the shell
  • Ctrl-C will interrupt the current task returning you to the prompt.
  • A command can be spread over multiple lines and the interpreter will prompt for additional input. The line continuation character is the back-quote ‘`’ (also called the back-tick).
  • Ctrl-C will interrupt the current task returning you to the prompt.
  • To get help about a command you can do “help command”. The help command by itself will give you a list of topics.
  • The help command supports wildcards so “help get-*” will return all of the commands that start with “get-”.
  • You can also get basic help on a command by doing “commandName -?” like “dir –?”

Variables in Power Shell

PS > $x= 5                
PS > echo $x
5

PS >

Arrays
PS > $x= Subhasis,Daniel, Mac
PS > echo $x[1]
Daniel

PS >

HashTable

PS > $h= @{a=1;b=2;c=3}
PS > echo $h
Name             Value

a                       1
b                       2
c                       3
Flow-control Statements:

These Statements can be used to iterate the user collections


if Statement:
if ($b –eq 15) { $a=13} else {$a=15}

The condition part of an if statement may also be a pipeline.


if (dir | where {$_.length –gt 10kb})

{
“There were files longer than 10kb”
}

while Loop:

$b=1; while ($b –lt 10) { echo $b }

for Loop:

for ($i=0; $i –lt 10; $i++)

{
echo $i
}

foreach Loop:

foreach ($i in 1..10)

{
$echo $i

}

Blogger Labels: PowerShell,Power Shell Common Syntaxes,PowerShell,PowerShell Control Statements,Power Shell and Sharepoint 2010,Administration using Power Shell and Sharepoint 2010,Start,Help,Ctrl,task,interpreter,continuation,Variables in PowerShell,Subhasis,HashTable in PowerShell,If Statement in PowerShell