MMC – Monitor SharePoint in Real-Time

February 7th, 2010 by Jeff No comments »

The Microsoft Management Console has been around for years, since Windows NT 3.5 I believe, and it a great tool.   Recently I helped create a custom .MSC file to watch SharePoint’s “heartbeat” in real-time and had a lot of fun with the results so I’ll share them here.

First, the beautiful end product: 

bueno.msc

Scope: Windows Server 2003 + MOSS 2007

How did we do it?

  1. Start \ Run\ “mmc.exe”   (this opens Author mode)
  2. Add Snap In (Ctrl+M)
  3. Click “Add” button
  4. Select “ActiveX Control” and click “Add”
  5. Select “System Monitor Control” and click “Next”
  6. Give it a name (i.e.  “Current Web Connections”) and click “Finish”

Feel free to repeat #3 to #6 to add multiple nodes to the tree.   This way you can monitor more than one metric across the farm.  With the left hand tree complete you are now ready.

Customize each node with:

  • Perfmon counters
  • Servers
  • Colors
  • Chart scale

Simply right click in the blank space, choose “Add Counter”, and follow the steps you would just like in Perfmon.exe     I personally like to add the same counter for each server in my farm so that on one chart I can see, for example, all of the CPU usage on all machines.

Once you’re pleased with the look and feel click “File \ Save As” and give a filename for the .MSC

You can now open multiple instances (windows) and tile them across the screen to have a real-time view of SharePoint’s “heartbeat” across all the web front ends in your farm.   

Why do I need this?

  • Establish a performance baseline (what is normal CPU?  during the work day?  at night during scheduled jobs?)
  • Troubleshoot a broken server (easily see differences)
  • Become more familiar with the impact of a topology design  (slow crawls = 100% CPU?)
  • It looks really cool, trust me!

image

image

image 

image

image

image

image

Hide the "Powered By InfoPath” logo

February 5th, 2010 by Jeff No comments »

In working with InfoPath Forms Services in MOSS 2007 I found that the web based form experience is great.  And I like InfoPath but even I don’t want a logo bumper sticker to stare at all day.

By editing “ifsmain.css” on the SharePoint web front end’s 12 hive you can override the system styling to hide this element.   The IE developer toolbar helped me find the CSS class (ToolbarBranding) to add the “display:none” attribute.  Screen shot below.  Open-mouthed

 

C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS\INC\ifsmain.css

 

image 

image

Workflow History – Event Type Numbers Decoded

January 29th, 2010 by Jeff 1 comment »

On a SharePoint site’s hidden Workflow History list you might stumble across some strange numbers.  The Event Type is used to store a numeric value and below I’ve listed what each means in plain English.

These map to Microsoft.SharePoint.Workflow.SPWorkflowHistoryEventType which contains their values in Visual Studio for developers.

Unfortunately MSDN does not list the numeric values for use by power users to create filtered views in the browser.   However, I have them here:

 

Number Event Type
0 None
6 TaskCompleted
5 TaskCreated
9 TaskDeleted
7 TaskModified
8 TaskRolledBack
3 WorkflowCancelled
11 WorkflowComment
2 WorkflowCompleted
4 WorkflowDeleted
10 WorkflowError
1 WorkflowStarted

 

image

 image

MOVIE – Awesome Admin Grid Scripts

January 4th, 2010 by Jeff 1 comment »

Following up on my earlier post about the popularity of VBScript.  Again, I love new technology but we sometimes need the older tools to “git r done” today.   Please watch the 18 minute screen cast video for a real demo of each script.  Also, the download is available right here:

  SharePoint Dashboard.zip

   Vimeo – Watch Now

image

This demo covers my “dashboard” and “grid” script collection.

  • Explore C$
  • Free disk
  • GAC listing
  • Grid install apps
  • Grid file version
  • Grid windows service
  • Grid SPN
  • Grid WMI query
  • HOSTS compare
  • Kerberos (NTAuthenticationProvider)
  • Registry get/push
  • Web.config compare
  • WMI reboot

The design is simple yet powerful.  Drag and drop (noun to verb) from server to script.  Examples: 

  • explore c$ on these 5 machines 
  • push this reg key to 6 machines
  • compare windows services on these 12 machines
  • show me the Kerberos settings for these 7 machines

I began this family of short and simple VBS scripts back when I first deployed MOSS to production and have built them up over the years.  They have completely changed the way I work.  No more slow implementation.  No more uncertainty about configs.   Implement change quickly, spend your time on the whiteboard, and be 100% sure the configs are consistent across the board … every time.

Please take 5 minutes to watch the below video and glance over the screenshots.  Then download the ZIP and build your own RDP files for your servers.   If you find this useful or write new scripts please leave a comment or hit me up on Twitter.   I’m always  looking for ways to improve.  Thanks for reading.

SharePower + ShareMusic = Road Warrior

December 26th, 2009 by Jeff No comments »

 

image     image

I don’t travel nearly as much as many of you but I have two indispensible mini hardware items I bring along each time.  These splitters are cheap but handy.  I’ve made many friends and networked new business contacts too.   Electrical outlets at the airport are notoriously hard to find and disappearing fast.   During the recession airlines are looking for every cost cut including yanking power from general consumption to reduce the electrical bill.  If I find somebody already plugged in I simply ask if I can add a splitter and I’m now able to find power almost anywhere.  Smile

 

For music the same idea applies but in the give (not take) direction.   Somebody I’m having a conversation with that might be stranded and bored.    I can offer them music and let them choose the song so we get to talk more about things we like.   Anyway, nothing SharePointy but still fun.   It seems to work better on the younger iPod generation.

Maybe you’ll find these tips useful and … as always … safe travels!

PS – I wrote this while stuck at Hartsfield (ATL) for weather delays using a shared outlet.

VBScript is cool?!? Yeah, I said it.

December 16th, 2009 by Jeff 3 comments »

So everybody is talking about PowerShell and that’s great.  I love object oriented languages for scripting too.  PS is amazing.  But what about our old friend VBScript?   Our workhorse for the past decade?

Reasons why VBScript can be cool

  • Great samples.   Across the blogosphere we have thousands of articles, snippets, and walkthroughs to pull from.  Save time, copy and reuse.
  • Wide compatibility.   Even Server 2003 or Windows XP RTM will be able to run this stuff.   No Windows Update, no prep work, no doubts.
  • Familiar/proven.   There are many people that know this tool and how to use it.  As we learn new tools we need the old ones for our day jobs.
  • Quick edits.     While true of any scripting language “right click \ edit” is very handy and I generally dislike compiling dot net for admin work.
  • Editors.   Even SharePoint Designer 2007 can read and colorize VBS.  With PowerShell 2.0 we now have ISE and I really like it.   Using a GUI is required to get the work done quickly and correctly no matter what the language.

After a few years in the server admin business I’ve realized the tools evolve and so do we.   But ultimately our creativity and awareness of “fit” between tool and goal are what get things done.   So if the shoe fits … pull out an old script, dust it off, and give it new life!    A production outage is no time to read a reference book.

I’ll follow up by posting the code of my favorite VBScripts I use today in a real live production MOSS 2007 environment.  It gets the job done.  Yes, it should be re-written in PowerShell for SP2010 and Server 2008.   The “grid” scripts are my favorite and present on a single page configuration across machines for snazzy things like:

  • File versions
  • Windows services (state/startup mode)
  • Keberos NTAuthenticationProvider in IIS 6.0
  • Applications installed (registry)
  • Web.config modifications

 

image 
image image
image image

Lastly, empirical evidence suggests a fondness for this quirky old language via search results.   Open-mouthed

http://thumbs.dreamstime.com/thumb_229/1201479864wVkudS.jpg

Unable to assign this e-mail address to the list, because the address is in use – FIXED

November 20th, 2009 by Jeff No comments »

I came across this WSS error message today while working on incoming email updates and was stuck.   The browser clearly showed the list has no inbound email enabled and offered no alternatives on how to enable.   My enable failed, the address is taken, and I have no way to remove.

SQL Studio to the rescue!

addr in use

OK.  First of all I know, I know I know.   TSQL against the databases even in read only mode is frowned upon.   What I am doing here is far beyond supported, not safe, and I am a crazy man.  Again, I know this.   I had no other options and needed a solution.

DELETE

FROM [SharePoint_Config].[dbo].[EmailEnabledLists]

WHERE [Alias] =‘my_old_alias’

The config database holds a central table the incoming email references to get the site, web, and list GUID for where to place the message.    I found my old email alias in here despite the fact the web GUI showed it was disabled.   Disappointed  I wrote a select statement and copied the output to notepad in case I needed to INSERT this row back.   I then changed “SELECT *” to “DELETE” and killed the one row.   Flipping back to IE and clicking OK, it worked perfectly!   Never had any issues since and this was weeks ago.   Like they say on TV … “don’t try this at home”

Making a cozy PowerShell home

November 20th, 2009 by Jeff No comments »

During the Chicago SharePoint 2010 road show (#SharePointRS) Darrin Bishop (@bishopd) showed us a cool admin trick with the below command:

Add-PPSnapin Microsoft.SharePoint.PowerShell

NAME
    Add-PSSnapin

SYNOPSIS
    Adds one or more Windows PowerShell snap-ins to the current session.

SYNTAX
    Add-PSSnapin [-Name] <string[]> [-PassThru] [<CommonParameters>]

Every product shipping with Microsoft now seem sot have it’s own start menu icon and matching PowerShell console.   I’m a simple guy and prefer fewer icons.   So I changed my default profile.ps1 file (C:\Documents and Settings\%username%\My Documents\WindowsPowerShell\profile.ps1) to have all of the cmdlets loaded in one place.

It was a nice time saver for me, give it a try on your machine!  Hot

 

image

POP3 missing in Windows Server 2008 – FIXED

November 9th, 2009 by Jeff 1 comment »

I started to build a base today for my next SharePoint development virtual machine.    The initial requirements were simple enough and should provide a great foundation to build upon with the coming releases of Visual Studio, Office, and SharePoint 2010.

  • Windows Server 2008 R2 (What’s New)
  • AD Domain Services
  • IIS 7.5
  • SMTP
  • PowerShell 2.0
  • POP3 … hmm .. not there?!?

This led me to search Google naturally and I found one popular option:  Visendo Extender.

It seems to work pretty well and the install footprint was small enough too.   Because SMTP remains part of IIS I have access to native logging and the integration with SharePoint Incoming Email which can be handy for workflow demos.   One last thing – I personally use HOSTS file entries for loopback on VMs to avoid any network dependency.   On a laptop with a bridged adapter to the host Wireless I never know what DHCP will give me.   So I simply add 127.0.0.1 references in the HOSTS file along with DNS A records to match and make sure it always works.   Even on an airplane I can send myself an email!    Tongue out

 

image 

image

image

image

image

image

image

Sources

http://weblogs.asp.net/hpreishuber/archive/2008/04/30/visendo-smtp-pop3-extender-for-windows-2008-server.aspx

Excel fill down for easy admin scripting

November 7th, 2009 by Jeff No comments »

As an admin I use several scripting languages.    I find one common trick helpful across them all.    It’s amazingly simple and easy to adapt – Excel Fill Down.    Maybe you already use this and that’s cool.   But for those that don’t you’ll want to give it a try.

 

image

 

Simply copy/pasting output from Command Prompt, SQL Studio, or PowerShell can help build an Excel worksheet of inputs.   Simple string concatenation in Excel can build commands in bulk.   Fill down then copy/paste back to your server to execute.    I realize with SharePoint 2010 this could be a moot point considering how nicely PowerShell object collections pipe but I somehow think I’ll still be using Excel fill down to build scripts each day.

It’s a simple trick, but many of our best admin tools are the simple flexible ones we can use in many ways.

One last trick worth sharing is the drag and drop capability of Command Prompt.   File and folder paths can be long and tedious to type.   Why waste your time?    Just open Explorer side by side and drag items to Command Prompt to type them perfectly every time.  Hot

image