Tag Archives: SharePoint
[Me] = Easy Item Level Security
Ever wanted item level security in SharePoint without the headaches? It’s easier than you might think. 
Business Goal: Provide a personalized dashboard where application owners can confirm they still need the system access they have. This access review should be quick and easy, so limiting the display to only records they need would be great.
Technical Design: SharePoint custom list with a multi-person column (“team”) and view filter [Me] to display only your records. The multi-person column can hold any user in the User Information List of your site collection. If you don’t see someone’s name here you will need to first grant them permissions (i.e. Contributor) and then come back to edit. The permission grant will register their name into the site collection so you will see it in the drop down menu. Despite having multiple values the =[Me] filter works perfectly to match only records where the visitor’s name is listed. You can also use DataSheet edit mode here to fill down (or copy/paste) and update many records quickly. Generally on a project like this many records will have a common “team” of people to review.
Action Steps
- Create custom list with your columns plus a multi-person column “team”
- Grant site permissions
- Populate the list. For “team” select people who will see/edit their own records.
- Modify the default view, add filter “team=[Me]’”
- Test with a few pilot users
- Send one email with the link and everyone will see a personalized list when they visit.
NOTE: “security through obscurity” is not a best practice for highly sensitive or confidential data. If the data has a firm require to not be viewed by a third party you’ll want to implement SharePoint’s true item level security feature. http://www.codeplex.com/SPDActivities has a great action step for granting security that can help automate to create a sustainable and reliable security enforcement. (thanks to @unclepaul84)
Video Walkthrough (03:39)
How to build the sample list in full step-by-step video with a demo of the final working product.
InfoPath Current User (AND Manager) Profile. Lumbergh Remix!
Recently I needed to get the current user and their manager’s Active Directory profile to auto-populate a form. Itay Shakury wrote a great blog post titled Get the current user without writing code that covers the first need (current user) by reading UserProfileService.asmx. But I needed more.
The strategy was to use 2 data connections and query the 2nd with the manager user ID from the first. At that point you can map any document text field to be ready only and get the default value from one of these data connections.
Action Steps
- New InfoPath form in design mode
- Add 2 receive data connections to http://sharepoint2007/_vti_bin/UserProfileService.asmx
- Name them “UserProfile” and “ManagerProfile”
- Leave the input parameters empty. It will default to the current user.
- Open form Rules and add steps to “re-query” the ManagerProfile:
- Set field’s value: query subtree of ManagerProfile to “Manager” value from UserProfile data tree
- Query data connection ManagerProfile. With the filter set, it will now return different data.
- Enjoy and tell your friends.
Video Walkthrough (05:57)
How to build the sample form (above download) in full step-by-step video. Only 6 minutes! Well worth the time. 
InfoPath Current User (AND Manager) Profile. Lumbergh Remix! from Jeff Jones on Vimeo.
MMC – Monitor SharePoint in Real-Time
The Microsoft Management Console has been around for years, since Windows NT 3.5 I believe, and it is 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:
Scope: Windows Server 2003 + MOSS 2007
How did we do it?
- Start Run “mmc.exe” (this opens Author mode)
- Add Snap In (Ctrl+M)
- Click “Add” button
- Select “ActiveX Control” and click “Add”
- Select “System Monitor Control” and click “Next”
- 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!
Hide the “Powered By InfoPath” logo
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. 
C:Program FilesCommon FilesMicrosoft Sharedweb server extensions12TEMPLATELAYOUTSINCifsmain.css
Workflow History – Event Type Numbers Decoded
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 |
MOVIE – Awesome Admin Grid Scripts
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:
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.
Unable to assign this e-mail address to the list, because the address is in use – FIXED
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!
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.
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”
Extracting hyperlink destinations from Excel (Document Library item URLs)
I recently needed the destination URL for several hundred items across layers of nested folders in a giant SharePoint Document Library. Right clicking with “copy link location” just wasn’t going to work here. The datasheet view, Excel, and Access all came to mind as possible tools. In then end a quick Excel UDF (User Defined Function) helped get the job done. This is easily done against SharePoint Document Libraries because the default Title column links to the file item URL.
- Choose “Export to Spreadsheet” from your document library
- Open the .IQY file when prompted
- Press Alt+F11, then Insert > Module
- Paste in this code:
- Save the workbook. Note: You might be prompted to save as XLSM for a macro enabled workbook, change the file type, and save.
- Use the =getaddress(cell) function to see the URLs (screenshots below)
Function GetAddress(HyperlinkCell As Range)
GetAddress = Replace _
(HyperlinkCell.Hyperlinks(1).Address, "mailto:", "")
End Function
Sources Cited
http://www.ozgrid.com/VBA/HyperlinkAddress.htm
Function GetAddress(HyperlinkCell As Range)
GetAddress = Replace _
(HyperlinkCell.Hyperlinks(1).Address, "mailto:", "")
End Function











