Wednesday, February 29, 2012

How to Logout Remote Desktop Users

If you frequently encouter issues in which multiple developers like to "camp-out" in your development environments (i.e. they simply close their remote desktop sessions as opposed to logging out), here are some simple steps you can use to free up those idle sessions:
  1. Click Start -> Run...
  2. Type in "mstsc /admin"
  3. Click OK
  4. When the Remote Desktop Connection dialog appears, enter the server name or IP of the server you wish to log onto in the Computer textbox/dropdown
  5. Log on to server
Now that you're in, you can see exactly who is tieing up the resources as well as how long they've been idle via the following steps:
  1. Open a command prompt
  2. Type "quser" and hit Enter to obtain a list displayed as follows:
The best option for freeing up one of those sessions is to talk to the individuals and have one or both of them logout out their sessions themselves (i.e. you never know, they might actually have some important work in progress!); however, if you absolutely need to free up a session, you can do so via the following steps:
  
  1. Open a command prompt
  2. Type "loggoff sessionID" (i.e. "logoff 1" if I wanted to give rsufit the boot since he's been hogging a session for the past 10 days) and hit Enter
You're now free to logout of your Admin session and log into the Remote Desktop session as you normally would.

Tuesday, February 28, 2012

SQL Transaction Template

Here is a transaction template that could come in handy any time you need to link a couple of related SQL operations together:

BEGIN TRANSACTION
BEGIN TRY

 --Add related SQL operations here

 IF @@TRANCOUNT > 0
  COMMIT TRANSACTION

END TRY
BEGIN CATCH
 SELECT ERROR_MESSAGE() AS ErrorMessage;
 IF @@TRANCOUNT > 0
  ROLLBACK TRANSACTION;
END CATCH

Friday, February 24, 2012

Overview of leveraging Word Services in SharePoint 2010

I found a nice overview of leveraging Word Services in SharePoint 2010 for automated document creation/conversion processes and thought I'd share. I can already envision at least 50 things I'd like to use this for. Perhaps it will inspire you as well!

http://msdn.microsoft.com/en-us/Office2010DeveloperTrainingCourse_DevelopingWithWordServices