belle’s sql musings

SQL Server-Related Cheat Sheets That Can Save You Time

Posted in DBA Toolbox / T-SQL Scripts, Powershell by belle on October 17, 2008

I previously posted about a SQL Server CheatSheet from DotNet4All that I thought was useful and comprehensive. If you already know what you need to do, but just forgot the syntax because you haven’t done it in eons, then  a well organized, concise, complete cheat sheet can save the day.

 

Here are a few other ones:

General SQL Server
DotNet4All

SQLAuthority
Scribd T-SQL

 

SQL Server Shortcuts
SQLArticles (really good, exhaustive list!)
SQLAuthority SSMS Shortcuts

 

Connection Strings
ConnectionStrings.com

 

Regex (especially when you’re working with SQLCLR/Regex)
.NET Regex Cheat Sheet
AddedBytes
(AddedBytes used to be known as ILoveJackDaniels, but that name has changed. Dave has a *lot* of useful cheat sheets in his site.)

 

SQL Injection
Ferruh Mavituna
ha.ckers

 

PowerShell
MSDN Blogs (PDF)
MSDN Blogs (MS Word)

 

SQL Server 2008
SQLAuthority

 

SQL Server DBA Interview Questions
SQLAuthority Interview Questions – Complete List

Tagged with: ,

LoadWithPartialName Deprecated

Posted in Powershell, SharePoint by belle on December 12, 2007

Apparently LoadWithPartialName is deprecated in v3
#replace this
#[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")

#in WSS/v3, this should be
[System.Reflection.Assembly]::Load("Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c")

#in MOSS/v3, this should be
[System.Reflection.Assembly]::Load("Microsoft.SharePoint.Portal, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c")

Have to say though, I’m loving Powershell.

Found another couple good Powershell/Sharepoint blogs:

Colin Byrne’s Adventures in SP Wonderland (http://blogs.flexnetconsult.co.uk/colinbyrne)
Darrin Bishop’s Blog (http://darrinbishop.com/blog/category/1.aspx)

Darrin has a cool demo code that:

  • Installs a feature
  • Creates sub sites from a configuration file
  • Adds the feature to the sub sites
    Finds the sub sites with the feature
  • Removes the feature from the sub site
  • Deletes the sites
  • Uninstalls the feature.

Getting Acquainted with Powershell

Posted in Powershell by belle on December 10, 2007

Had a question today:
Can the users from a specific AD group be imported into a contact list in Sharepoint

I looked around, and asked around, and there is no “out-of-the-box” way of doing this. They could potentially:
1. Enter the information manually, if there are only a few users
2. Export from AD and import to the Sharepoint list (or copy over using the DataSheet view)
3. Use C#/.NET to programmatically query AD and import the values to Sharepoint

.. or ..

perhaps Powershell can do it?

I am on a quest to take this challenge on, just for the heck of discovering how easy or hard this is.

My Sharepoint/Powershell crash course starts with the following links:

Windows Powershell Owner’s Manual – very good from-the-ground-up documentation from Microsoft.
Windows Powershell Graphical Help File – doesn’t hurt to have the chm documentation handy, with colors and pictures and all
Powershell Quick Reference – 2 page must have cheat sheet
Hey Scripting Guy! – just visit it, you’ll see what I mean
Jessie Hamrick’s PowershellPro! – very well organized, well laid out site that gets you started on Powershell right away
Marc van Orsouw’s The Powershell Guy – lots of good Powershell tidbits
Karine Bosch’s Powershell for Beginners – especially useful because of her tidbits on using Powershell with Sharepoint Lists

So I will be doing a bit of reading, and hoping I can do some experiments later… and discover if Sharepoint and Powershell will work together, or wreak havoc together. I have to say my optimistic side is prevailing right now.

First Look at PowerShell

Posted in DevConnections 2007, Powershell by belle on November 12, 2007

I attended Gert Drapers’ session on PowerShell for SQL Server. I used to be a Linux sys admin – where everything I did involved either Perl or Bash scripting – so the idea of PowerShell piqued my interest.

Apparently PowerShell is built on top of .NET objects, and will come as a standard tool in Windows Server 2008. Something to look forward to… (btw, Windows Server 2008 and IIS 7.0 looked pretty kewl. They demonstrated how to add a WFE to a farm, and it took a few minutes to do so. Yeah, yeah. Might be too good to be true.. We’ll see when it gets out.

Download PowerShell here:
http://www.microsoft.com/windowsserver2003/technologies/management/powershell/download.mspx

Good PowerShell Book: Windows PowerShell in Action by Bruce Payette

And here’s to blogging more PowerShell Tips and Tricks for SQL Server and Sharepoint! (Kampai!)

Update:
Neil Iversen posted his Powershell for Sharepoint files at: http://www.justaddcode.com/blog/2007/11/12/devconnections-powershell-for-sharepoint-developers/