Thursday, February 24, 2011

Windows Update–How to stop being annoyed #TipOfTheDay

We all have been there before, whether you are in the middle of working on your laptop/desktop or logged into a Remote Desktop session, that pesky Windows Update appears.  No matter what you do, you can’t get rid of how annoying that restart box is. 

imageBeyond that, if you click postpone, it’s just going to prompt you later on.  Hey Microsoft: 4 hours isn’t long enough for me!  On top of all of that, the Restart Now button is locked an loaded.  If, and I say if meaning “When”, you click on it, you are done.  Gone goes the tabs of research, the document that wasn’t saved, the sweet blog post; the list goes on and on.  Yes, there are measures built into Win7 and Vista to stop accidental reboots, however, it’s extremely inconvenient, and on XP non-existent.  At my prior job, we used Remote Desktop Services heavily and this was a constant gripe from my users.  I tried to do updates on the weekends, but being a 1 man shop, I like having a life Smile.  Here’s my solution. STOP CLICKING POSTPONE!  That’s right, treat it like any other window you don’t have time for.  Drag that bugger off the screen and leave it there until you, YOU, yes YOU, want to restart.

image

Doing this you get rid of two major annoyances of mine.  First, there isn’t a nuke button popping up on your screen.  Second, it’s completely out of sight and out of mind.  Windows Update, I WILL REBOOT WHEN I FEEL LIKE ITHow do you like them apples?

Update:  After doing some digging, I figured these settings could be controlled via Group Policy.  If you open gpedit.msc, the settings sure enough are there:

GPO - DisableAutoReboot

Like I said before, Home versions of Windows do not have this capability, so what to do?  Regedit!  Apply these regedits and you, yes YOU, can disable the nuclear time bomb yourself.  Make sure you know what you are doing within the registry before you start editing.  I cannot assume any responsibility and will offer no help if you nuke your PC doing so.

DisableAutoReboot

 

Tuesday, February 15, 2011

Redirect calendar view Web Parts to any date and any view

This only works for WSS 3.0 and MOSS 2007.  2010 works completely different.

There was an interesting email I received in my inbox the other day.  It came from @KerriAbraham and said: How can I display next week on a weekly calendar view?  I must be missing something obvious.

With an email like this, I always refer that person to a forum.  If it’s worth asking, then it’s worth sharing…  Here’s a link to the post: http://endusersharepoint.com/STP/viewtopic.php?f=10&t=2835

Looking at an OOTB calendar view, I noticed when changing the dates and views from day, week, and month; the URL updated with new query strings.  These query strings are CalendarPeriod & CalendarDate.

CalendarPeriod

This parameter (query string) accepts 3 different values.  Each of these are valid and produce different views for the calendar.

  1. CalendarPeriod=day
  2. CalendarPeriod=week
  3. CalendarPeriod=month

When this parameter is set, the calendar will automatically update to day, week, or month.

CalendarDate

This parameter works a little different, but still follows a consistent pattern.  This parameter accepts a date. (I’m captain obvious, I know…)  The format of the date should be:

M/DD/YYYY

Since we can’t literally put “/” in a parameter and expect it to work, we need to encode those values.  With that in mind “/” turns into “%2F”.  So our parameter’s value really looks like this:

2%2F15%2F2011

URL with parameters set

Now let’s look at what the URL actually will look like if we wanted to do a view based on the week and the day of Feb. 20, 2011.

CalendarQueryString

You are probably thinking right now…  I knew all of this stuff, did I really just waste 2 minutes reading this post?  Absolutely not… You need to know all of this stuff and a reiteration of the basics will help you understand the script below. 

RedirectCalendar.js

This script is based off of Christophe Humbert’s redirect script in the SharePoint User’s Toolkit.  There are lots of excellent scripts stored here that will change how you use SharePoint.  Also, this post is a great example of it, do not take solutions you find on the internet for face value.  With that in mind, let’s get on with it…

URL="http://URL/Calendar/WebPartPage.aspx",redirectDay=5,popup="You will be redirected automatically.";
var d=new Date();
var currDay = d.getDay();
var currMonth = d.getMonth();
var currYear = d.getFullYear();
currMonth++;
// Calculate day to redirect to
var redirectToDay = d.getDate() + 7;

/*
Sets query string for redirect.
To redirect to Month view; Change CalendarPeriod to month.
*** ?CalendarPeriod=month ***
To redirect to Day view; Change CalendarPeriod to equal
*** ?CalendarPeriod=day ***
*/
qString = "?CalendarPeriod=week&CalendarDate="+currMonth+"%2F"+redirectToDay+"%2F"+ currYear;

function Redirect() {
// Look for existing query strings. If found, do nothing.
if (window.location.href.indexOf("?CalendarPeriod") >= 0 || window.location.href.indexOf("&CalendarDate") >= 0) {
return false;
} else {
if ((!(currDay == redirectDay))) {
return false;
} else {
if (popup) { alert(popup); }
window.location.href=URL+qString;
}
}
}
Redirect();


This script allows you to set your variables without much trouble.  The variables that you should be concerned with are:




  • URL


  • redirectDay


  • popup


  • redirectToDay



The URL needs to be set to the page where your calendar view exists.



CalendarCurrentURL



The redirectDay is used for what day you’d like for the redirect to occur.  Sunday = 0; Saturday = 6.  This script is locked and loaded for Friday.



popup is used for alerting the user redirection is about to happen.  If you don’t like this, then set popup=””.  That will make popup equal false under the hood and not bug you.



The last variable is redirectToDay.  If you look at the code, you’ll notice this variable is being set based off of the current date.  Kerri wanted to add 7 days to the redirect on Friday.  That’s why you see:



var redirectToDay = d.getDate() + 7;


Feel free to add however many days you’d like to this date.  After you’ve changed all of your variables, you’ll notice when you visit this page on the day you’ve configured, the redirect will automatically happen.  Hope you like…

Thursday, February 10, 2011

In response to: Complex CAML Queries made simple

I spotted this post in my twitter feed and felt it justified a repost.  Here’s the link to the article:

http://www.allaboutmoss.com/index.php/2011/02/11/complex-caml-queries-made-simple/

As you can see, this is using nothing but managed code.  Since I live on the front-end side of the house, I tend to get around most of these managed code solutions by using codeplex.  I’ve found a fantastic tool and in my opinion is better that U2U.  The instructions are very simple.  They actually are the same as the post above, except you are creating the view within the GUI.

image

After creating my view, I snap open Stramit CAML Viewer.  I am then able to view all of my lists for the site.  After selecting the list I need, all of the views appear for those lists. 

image

Now all you have to do is copy this CAML out and paste it wherever you may need it.  Not bad, eh?

Technorati Tags: ,,,

Friday, February 4, 2011

A look inside the USPJ Academy

Well first off, it’s only $497.00/mo.  If you add that up compared to other training, it sells itself, as far as training goes.  The last paid training I attended, I spent $4500 total – hotel, airfare, courses, meals, mileage… The whole 9.  If I divide that $4500 by $497, well you know where I’m going with that.  Most of the courses are 6 weeks, some are 5.  Some courses are easier than others, some actually make you do your research, and when you think you have the answers, you have to dig deeper.  This is my 3rd time in the DVWP course and would take it again in a heartbeat.  The jQuery course was good, but I need to take it again b/c my skills were completely beginner when I took it.  As a student, you have the option of taking up to 3 courses simultaneously.  This is great for students that want to learn as fast as possible.

 

The USPJA has many features…

Once you look at the costs, it should push you to do it, but if that’s not enough:

USPJA Library

Chocked full of downloadable resources, videos, books, how to’s…  The library has complete books on it’s shelves.  These books will be compatible with your mobile devices as well.  If you ever feel the need to open a SharePoint book on your Kindle, the USPJA has you covered.

Labs

At any given moment, students can login to the Academy and fire up a virtual machine of their choice.  That’s right!  Do you need to test some obscure setting that you would never attempt on your farm?  Feel free to use the labs to try that out.  There’s an option to make your lab persistent or you can reset it back to the original image after you are finished with it.  All of these labs are in the cloud via Amazon (24x7 availability!). 

Classes

The instructor of the class is paid to answer your q’s.  So, as long as it’s not too far off the wall, your questions will be answered by someone who’s been there, done that.  The current lineup, in my opinion, is the Dream Team of SharePoint:

  • Bjorn Furuknap
  • Marc D. Anderson
  • Ayman El-Hattab
  • Christina Wheeler
  • Mike Watson
  • Laura Docherty
  • John Keadle
  • Sahil Malik

There are courses for Administrators, Developers, and Business Users.  Plenty enough to wet your palate.  Current running courses include:

  • Data View Web Part Basics
  • Developing SharePoint Content Types
  • Beginning SharePoint 2010 Administration
Forums

The USPJA boasts forums that directly email all of the instructors above.  Each and every one of these experts, read your post(s), and give you advice on how to tackle the situation.  It’s always nice to know help is only a few clicks away.

USPJA opens doors…

If you have followed my writings, then you may know already; I’ve taken a position with Juniper-Strategy.  There would have been no way for me to have that opportunity if I didn’t attend the USPJA.  I’ve been able to learn at such an accelerated rate because all of the instructors are available to me.  I’m able to easily bounce ideas off of them and get top notch feedback.  I’m very grateful to be a part of the Academy and look forward to meeting any new students that may come along.

If you still have reservations, maybe Bjorn could set up a tour for you.