March 2011 Archives

Here’s one I just ran across.

If you have a GPO that enforces the password Age so it cannot be changed very often (IE:  Password must be at least 48 hours before you’re allowed to change it as an example) and don’t realize it there you can be banging you head against the wall

*HUH?!*

Yeah this threw me for a loop.  I was banging my head against the wall on this until I realized everything was working fine unless we tried to change our passwords more than once every two days (not a typical thing)

But the stupid thing was that error.

“Unable to update the password.  The value provided for the new password does not meet the length, complexity or history requirements of the domain.”

Each and every time I kept glancing and saying “It’s a new password, it’s stupid complexity, it’s 500 letters long…”

Never dawned on me about a Password MINIMUM age.

So if you find you get that error, don’t forget to check for password MINIMUM age as well.

“Grumble grumble grumble….”

Sean
The Energized Tech

powershell

One of things you encounter when you start doing repeat presentations is the need to have your environment in a Consistent and Ready state every time.

We all know the rules after a while.  Don’t change your demo box.  Avoid altering your environment in any way prior to the demo.   Avoid Murphy’s law.

Well here’s something to help you out.   I wrote a simple Powershell script to fire up the Demo machines in a times manner, Get my Powerpoint on the screen and even start the Connections to “remotely view” the Virtual machines in Hyper-V.

First off, you need to goto http://pshyperv.codeplex.com/ and download the HyperV modules for Powershell.  If you’re running SCVMM you can use the modules from it if you choose, but not all of us are running a fully licensed copy of SCVMM on our Demo Hyper-V box Smile

Once the Hyper-V module is downloaded and installed things get a lot easier on your HyperV demo box.

So our first script is going

  • Launch Powerpoint with our provided Presentation
  • Start VMCONNECT.EXE and connect us up to our Child Partitions in Hyper-V
  • Start up one demo machine
  • Sleep
  • Start up the next demo machine

So why would I want a delay?  How about dependences?   The Domain Controller?  An SQL Server?   The point is you typically do start up your Demo environment in a particular order.

First off once you execute an

IMPORT-MODULE HYPERV

Execute a

GET-VM

and get the names of the Virtual Machines.  Once you have them, the rest of this is easy.

-------------- START-DEMOENV.PS1 ------------------------

# Import HyperV Management Modules from Codeplex
import-module hyperv

# Specify name of Powerpoint Presentation

$PPT='c:\users\Administrator\Desktop\MyPowerpoint.pptx'

# Launch Powerpoint 2010 (32bit version)
# Just edit the Path and filename if you’re running a 64bit version instead or
# Previous version of Microsoft Office

& 'C:\Program Files (x86)\Microsoft Office\Office14\POWERPNT.EXE' $PPT

# Launch VMConnect.exe connecting to the computer ‘localhost’
# and Virtual Machine called ‘HYPERV-DC1’ and the Virtual Machine called
# HYPERV-CLIENT

& 'c:\Program Files\Hyper-V\vmconnect.exe' localhost HYPERV-DC1
& 'c:\Program Files\Hyper-V\vmconnect.exe' localhost HYPERV-CLIENT

# Start the Child partition in Hyper-V called HYPERV-DC1
Start-VM "HYPERV-DC1"

# Sleep for 3 minutes (180 seconds) before starting up the client machines or those
# Dependant on your Demo Active Directory

Start-Sleep -Seconds 180

# Start the next machine (or machines) depedant on the Demo Active Directory
# environment.  this computer is called “HYPERV-CLIENT”

Start-VM “HYPERV-CLIENT"

-------------- START-DEMOENV.PS1 ------------------------

Now to have this script launchable from the desktop, you just need to create a shortcut pointing to the script and with the execution policy set

C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -file C:\Users\Administrator\Desktop\Start-DemoEnv.PS1 -executionpolicy 'RemoteSigned'

 

The other script I have you may find handy is the one to undo all of this.   For each of these machines I have a single Snapshot created (always a good idea in a demo setup) to allow myself to rollback to a previous state.  So our next script will

  • Rollback to the original snapshot state of each of these machines.  The states are programmed originally to NOT startup automatically
  • Kill the Powerpoint presentation
  • Kill the Remote connections to the Child partitions in HyperV

 

-------------- END-DEMOENV.PS1 ------------------------

# Import HyperV Management Modules from Codeplex

Import-module HyperV

# Get Child Partition “HYPERV-DC1”, pull the Snapshot and Force a Restore

GET-VM "HYPERV-DC1" | Get-VMSnapshot | Restore-VMSnapshot –force

# Get Child Partition “HYPERV-CLIENT”, pull the Snapshot and Force a Restore

GET-VM "HYPERV-CLIENT" | Get-VMSnapshot | Restore-VMSnapshot –force

# GET VMCONNECT and POWERPNT – Shut them down

GET-PROCESS VMCONNECT | STOP-PROCESS
GET-PROCESS POWERPNT | STOP-PROCESS

-------------- END-DEMOENV.PS1 ------------------------

Like the previous script, we want a way to launch this with the execution policy set.

C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -file C:\Users\Administrator\Desktop\End-DemoEnv.PS1 -executionpolicy 'RemoteSigned'

 

You of course may not have your scripts under the “Administrator” folder on the Desktop or be called END-DEMOENV.PS1 but that’s something you can always choose Smile

The nice part I like is the ability to have some consistency when start up just before you present to an audience.   The neater part is to notice something else.  Powershell launched standard executables in that run.

The Power of Shell is in YOU

Sean
The Energized Tech

A good friend of mine from Quest, Dmitris cornered me with a video camera and decided to interview me

I apologize for my hoarse voice.  Apparently another good friend (who shall be named to protect his innocense) decided I should be a one man cheering squad for all the Canadian MVP’s.

No.  There is unfortunately NO video of that…. to my knowledge…

That’s right.

Sean went stupid or got really inspired (I’ll opt for really inspired)

I’m going to climb the CN Tower.  I’m going to try and do it.   In doing so I will surmount a goal for no other reason.

All funds go to the WWF (World Wildlife Federation, NOT… I repeat NOT the World Wrestling Federation)

And you can help.

Either chip in because

  • You want to change tomorrow
  • You need to burn some cash
  • You want to help a fat guy climb 4,000 plus steps
  • or you think Watching Sean faint at the sight of the CN Tower would be funny
  • or you just think I CAN’T DO IT

I intend to prove everybody wrong.  I intend to change your day, my day and my kids day

Oh heck, I intend to prove that the CN Tower is just a big concrete stick in the ground with Lousy Radio reception.

Donate here and help it all happen.  Smile 

Because you can, Because I will try.

JUST CUZ!

Click away and send what you can.  I’m going to do this anyhow, but you can help in the process and change tomorrow

Caught this one in Twitter today.  A fellow needed to know of a way to list the status of all the tapes on all his DPM Servers.

It makes sense.  You need to easily report on what tapes can be pulled, where the data is, which ones are expired.

I’m also not going to be done in just one posting.  There’s a lot here but I’ll list the important Cmdlets that pull the data.  The rest is a matter of Scripting it into a report

Our first task is pull all the Tape libraries together.  That’s done by using a

GET-DPMLibrary –DPMServerName ‘NameOfADPMServer’

You can then pipe that list of tape  libraries into

GET-TAPE

which will actually pull a list of all the tapes out for you as well.  Now for the tricky part.  Finding what’s on the tapes.   You have to pipe THAT into a

GET-RECOVERYPOINT

So a simple one liner will dump all the recovery points on TAPE like so

GET-DPMLibrary –DPMServerName ‘NameOfADPMServer’ | GET-TAPE | GET-RECOVERYPOINT

Ok neat, that worked.   But it’s not very useful is it?   I mean we need to know what TAPE each point is on and it would be a great thing to know which server has that tape.   Be even BETTER if we knew the library.

Well that’s doable.   We just script it.   Instead of just piping in and pooping out what we say (*sorry, I couldn’t resist…. no wait… yes I could…*) We could pull out the blocks of information and break them down.

So first …. let’s store away that list of libraries

$TAPELIBRARIES=GET-DPMLibrary –DPMServerName ‘NameOfADPMServer’

Now we can loop through each library and EXAMINE the tapes and show the contents

Foreach ($TAPELibrary in $TAPELIBRARIES) {

$TAPELIST=$TAPELibrary | GET-TAPE

Then we’ll step through the tapes and show their contents

Foreach ( $TAPE in $TAPELIST ) {

$RP=$TAPE | GET-RECOVERYPOINT

Then you step through each Recovery point for individual details

Foreach ($point in $RP) {

So how is this any better?   At this point you now have data that you can’t easily pull out of the pipe.  As you “PIPE” information into each Cmdlet, each Cmdlet is only going to pass along information IT is supposed to produce. So in writing a script we can now pull out specific information and build a report from it.  Or simply build it into CSV file.  There is certain Key useful information from each part we could use for a report.

 

From $TAPELibraries

UserFriendlyName – Nice name give to describe a particular tape unit

MachineName - We should be able to say which server any of these tapes and drives are on

 

From $TAPELlist

Barcode – for Easy Identification when removing from a Library

CreationDate – Good to know how old it is

DatasetState – Current or ready for Recycling?

DataWrittenDisplayString – How much is sitting on that tape?  How many Gigs/Megs?

IsOffsiteReady – Can we send this for offsite storage?

Location – What slot is the tape sitting it?

 

From $RP (our Recovery Points)

UserFriendlyName – Very descriptive name of what is on there

Size – How many Bytes is that sucker eating up

 

So what can we do with this?  Build a simple onscreen report like so.   Get the data from each line and spit out to the console (Hey, It’s late and I wanna go home, so you can play with it your own way) Winking smile

$TAPELIBRARIES=GET-DPMLibrary –DPMServerName ‘NameOfADPMServer’

$FILENAME=’C:\Powershell\DPMTapes.csv’

NEW-ITEM –path $FILENAME –itemtype File –force

$HEADER=’TapeLibrary,ComputerName,TapeLocation,TapeState,Barcode,CreationDate,RecoveryPointName,Size’

ADD-CONTENT –path $FILENAME –value $HEADER

Foreach ($TAPELibrary in $TAPELIBRARIES) {

     $TLUFN=$TAPELibrary.UserFriendlyName
     $TLMN=$TAPELibrary.Machinename

     $TAPELIST=$TAPELibrary | GET-TAPE

         Foreach ( $TAPE in $TAPELIST ) {

         $TapeLocation=$Tape.Location
         $TapeState=$Tape.DataSetState
         $TapeBarcode=$Tape.Barcode
         $TapeDate=$Tape.CreationDate

              $RP=$TAPE | GET-RECOVERYPOINT

              Foreach ($point in $RP) {

               $RPUFN=$Point.UserFriendlyName
               $RPSize=$Point.Size

                $OUTPUT=$TLUFN+’,’+$TLMN+’,’+$Tapelocation+’,’+$TapeState+’,’+$TapeBarcode+’,’+$Tapedate+’,’+$RPUFN+’,’+$RPSize

                ADD-CONTENT –path $FILENAME –value $OUTPUT

                }

       }

}

Yes…. I agree the script is horribly written and even worse for formatting Smile Yes we should have filtered too and made it nicer.

But now that you have this, you can tweak it away.  Add your own information.  Since it’s a CSV file, this can be played with in Excel, or just use a SEND-MAILMESSAGE after mining.

The Power is yours and the Power of Shell is in YOU

Sean
the Energized Tech

Anybody who knows me knows I love automation.   I love it because as an ITPRO managing users there are just some things that can’t be automated no matter how hard you try.  

You’ll still be explaining nine time throughout the day to John in Account what a complex password is and just why he has locked himself out for the eleventh time today.   No matter what you do, certain users will never get the hang of typing in their own name correctly.

So anything we CAN automate helps us control those little battles with a little more grace.

Which is why I love MDT 2010 (Microsoft Deployment Tookit).   It’s a free download from Microsoft that allows you to (with minimal effort) generate a deployment point for Windows 7 and your applications on DVD,USB or even just a Network share.    This same deployment point can easily be tied into WDS (Windows Deployment Services) or SCCM (Systems Center Configuration Manager)

But enough of the marketing hooplah.   Over this next series of posts, I ‘m going to try and show you how to change that LTI (Light Touch Install) to a NEAR ZTI (Zero Touch Install).

I say “NEAR” because as I have been told by Deployment Masters, friends from Microsoft and various well meaning entities that a “TRUE” ZTI means you sit at a console and have a script, SCCM, programming or Ingabar the little Deployment Alien just magically run it from one spot.

FACT.  I don’t CARE about the details and the wording.  

This technique will give you a Deployment point on USB or DVD that will allow you to boot from it, walk away, and end up with an install that will do ALL the work for you.   This is a technique you can leverage whether you are a Small Business field technician, Mid sized tech or IT Department or the Enterprise.     So if I’m still figuring out Altiris or SCCM or my Deployment system?  I can still have an install SO automated a brain Dead Monkey (or even a user) could deploy Windows 7 and all the applications WITHOUT messing it up.

Is that “ZTI” enough for you?

So enough of Sean yammering away.  Let’s get at it.   We’re going to presume with this series you’ve at least used MDT and make what I think of as a basic LTI (Light Touch Install).  That your current deployment can

  • Install the Operating System with the basic prompts for
    • Computername
    • TimeZone
    • Domain / Workgroup
    • Image Capture
    • Backup
  • That it will prompt you for a list of applications
  • That you have some Service Packs and updates
  • That you have drivers for your hardware injected
  • That you have at least a Task Sequence

With these in place we’re going to show you how to SKIP those screens (ALL OF THEM) and have the answers pre-populated so that you can walk about with this on a USB key and just “Boot and install”.

Oh did I mention the cost of this technology again?  Free.

Now that we’ve laid out the groundwork, stay tuned for more details.

dr_scripto_2011_Soul 50

“…Sweat pours from your brow, your muscles tighten as you hammer away the Cmdlets into the Windows Powershell console.   A bead drips onto the keyboard revealing the smell of Ozone in the air. That last line poured out of your soul onto the page, and it felt so right.  One more task automated.  The systems bow down to the scripter…”

Is this you?  Are you an ITPro with that rare untouched gift?  Automation?  Scripting?

How about a chance to put those skills to the test and an opportunity to Script real world scenarios to test your mettle, improving your skills at the same time!  A rare chance to pit yourself against the best and build upon yourself at the same time!

The 2011 Scripting Games are for Novices and Enthusiasts to with an opportunity for Fame and Prizes as well as EXPERIENCE in scripting against REAL Scenarios!

THAT is what the 2011 Scripting Games are offering for FREE and they’re coming your way.  

The Excitement starts April 4th 2011 and continues on through to April 15th 2011.   TEN (10) Events with both options for Beginners and Scripting Guru alike to pit their skills in Windows Powershell, it’s a rare chance to improve while improvising and have your code reviewed by a panel of judges comprised of Windows Powershell Celebrities and Experts!

How can you lose? 

You CAN’T!  Not only will your name possibly be in lights, but this is a chance to get critique on your scripting by Internationally recognized Windows Powershell experts and MVP’s as well as Daily Chances at Prizes!

So why not give it a shot?  This could be YOUR chance to shine!  Why not take the chance?  You have nothing to lose and EVERYTHING to gain!

The 2011 Scripting Games are no small event either.  Last year THOUSANDS of Scripts were launched and submitted from HUNDREDS of countries across the planet from people JUST LIKE YOU!   Which has got to be the coolest part.  Competing with people just like yourself!  

So a chance to Grow and LEARN for FREE? Have Powershell Masters review your scripts?  Really? FREE?

YES!  Spectators and Competitors pour on in to the Scripting Games and benefit each and every year benefiting from the camaraderie as well as the INTENSE competition!

Interested?

You too can participate!  Don’t fear on whether you’re a specialist or an enthusiast.  The 2011 Scripting Games are for everybody! It’s all about learning Powershell and having some fun at the same time…. And perhaps a chance to rub your friend’s nose in it if you one up them! Winking smile

Need more information? Head directly here for all the information you’ll ever need or watch POSHCODE and “Hey Scripting Guy” for more details!

Curious what the games were like?  Information from the Scripting Games from 2010 and Scripting Games from 2009 are still online for you to review! 

Except one difference.  The future is here with 100% Fresh Pure poured Windows Powershell!

So what are you waiting for?

The 2011 Scripting Games are calling you!  STEP up and seize the day! 

It’s yours to have Mighty Scripter!

A Message from “Hey Scripting Guy” and Dr. Scripto

dr_scripto_2011_Soul 50

The 2011 Scripting Games begin on April 4, 2011 and run through April 15, 2011. What is the Scripting Games, you may ask? Well simply put, the Scripting Games are the premier learning event of the year for IT Pro’s and others who wish to master Windows PowerShell. Comprising 10 events, a registered contestant has seven days to create a solution to a scenario driven problem and post their code to a MVP maintained script repository for evaluation by a panel of internationally recognized judges. Daily leaderboards and prize drawings help to maintain the suspense throughout the two-week international event.

During the 2011 Scripting Games hundreds of contestants will submit thousands of scripts that will be reviewed by dozens of judges. Hundreds of thousands of spectators from all around the world will view the games themselves. Last year, participants from more than 100 countries participated in the Scripting Games. With an emphasis on real world scripting scenarios and problems, the scripts will be of immediate value to both the participants and to the spectators.

Preparation for the 2011 Scripting Games is already underway, with a learning guide, step-by-step tutorials, videos and other resources being generated on a daily basis. The 2011 Scripting Games all in one page is the portal for the games themselves. The 2010 Scripting Games all in one page is still available, as are the events from the 2009 Scripting Games.

Action: Grab the 2011 Scripting Games badge and display it on your blog to show your support for the games.

ed wilson

Microsoft Scripting Guy

http://technet.microsoft.com/en-us/scriptcenter/default.aspx

Follow me on Twitter: http://twitter.com/scriptingGuys

My journey is continuing onwards and inwards.   For a moment I’ve stopped.  Stopped at a place on the Redmond Campus to just sit down and drink in the atmosphere.   Somehow absorb the wonder and the beauty of the people and the vision that is Microsoft.

Sit to dream.

People may wonder why I feel this way.    It is truly because I have stood and seen people who want to spent their day changing the world.

And so I sit now, in a single common area surrounded by people of all ages, passionate about what they do.  Passionate about changing the world for the better.

I’m certain, they, the many workers at Microsoft have their bad days (like any company) but as a single collective they are working as one to change the world and better themselves.

Not just technology, the world.  Each of them in their own way is standing forward and, like the Borg, contributing their uniqueness to the collective.

But unlike the Borg, they are not monotonous drones, they are living breathing people pulsing with ideas, churning together and forming often into concepts not a single one could ever have fully envisioned.   People giving of their own time to charity.   People trying to find a better work to co-exist with our environment.

They are people I have looked up to for years.

Microsoft is far more than just another computer software company.  It is far more than anything Bill Gates or Paul Allen envisioned.   It is even more than the raw passion of it’s leader Steve Ballmer.

Microsoft is a road to the future.   It is a place full of people of varying backgrounds worldwide working together as one.   Redmond Washington is the central point.

And so I sit here amongst the walls, the vision, the people, the dreams floating amongst the Azure sky overhead.   Drinking in that inspiration.

Four years ago I looked up at people I called “the computer gods” and dared speak….
….only to find out I had found long lost friends….

 

Cheers as I wander about this road a bit more and have a coffee.   A tip of my hat to Bill Gates, Paul Allen and Steve Ballmer.  I am so glad you guys took that chance all those years ago.

and from a former “Friday Funny Guy” who sought his dreams to you

Release your passions and change the day, you can.

Sean
The Energized Tech
Continuing onwards to My Long Road to Redmond….

The day is just coming to an end here.  I have barely scraped the surface but I can say this much.   It was an interesting day of networking.   Meeting contacts both new and old.  Sitting down with a friend from across the water and just chatting for two hours.

But I did skip over the most mind blowing bit.

I stepped onto the campus (or least a small piece) and entered a simple building.  The realization of where I was finally hit me.  I was standing inside the Head Office of Microsoft.

I turned about and had to just touch the very word “Microsoft” on the wall.  I almost broke down in tears.  Yes tears of joy.

Am I being silly?  Maybe to you I am.  But for me I suddenly realized part of my dream was coming true.   Somewhere in the back of my mind was a little voice saying “If you got this far, doesn’t that suggest the whole dream MIGHT actually come true?”

Whether that part does happen isn’t relevant.   I set a goal, I dreamed of that goal (Yes I mean falling asleep I actually DREAMT of that day) and actually saw a piece of it come real.

Emotion overtook me.  I did not drop down and embarrass anybody or Microsoft, but I did almost break down and cry.  It meant THAT much to me, to have gotten this far.  To realize EFFORT does REWARD. :)

Then later in the day to meet other friends and just start chatting and have ideas pop into your head, to feel your synapses popping about.   It was a long and wonderful day.

Tomorrow is my Birthday.   I get to spend my birthday getting inspiration in Redmond.   *sigh*

What a Cool Birthday present Smile

Sean
The Energized Tech