Apr 25, 2009

Getting Started with SharePoint PowerWebPart 3.0

I’ve just released PowerWebPart 3.0 on my iLove SharePoint project at CodePlex. What can you do with PowerWebPart?

Write reusable SharePoint WebParts with PowerShell

Features:

  • Simple HTML Rendering
  • ASP.NET and SharePoint WebControls
  • Supports WebPart Connections (Row Provider/Consumer, Table Provider/Consumer)
  • AJAX enabled
  • jQuery enabled
  • Configurable parameters
  • SharePoint Object Model
  • NEW: PowerGUI Script Editor Integration
  • NEW: Script Signing
  • NEW: Custom Editor Parts written in PowerShell
  • NEW: Central Script Repository
  • NEW: Import and Export
  • NEW: Error Handling
  • NEW: Debugging
  • No compile, no packaging, no deploy, no iis reset deployment
  • Copy & Paste deployment
  • Anything PowerShell can do :-)

One of the major improvements is the automatically script signing. Only farm administrators are allowed to edit scripts in the UI. But what is when you export a web part, change the script and import it to a web part gallery again? The signature will be broken and the script will not run anymore. So exporting and importing is now secure. The script will automatically be signed when a farm administrator clicks on ‘Apply’ in the web part's editor panel. The signing key will generated randomly on installation, but can be changed anytime later. 

For installation and configuration see documentation.

Getting Started Screen Cast:

Soon I will post a PowerWebPart Tag Cloud example…

38 comments:

Jeremy Thake said...

Where is the script stored so that PowerGUI can edit it and save it back? Can you have more than one instance of the web part in one web part zone on a page?
Performance wise, if you had 1000 users hit the page, how does the server react?
Great idea! Loving the potential for all sorts of stuff with object model and server stuff.

Christian said...

The script is stored in a WebPart property, so it wil be persited in the SharePoint Content DB.
The PowerGUI integration is done via an ActiveX plugin and JavaScript. You can have as many instances on a page as you want.
Performance is good question, I haven't tested with 1000 users. We really used it in projects for small teams - works well. But I'm really curious how it will perform with 1000 users. I or maybe someone else have to do a performance test, but unfortunatley time is very limited ;-)

SPAdmWiki said...

Thanks for answering that so quickly. Great webpart, just need to get time to use it now ;-)

Гломозда said...

How can I use Powershell 2.0POwerWebPart3.0? I have script for working with Exchange mailboxes. This script work in PowerGui command shell , but when I save this script in PowerWebPart, I have received error.

Christian said...

Hi,
Power WebPart 3.0 works with PowerShell 2.0. Maybe you can post your script to the codeplex forum, so I can have look at it...
Bye,
Christian

Yuriy Glomozda said...

Thanks for reply.
I will send my script if it need for you. But it's my general problem: I have to run simple Exchange management script,but have received error because of Exchange cmdlets absent . I have Powershell CTP2 and Exchange management cmdlets. Script in power shell have run OK. But in PowerWebPart 3.0, I think, Exchange management cmdlets don't visible. Is any ideas?
1)Powershell variable $profile in PowerWebPart is empty.
2)Add-PSSnapin "*Exch*"
will do error: Failed to grant permission to execute.

Thanks,
Yuriy Glomozda

Christian said...

Hi Yuriy,

normally it should support Add-PSSnapin. Maybe the current user hasn't the right to load the snapin. Have you done the setting int asp.config described in the readme? If you have not the webpart runs under the apppool user which is usually a very ristricted account. You can verify the current principal with:
function render($writer)
{
$identiy = [System.Security.Principal.WindowsIdentity]::GetCurrent().Name

$writer.Write($identiy + "
")
}

Bye,
Christian

Гломозда said...

Hi, Christian

My configuration/runtime in asp.config has:
1. legacyUnhandledExceptionPolicy with enabled=false
2. legacyImpersonationPolicy with enabled=false
3.alwaysFlowImpersonationPolicy with enabled=true
4.SymbolReadingPolicy with enabled=1
Your render-function from your reply returned my Domain Administrator.

I don't understand, why my script don't work in PowerWebPart. Is there some another ideas?
Thanks,
Yuriy

Anonymous said...

Heya,

Tried to deploy the webpart on MOSS farm (Sp1). During install everything seems to be OK but after activating the feature at Site level and taking the webpart to the page a "File not found" error occures.

any advice?

Thanks, MaoT

Anonymous said...

Heya again,

So the error msg is:
---------------------------
Could not load file or assembly 'System.Management.Automation, Version=1.0.0.0, Cluture=neutral, PublikKeyToken=... or one of its dependencies. The system cannot find the file specified.
---------------------------

Stack Trace:
---------------------------

[FileNotFoundException: Could not load file or assembly 'System.Management.Automation, Version=1.0.0.0, Cluture=neutral, PublikKeyToken=... or one of its dependencies. The system cannot find the file specified.

IloveSharepoint.Webcontrols.Powercontrol..ctor() +0
IloveSharepoint.Webcontrols.PowerWebPart.CreateChildControls() +113
System.Web.UI.Control.EnsureChildControls +146
System.Web.UI.Control.PreRenderrecursiveInternal() +61
System.Web.UI.Control.PreRenderrecursiveInternal() +224
System.Web.UI.Control.PreRenderrecursiveInternal() +224
System.Web.UI.Control.PreRenderrecursiveInternal() +224
System.Web.UI.Control.PreRenderrecursiveInternal() +224System.Web.UI.Control.PreRenderrecursiveInternal() +224
System.Web.UI.Control.PreRenderrecursiveInternal() +224
System.Web.UI.Page.ProcessRequestMain(Boolean IncludeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3394

---------------------


Thanks so, MaoT

Christian said...

Hi,

you have to install PowerShell on the server.

Bye,
Christian

Anonymous said...

Heya,

yes :( sorry for that... We have Farm wirh 3 FE and 1 Indexing. On Indexing and 2 of the FEs PWS was installed but not on the 3rd.

My request went to the 3rd one :( which had PWS feature not enabled (w2k8)

argh..... I was looking everything at this time with ProcMon but without luck...

once more, sorry for that silly mistake :( Anyway thanks for the Reply

Bye, MaoT

Anonymous said...

Hi Christian

I have installed PowerWebPart 3.0 on a DEV server, and when I go to add a web part, I receive this error:

Power WebPart 3.0
iLove SharePoint PowerShell WebPart 3.0
Power WebPart 3.0

Error on Initialization
Exception:
Script is not signed!
Stack:
at iLoveSharePoint.WebControls.PowerControl.Render(HtmlTextWriter writer) at iLoveSharePoint.WebControls.PowerWebPart.Render(HtmlTextWriter writer)


Any ideas?

Memo said...

Hello Christian:

I am having problems running your PowerWebPart. The steps I followed were:

1. Runned setup in my server
2. iisreset
3. Went to a site
4. Site Settings
5. Site Features

And there I can't find the PowerWebPart.

Did I miss something?

BTW: I use the PowerActivity and it's great!

Christian said...

Hi Memo,
you should see the feature under site collection features.

Bye, Christian

Anonymous said...

I install pwp by dbl click setup.exe
go to sharepoint.. activate ilovesharepoint powerwebpart

goto add web part.. and can't find pwp in list.

then i go to add web-parts and see this:

Error on Initialization
Exception:
Script is not signed!
Stack:
в iLoveSharePoint.WebControls.PowerControl.Render(HtmlTextWriter writer) в System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) в System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) в System.Web.UI.Control.RenderControl(HtmlTextWriter writer) в iLoveSharePoint.WebControls.PowerWebPart.Render(HtmlTextWriter writer)

Christian said...

works as designed. the script that y will enter will be signed when you save it the first time (farm admin rights required)

Anonymous said...

I try to use a script in the library defined in the administration page.
The script was tested before in the webparts self.
I copy the script into a file, stored in the library and call this script by the import command.
It doesn't work.
I try to make the simplest example

function Render($writer)
{
$writer.Write("May the power be with you!")
}

and I get the error "
Error on render
PowerShell Exception:
The term 'render' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
Stack:
at iLoveSharePoint.WebControls.PowerControl.Render(HtmlTextWriter writer) at iLoveSharePoint.WebControls.PowerWebPart.RenderContents(HtmlTextWriter writer)"

And idea?

BGM said...

Aaaaawww! I actually *want* to watch a video this time! It says "no videos were found." I'd really like to see the demo of this addon in action.

electronic signature pdf said...

Hi there! glad to drop by your page and found these very interesting and informative stuff. Thanks for sharing, keep it up!

maymay said...

Like with just about any substantial greenback object, anyone iwc replica sale consider having continuously you'll want to become knowledgeable regarding the different types, a brief history of such types along with Rolexes normally, along with which in turn style ideal accommodates your financial allowance along with manner impression. Nothing at all reduces your delight involving control similar to potential buyer's rolex replica, along with by simply rehearsing tolerance, anyone not simply make sure you happen to be seeking the excellent style in your case, you happen to be in addition making sure that you'll not expertise just about any regret following simple fact. Certification? Obtaining a pre-owned Rolex consists of ready for, along with tightly checking, the right breitling replica certification to ensure authenticity. Because market place pertaining to pre-owned Rolexes features heated up way up, consequently features products you can Rolex reproductions. The truth is, the top false Rolexes are incredibly challenging for you to for the people not in the necklaces organization for you to find, consequently a respected breitling replica sale marketer include your certification as being a subject naturally inside financial transaction. Standard Rolex qualifications must be consist of the main field along with scenario. The state qualifications involves crucial data, for example the serial variety, call data, activity variety, along with style situation. Legitimate certs will likely incorporate Rolex extended warranty fake rolex, the official Chronometer Qualifications, and also a exclusive crimson seal off at the bottom level using frayed guitar strings jogging by way of the idea.

Hug Day said...

happy hug day 2016 SMS
hug day 2016 Wishes cards greetings
Hug day Date 2016
hug day sms

Libin Huang said...

20160426libinferragamo outlet
pandora outlet
ferragamo shoes
nike air max
ferragamo shoes
hermes belt for sale
michael kors factory outlet
swarovski crystal
ferragamo shoes
michael kors outlet
louis vuitton handbags
louis vuitton handbags outlet
swarovski outlet
beats by dre
cazal outlet
mont blanc pens
longchamp solde
fitflops outlet
cartier sunglasses for men
michael kors outlet
louis vuitton outlet
swarovski crystal
cheap nfl jerseys
adidas outlet store
tory burch outlet
cheap oakley sunglasses
mulberry bags
rolex watches,rolex watches,swiss watches,watches for men,watches for women,omega watches,replica watches,rolex watches for sale,rolex replica,rolex watch,cartier watches,rolex submariner,fake rolex,rolex replica watches,replica rolex
oakley sunglasses
tory burch outlet
ray ban sunglasses
louis vuitton outlet
polo ralph lauren
michael kors uk
tiffany outlet

Yuanyuan Lin said...

7.14llllllyuan"timberland shoes"
"soccer jerseys wholesale"
"longchamp pliage"
"cheap oakley sunglasses"
"true religion jeans"
"louis vuitton pas cher"
"rolex orologi"
"christian louboutin shoes"
"michael kors clearance"
"cheap nba jerseys"
"oakley sunglasses wholesale"
"tory burch shoes"
"tory burch outlet"
"chicago blackhawks jerseys"
"longchamp outlet"
"omega watches"
"adidas trainers"
"cheap nike shoes"
"nike outlet store online"
"michael kors outlet clearance"
"michael kors uk"
"montblanc pens"
"michael kors canada"
"longchamp handbags"
"ray ban sunglasses"
"abercrombie and fitch"
"mcm outlet"
"puma shoes"
"ralph lauren uk"
"nike air max 90"
"rolex watches,rolex watches,swiss watches,watches for men,watches for women,omega watches,replica watches,rolex watches for sale,rolex replica,rolex watch,cartier watches,rolex submariner,fake rolex,rolex replica watches,replica rolex"
"mulberry outlet"
"air max 90"
"ferragamo outlet"
"christian louboutin outlet"
7.14

Fangyaya said...

louis vuitton handbags
tory burch shoes
adidas trainers
christian louboutin sneakers
nike roshe flyknit
louis vuitton handbags
toms wedges
concord 11
asics shoes for women
oakley outlet
coach outlet
adidas shoes
basketball shoes
michael kors outlet
michael kors outlet
christian louboutin outlet
michael kors outlet
jordan shoes
kate spade outlet
coach outlet online
coach outlet store
beats by dre
oakley vault
celine outlet
michael kors outlet online
ray ban sunglasses outlet
jordan concords
michael kors outlet online
gucci outlet online
christian louboutin sale
toms wedges
abercrombie clothing
michael kors outlet online
toms outlet
rolex watches
red bottom shoes
celine handbags
michael kors outlet online
abercrombie & fitch outlet
louis vuitton purses
20168.8chenjinyan

dada24 Xu said...

toms shoes outlet
ugg outlet
celine outlet store
red bottoms
moncler jackets
adidas nmd
longchamp bags
cheap jordans
ugg outlet
christian louboutin shoes
2016921caiyan

chenlina said...

coach outlet
uggs outlet
ray ban wayfarer
ralph lauren uk
louis vuitton paris
ugg boots clearance
toms shoes
fitflops
ralph lauren outlet
ray ban sunglasses
chenlina20160923

Meiqing Xu said...

pandora uk
true religion jeans
michael kors handbags
adidas nmd
true religion jeans
ugg australia
birkenstock shoes
michael kors canada
pandora bracelet
ray ban sunglasses
20161221caiyan

huali10 Cai said...

rolex watches for sale
louis vuitton
cheap jordans for sale
air max 90
longchamp outlet
nike outlet store online
tory burch outlet online
futbol baratas
cheap oakley sunglasses
michael kors outlet clearance
qqqqqing20170411

Unknown said...

cartier outlet
fitflops sale clearance
sac louis vuitton pas cher
longchamp outlet online
mulberry uk
thomas sabo charms
cheap oakley sunglasses
cheap nike shoes
ray-ban sunglasses
ralph lauren
chanyuan2017.05.08

dong dong23 said...

supra footwear
oakley sunglasses sale
cheap ray ban sunglasses
nike roshe 1
puma sneaker
cheap nfl jerseys wholesale
converse outlet
rolex replica watches
adidas yeezy
nike air max 90
2017.5.11chenlixiang

xjd7410@gmail.com said...

polo ralph lauren outlet
michael kors handbags
mlb jerseys
cheap nfl jerseys
asics,asics israel,asics shoes,asics running shoes,asics israel,asics gel,asics running,asics gel nimbus,asics gel kayano
foamposite shoes
louis vuitton outlet
chrome hearts
oakley sunglasses sale
fitflops uk
chanyuan2017.05.24

raybanoutlet001 said...

nike air huarache
cheap basketball shoes
hugo boss suits
nike air huarache
new orleans saints jerseys
ray ban sunglasses
pandora outlet
nike huarache
armani exchange
rolex replica

Home Improvement NYC said...

Ajrin Construction Inc. is a licensed New York general construction firm working as General Contractors in NYC, truly devoted to our services and remain firm until our Clients’ purposes are served to satisfaction. We feel much concerned of the value of your property, safety and security more than our profit or anything else.
Home Improvement NYC

Games 2 Girls said...

The article you have shared here very awesome. I really like and appreciated your work. I read deeply your article, the points you have mentioned in this article are useful
www.baixar-whatsapp.com.br

Sankar lp said...

Hi, Great.. Tutorial is just awesome..It is really helpful for a newbie like me.. I am a regular follower of your blog. Really very informative post you shared here. Kindly keep blogging. If anyone wants to become a .Net developer learn from Dot Net Training in Chennai. or learn thru ASP.NET Essential Training Online . Nowadays Dot Net has tons of job opportunities on various vertical industry.
or Javascript Training in Chennai. Nowadays JavaScript has tons of job opportunities on various vertical industry.

اميرة زماني said...


نقدم افضل خدمات تنظيف الكنب بالرياض فنحن نملك افضل اجهزة التنظيف بالبخار لاننا افضل شركة تنظيف كنب بالرياض
وبالمملكة واسعارنا في متناول الجميع
افضل شركة تنظيف بالمدينة المنورة
شركة شراء اثاث مستعمل بالرياض - شراء اثاث مستعمل
شركة تسليك مجاري بالدمام

اميرة زماني said...


شركة تسليك مجاري بالرياض
افضل شركة تنظيف منازل بالرياض
اسعار غسيل السجاد بالرياض
فك و تركيب باركيه بالرياض