Speaking at SharePoint Saturday NYC 2014

image

I am pleased to announce that I will be once again presenting at SharePoint Saturday NYC on July 26th, 2014.

SharePoint administrators, end users, architects, developers of all kinds, and other professionals that work with Microsoft SharePoint Technologies will meet for the 5th SPS Events New York City event on the last Saturday of July, July 26, 2014 at the new Microsoft office located at 11 Times Square, across the street from the Port Authority Bus Terminal at 8th Ave & 42nd St.
 
Come see world-class speakers from around the country and the globe present the very same content you’ll see at conferences that cost thousands of dollars to attend, and see it – as always – absolutely free of charge.
 
Registration to attend will open June 20th; stay tuned here for more information as it becomes available!

I will be presenting “Automating your Enterprise Application Deployments with PowerShell”.

Session Abstract

In enterprise application deployments to SharePoint, there are generally farms, or web applications that host specific applications for specific groups, rather than having just an all-in-one deployment. Often times, you do not have access to these other environments, and will need to pass the deployment baton off to the system administrators of those farms.

This session will walk you through how you can deploy your applications, without needing to have the administrator who will be deploying the application, have to do much more than type a few keys into the SharePoint Administration Console and press enter – and having full configuration and deployment of your custom SharePoint applications to other environments.

Speaking at the Granite State SharePoint Users Group on February 21, 2013

Granite State SharePoint Users Group (GSSPUG) NHI am pleased to announce that I will be speaking again at the Granite State SharePoint Users Group on February 21, 2013. I will be presenting “Automating your Enterprise Application Deployments with PowerShell”

Session Abstract

In enterprise application deployments to SharePoint, there are generally farms, or web applications that host specific applications for specific groups, rather than having just an all-in-one deployment. Often times, you do not have access to these other environments, and will need to pass the deployment baton off to the system administrators of those farms.

This session will walk you through how you can deploy your applications, without needing to have the administrator who will be deploying the application, have to do much more than type a few keys into the SharePoint Administration Console and press enter – and having full configuration and deployment of your custom SharePoint applications to other environments.

Meeting Location

Eaton Richmond Center, Room 122 at Daniel Webster College, Nashua, NH

Meeting Time

6P – 8P

Meeting Registration

Click here to register: http://granitestatesharepoint.eventbrite.com/?ref=ebtn

User Group Information

For more information on the Granite State SharePoint Users Group, visit them at: http://www.granitestatesharepoint.org

Hope to see you there!

Extracting Solution Packages (WSPs) from SharePoint using PowerShell

I just stumbled across this link from Kirk Evanshttp://blogs.msdn.com/b/kaevans/archive/2011/12/05/extract-a-wsp-solution-from-sharepoint-2010.aspx

Basically, using 3 lines of PowerShell (which can be turned really into one if needed), to extract a SharePoint Solution Package (WSP) from the Farm Solutions collection.

From his post:

$farm = Get-SPFarm

$file = $farm.Solutions.Item("extendeddiagnosticproviders.wsp").SolutionFile

$file.SaveAs("c:\temp\extendeddiagnosticproviders.wsp")

As awesome as it is easy.

How much storage space is my site collection using?

NOTE: This post is just covering SharePoint 2010, and not earlier versions of the product.

imageA common question administrators have in their SharePoint environment is “How much storage space is my site collection using?”

Well, fear not, trusty SharePoint administrators! There are a few ways to skin this cat – and we’re going to take a look at them.

 

SharePoint Designer

SharePoint Designer – what was once something administrators and power users shuddered at the mere mention of the tool in prior versions of the product, has gotten a makeover. And, also has a lot of additional functionality. For today’s lesson however, we are only going to look at one specific feature of it – the ability to view the storage used for an entire site collection!

If you open up SharePoint Designer to the root site of your site collection, in the main window, once the site is opened under Site Information, you will see, as highlighted below, that it will conveniently display the Total Storage Used of your entire site collection! There! As the big red button on my desk often says after a good firm press… “That was easy!”.

image

Let’s look at a couple of other methods of getting this information, shall we?

StorMan.aspx – SharePoint 2010 Service Pack 1+

This one requires Service Pack 1 to be installed to be able to utilize this feature. It was not in the RTM version. At the root of your site collection, if you go to Site Actions > Site Settings > Site Collection Administration > Storage Metrics, this will give you details on the usage – such as what sites, lists, libraries, and items are taking up the most space, however, it will not give you a total like our trusty SharePoint Swiss Army Knife – SharePoint Designer does, but, it will allow you to drill down into the usage.

image

I will also urge you to view Bill Baer’s article on Storage Metrics in Service Pack 1 – which has some great screenshots of the functionality, as well as an overview, available here: http://blogs.technet.com/b/wbaer/archive/2011/06/28/service-pack-1-storage-metrics-storman-aspx.aspx

PowerShell

imagePowerShell, one of the other power tools in SharePoint 2010, much more akin to the Ginsu knife, can also serve up the details, and, like the Ginsu knife, allow you to slice and dice the information in a myriad of ways.

Below is an example script to connect to your site collection, and read out all of the usage information.

$site = Get-SPSite http://my.sitecollection.com
$site.Usage;
$site.Dispose();

Which gives the following output (storage shown highlighted below in bytes):

image

To view just the Storage property, and not Bandwidth, Visits, Hits, and DiscussionStorage, you can call this:

$site = Get-SPSite http://my.sitecollection.com
$site.Usage.Storage;
$site.Dispose();

And only the Storage property with the total bytes will be displayed. You can also do some other cool tricks, such as calculating kilobytes, megabytes, gigabytes and terabytes right from the command line as well, to make the results a bit more readable:

image

Want more? OK! We can give it to you! Keep reading! (Because, reading is fundamental, you know.)

Web Analytics

Another option to view the storage used, as well as some additional metrics around it, if you have Web Analytics enabled, you can view your usage over time. To see this, go to Site Actions > Site Settings > Site Actions > Site Collection Web Analytics reports

image

Once there, in the main screen, you can view a summary of the Total Storage Used under Inventory.

image

And if you click on Storage Usage under Inventory within the quick launch navigation on the left, you can then view reports on storage utilization for your site collection, with a graph of the values so you cane easily visualize the trend in storage usage.

image

image

As well as a daily breakdown of the storage used, so you can see how this grows or falls over time.

image

You can also run reports for any date range since Web Analytics have been enabled, as well as run workflows against this data for alerting and reporting.

image

I hope you were able to learn something new today… have another method in which you get your site collection storage metrics? Leave it in the comments below for everyone else!

Generic Errors with Lists and Manage Content and Structure Tool

image

An unexpected error has occurred. Yep. Very helpful! Recently, when attempting to use the Manage Content and Structure tool (found under Site Actions > Manage Content and Structure), I received the above error. Looking into the ULS logs, all I was able to get ahold of was a System.NullReferenceException. Again, not really handy, or useful, at all.

I was able to determine that it had to probably be due to a list… turns out, we had deactivated and retracted several features from our farm recently, several of which relied on custom lists to store the data. If I go to View All Site Content (Site Actions > View All Site Content), and click on one of these lists, I get a similar error to the above.

Luckily, one of the times when attempting to launch the Manage Content and Structure Tool, I was able to get this error in the ULS logs.

Failed to determine the setup path of the list schema for feature {553B9E4F-C7EA-4442-845F-94390C1EAE44}, list template 10000.

So, basically, we need to remove these lists. We cannot get into the “Delete this List” option within the List management screen – otherwise you’ll get an error similar to the above. I also attempted to use SharePoint Manager 2010, which also gave an error. I just couldn’t delete the list using traditional means…

You have two options here…

  1. Write some code to delete the list (C#, PowerShell… whatever you desire)
  2. Use Gary LaPointe’s STSADM extensions and PowerShell scripts.
    1. Remove-SPList PowerShell Command
    2. gl-deletelist STSADM command

Either of those should do the trick! Now, to get the List URL is simple, the lists should still appear under View All Site Content, just right-click and copy the shortcut to the list view, for example: http://sharepointsite.com/Lists/SomeCustomList/AllItems.aspx

Use that when calling those commands with the URL parameter, and you’re good to go.

PowerShell script to list all Webs and Site Templates in use within a Site Collection

And one more quick post today, this PowerShell script will iterate through all Webs within a Site Collection, print out their Title, URL, and WebTemplate (Site Template) name.

   1: $site = Get-SPSite "http://yoursite"

   2: foreach ($web in $site.AllWebs) { 

   3:     $web | Select-Object -Property Title,Url,WebTemplate 

   4: }

   5: $site.Dispose()

And again, before you use this – please read this: http://gvaro.wordpress.com/2011/03/26/test-out-your-powershell-scripts-first-in-a-non-production-environment-first/ (and also read the comment by Anders Rask)

LotD: Using PowerShell to Approve List Items

The Link of the Day (LotD) goes out to Eric Shupps for this quick PowerShell snippet http://www.binarywave.com/blogs/eshupps/Lists/Posts/Post.aspx?List=89cbe813%2D99f7%2D4257%2Da23a%2D5fefc377336b&ID=241&Web=c7893495%2Dbe3b%2D4d73%2D9875%2D28b039760651. This PowerShell code will loop through a list of your choice and approve list items. This is a huge timesaver for me right at the moment. Thank you Shupps!

I do have some slight changes to the code. There is no need to open the site collection object (line 1), we can just use Get-SPWeb to open the web we need, and, also disposing of the web object at the end, so we don’t leave it sitting around eating up memory on the server.

Normally I do not create posts like this, but, I think I had something to add to it, and, I know exactly where to find it later on, as I am sure I will need it.

   1: $web = Get-SPWeb "http://site"

   2: $list = $web.Lists["Posts"]

   3: $items = $list.Items 

   4:  

   5: foreach ($item in $items)

   6: {

   7:     $item["_ModerationStatus"] = 0

   8:     $item.Update()

   9: } 

  10: $web.Dispose()

And before you use this – please read this: http://gvaro.wordpress.com/2011/03/26/test-out-your-powershell-scripts-first-in-a-non-production-environment-first/ (and also read the comment by Anders Rask)

TEST OUT YOUR POWERSHELL SCRIPTS FIRST IN A NON-PRODUCTION ENVIRONMENT FIRST

You may be wondering why I applied such bad grammar to the title of this post, it came from a comment on this: https://www.nothingbutsharepoint.com/sites/itpro/Pages/Seven-Virtues-for-the-SharePoint-IT-Pro.aspx

PowerShell is a beast. Sure, it’s hard to learn the syntax, and there are 600+ commands that come along with SharePoint 2010. But, it also gives you direct access to the API for SharePoint. Never, ever, ever, ever, ever, ever, ever, ever, ever, ever, ever, ever, ever, ever, ever, under any circumstances what-so-ever, run un-tested PowerShell code in a production environment. ever. ever. ever. ever. ever. ever. ever. ever. ever. ever. ever. ever. ever. ever. ever.

What may have worked for one person, in which they have posted it on their blog, mailing list, or company-wide fax – it should be tested first, in a non-production environment.

It may work fine, sure, but, it may also grind everything to a halt, and end your career.

In closing, re-read the above, and make it your mantra. No go fourth, SharePoint admins (and devs – yes you too), and prosper.

Delete a master page in SharePoint using PowerShell

Had one of my group approach me today inquiring about deleting a master page from a site collection using PowerShell. Quick and simple way to do it…

 

   1: $web = Get-SPWeb "http://prototype"

   2: $lib = $web.GetFolder("_catalogs/masterpage")

   3: $file = $lib.Files["v4_copy(1).master"];

   4: $file.Delete();

   5: $web.dispose();

 

So I thought I would share. Enjoy!

Microsoft.BusinessData.Runtime.ExceededLimitException: Database Connector has throttled the response.

If you’ve created a BCS list before (such as defined by the excellent tutorial put together by Laura Rogers for connecting to a SQL data source using a SQL account – http://www.sharepoint911.com/blogs/laura/Lists/Posts/Post.aspx?ID=90), and received this error on your Read List view page:

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:117e242f-0985-42e9-9972-b1a879ce7e3b

After investigating the ULS Logs, located in %SYSTEM DIR%\Program Files\Common Files\Microsoft Shared\web server extensions\14\LOGS, and searching for the correlation id mentioned above. You may find the following error:

Error while executing web part: Microsoft.BusinessData.Runtime.ExceededLimitException: Database Connector has throttled the response. The response from database contains more than ‘2000’ rows. The maximum number of rows that can be read through Database Connector is ‘2000’. The limit can be changed via the ‘Set-SPBusinessDataCatalogThrottleConfig’ cmdlet.     at Microsoft.SharePoint.BusinessData.SystemSpecific.Db.ThrottledIDataReader.Read()     at Microsoft.SharePoint.BusinessData.SystemSpecific.Db.DbEntityInstanceEnumerator.MoveNext()     at Microsoft.SharePoint.BusinessData.Runtime.EntityInstanceEnumeratorBase.MoveNext()     at Microsoft.SharePoint.SPListDataSource.GetFilteredEntityInstancesInternal(XmlDocument xdQueryView, Boolean fFormatDates, Boolean fUTCToLocal, String firstRowId, Bo…

Thanks to the wonders of the interwebs, the solution to this is fairly simple, and the error explanation is extremely helpful. Do a search for this: Set-SPBusinessDataCatalogThrottleConfig, which will lead you to a great article on the Microsoft Business Connectivity Services Team Blog by Adam Outcalt here: http://blogs.msdn.com/b/bcs/archive/2010/02/16/bcs-powershell-introduction-and-throttle-management.aspx which will give you very great instructions on modifying the BCS throttling configuration.

Be careful with this however, the throttling is there for a reason. Not just to give you another option to configure.

Follow

Get every new post delivered to your Inbox.

Join 3,297 other followers

%d bloggers like this: