Friday, October 05, 2012

How to start/stop Hyper-V machines with PowerShell

Being a Hyper-V fan, I try to keep all of my VM’s named and line up correctly.  The problem is that with so many versions of SharePoint, SQL, OS.  The management of those VM’s can get a bit tricky.  For instance, I have 3 SharePoint farms that I might need to run at one point or another.  The problem that I had, was that I wanted to start a farm or a set of vm’s with a single script.  Well, trying to start up all of your vm’s at once creates a problem when you try to start a SharePoint farm.

The dependencies for SharePoint is that the SQL server needs to be up and running as well as the Domain controller.  For the SQL Server to start, it needs the Domain controller to be up and running.  So somehow, you need to start the AD, wait for it to be up and running before starting the SQL, and then finally when both are running, then you can start your SharePoint server.  This sequence does not allow you to get a cup of coffee while all of the vm’s are starting.  You need to monitor the state of each server before  moving to the next one.

The workflow will be something like this:  AD –>  SQL –> SharePoint

Now, enter PowerShell.  With PowerShell, I have several scripts that will perform this workflow correctly.  If you are still running Windows Server 2008-R2 as your desktop machine (and who isn't, right?), you can download the Powershell Management Library for Hyper-V in Codeplex.  This module is necessary, even if you are running PowerShell v3.

hyperV

Here is my script to start up the VM machines.  Noticed that I’m using the HearBeatTimeOut.  This parameter waits for the OS to be up and running before the next command is executed!
Import-Module "C:\Program Files\modules\HyperV\HyperV.psd1"

start-vm "DemoAD" -HeartBeatTimeOut 300
start-vm "DemoSQL2008" -HeartBeatTimeOut 300
start-vm "DemoWFE1" -HeartBeatTimeOut 300

and the script to stop them.  It is always nice to use the reason parameter. This parameter is needed so that I don’t have to explain WHY it was shutdown when starting the VM’s.
Import-Module "C:\Program Files\modules\HyperV\HyperV.psd1"

shutdown-vm "DemoWFE1" -force -reason "end of day"
shutdown-vm "DemoSQL2008" -force -reason "end of day"
shutdown-vm "DemoAD" -force -reason "end of day"

now, where is that cup of coffee… :)

Sunday, September 30, 2012

A new chapter…

After learning the true definition of open-door policies and at-will-employment, I have decided to go back and continue to work as an independent consultant.  Since over half of my professional career have been as an independent consultant, this was a no-brainer decision.  One of the first lessons that I’ve learned was to focus on what’s important to the customer and always providing immediate value to them.

When you first start to work as independent, you need to not only know your trade, but you need to acquire skills that are beyond your comfort zone.  For instance, I quickly realized that learning all of the new tax rules and exceptions was just distracting me from learning a new technology. So I outsourced that portion of my business. It was one of the best business decisions that I’ve made!  Now I  only need to drop a list of my itemized items and receipts to my accountant.  Then a week later, I come, sign the tax forms and pay him for his work.

One thing that I always wanted to try was to see what would it take to be a sales person!  Yes, I’ve always been intrigued by this part of the consultant life-cycle.  In trying to have a deeper understanding on how a sales is generated.  I’ve set my goal to get a sales lead from any company that I have not had any references nor that I know anyone in there.  Furthermore, I’ve given myself 4 weeks to try to accomplish this.  Let’s just say, I have a whole NEW APPRECIATION at what the sales team does.  Don’t believe me?  Try to make a cold sales call ;)

Now that this experimentation phase is over, I like to announce that I have taken a full time position as a SharePoint dude for HMB.  I’ve interviewed with them a couple of years back.  But the planets had a different lineup and we did not connect. HMB is well known for being involved in the local developer community (.NET, StirTrek, VStudio 2012 Launch, etc)  They are a local company that has been in business longer that any other local consulting company I know.  I’ve personally known many of the people that work there. BTW, Sue “Johnson” is a great recruiter.  Of course, I also get the privilege to sit right next to Rick and ask him questions about how to be a YouTube video rock star …. lol.

One of the first questions that I’ve asked was: How many people has left your company(voluntarily/involuntarily) in the past year?  The answer was a number in the single digits (one hand)… Try asking this question, the next time you are in an interview ;) #Refreshing

The fusion between technology and culture is just perfect, and I’m very glad to be part of this mix. Actually, the real reason for me joining HMB, is so that I can be part of the “Deploy It Maybe” sequel…

Saturday, July 07, 2012

Session from SharePoint Saturday–Dayton

SONY DSC

It was a great honor to present my developer talk at the SharePoint Saturday in Dayton

You can find the slides and the demo code in here:  SharePoint Presentation and Demo Code

thanks to all the attendees and their questions.

Saturday, June 23, 2012

Speaking Engagements

This is your chance to get involved with a local development community.

spsdaytonbadge

come and network with some of your peers.  If you find me on the hallways, say HI. Winking smile

Saturday, March 24, 2012

One Year Anniversary

Hello world…!
It’s been quite sometime since I have posted anything to my blog.  There were lots of personal issues and family matters that took priority over my life. 
It’s been almost a year since I’ve been working for Cardinal Solutions Group (CSG). There is a saying: “..Time flies when you are having fun…”, I truly believe that this is the case.!
When I decided to take a job at CSG, I did it because I was looking for something more than just another job.  I wanted to work with  smart people who like to share their skills and knowledge with others. I wanted an opportunity where I could make a difference.
The  line between work and personal is very blurry.!  Most of the people that I’ve been working with @ CSG , are people that I would consider friends before I call them co-workers.
I would say that one of the main attractions to come work for CSG, personally, was the fact that CSG has a big professional community involvement.  I’ve known CSG guys for many years. And most of those contacts came from running into some of them at User groups, and regional conferences.
I’ve been trying to summarize my job at CSG, and honestly I can’t get enough words to describe the work in here. So to save you a 1,000 words, here is a picture…
Pura vida…!

Sunday, November 28, 2010

My SharePoint Development Environment

I have seen many blog posts on using a variety of configurations to run SharePoint 2010, MOSS, WSS, etc. Most of the solutions that I have seen, they revolved around having a hosted machine to run the development environment.

Face it, developing SharePoint solutions is not an easy task. There are so many different factors that can affect your results. The best way IMHO, to create SharePoint solutions is to have a SERVER OS Environment. Since Microsoft VM does not support creating 64bit images, you are left with either Sun’s VirtualBox or VMWare. Regardless of which of these 2 you choose, you still have to deal with the fact that you will run a hosted environment inside your machine.

One of the cool tip I got from AC (#BuckeyeSPUG meeting), was to use Windows Virtual Host. Since I am running Windows 7 x64 Ultimate, I decide to give it a try. This is my laptop configuration:

Hardware: Dell Vostro 1520, 6GB RAM, 320GB HD. OS: Win7 x64 Ultimate edition.

Step 1: Make sure your laptop supports Hardware Virtualization. You will need to enable this setting on your BIOS. If you have the Dell Vostro 1510 you are out of luck (asked me how I know… ;). A: It supports virtualization, but it is disable on the bios.. WTF..!

Step 2: You need to get a bootable image. For more information, check this article on Technet about VHD Support in Win7.

You will need to use the Windows Image to Virtual converter tool Wim2VHD. Get it from http://Code.msdn.microsoft.com/wim2vhd

Get your Win2008_R2 iso and mount it. Run the following command to extract a bootable image. In my case, the iso image is mounted on the F: drive. Also, I put all of the output inside a root folder named vhd.

  • cscript wim2vhd.wsf
    • /WIM:f:\sources\install.wim
    • /SKU:SERVERSTANDARD
    • /SIZE:51200
    • /VHD:c:\vhd\SP2010\win2k8_r2SP2010.vhd

Step 3: Now you need to get familiar with BCDEdit (Boot Configuration Data Store Editor). .

Once you have your bootable image, then you can create multiple boot configurations:

bcdedit /copy {current} /d "Win2008R2 SP2010 Base Dev"

This will return a GUID. Copy that GUID, you will need it for another step.

image

bcdedit /set {returnedGUID-in-here} device vhd="[c:]\vhd\Base2010\win2k8_r2SP2010.vhd"
bcdedit /set {returnedGUID-in-here} osdevice vhd="[c:]\vhd\Base2010\win2k8_r2SP2010.vhd"

Now when you reboot, you will see another entry in your boot menu:

image

Pros: I can run my virtualized environment with full access to 6GB of RAM and no overhead of running a host system.

image

Pros: Another benefit is that I dont have to go buy a Solid State drive to see the improved performance.

Pros: You can attach/managed any VHD using your Win7 Disk Management Console

Pros: The best part of this configuration = MULTIPLE MONITORS.... :)

Saturday, October 02, 2010

MOSS 2007 – Configure Incoming email

Reading through these 2 technet articles, you get the main idea on how to set this up

Plan incoming e-mail (Windows SharePoint Services)

and in here

Configure incoming e-mail settings (Windows SharePoint Services)

In Windows Server 2008 R2,  there are some steps that are different from the technet articles.  My environment is as follow:

image

First is to add the SMTP server feature.  Open Server Manager, add features, and select the SMTP Server

image

once you click on this, it will bring another dialog box, prompting you to add more role services

image

It seems that it requires the SMTP Server Tools from the Remote Server Administration Role, and also the ODBC Logging.

click Add required button and continue. Now click on the Next button on the features wizard.

On the confirmation screen you can verify these 2 new roles

image

Click install.

After the installation, Open IIS 7, and under the Features View, double-click SMTP Email.

image

Click on Apply.

Now go back to MOSS Central Administration and click on the Incoming e-mail settings task for the Administrator

image

On the item,  task, select the Action: Configure Incoming E-Mail Settings.

image 

After you have configure the incoming email you can now receive emails on our SharePoint document libraries. Now you can follow the instructions on this article to get those emails inside your document library enable/configured email article.