June 2010 Archives

This really isn’t a difficult article to write, since the process I am about to explain is very easy.

Restoring a backup to a new system with Windows 7 or Vista is beautiful and smooth.   It really is. 

I’ll be blunt … “They finally got backup RIGHT!”

Not just a little bit right but “Holy be-*bleep* amazing I wish I had this for the last ten years!” Right.

You see the restore is no longer WHOLLY dependant on the hardware.   Just a little bit.   The important stuff.

If you’re old O/S was 64 bit, the restore must be 64 bit too (ergo the platform you’re restoring to has to be 64 bit.

You have to have at LEAST the same amount of PHYSICAL drives as the source computer.  Even if one of those drives is hang off a SATA cable to make it work.

See ?  not a lot.   Here’s the cool part.  You can step UP in hardware.   Any technician out there who has ever upgraded a client workstation or server knows what I am talking about.  The “HAL” game doesn’t get played anymore.

Do you know what it takes to use the backup ?  How about an External box?  A lan drive?

Very little.  Of course if you have Windows Home Server, you’ve already been experiencing this Nirvana. 

 

Here’s how nice the Restore is.  I’ve restored a Bitlockered O/S backed up from ONE computer to a non Bitlockered system on a Domain.  When I was done, I just logged in and went back to work.

That’s right.  No rejoining the machine to the domain.  I may have had to add in some network drivers but my cached lan credentials were there too.   Applications ran EXACTLY as if there were on the old machine.

Just to show you how nice it is on Servers, a good friend Used the SBS 2008 Restore (same technology as Vista and Windows 7 backup) to restore from a Virtual Instance to a Physical Instance.

O/S booted up, Active Directory fully instact.  You would have though nothing had chancged.

So if you’re wondering about an inexpensive Backup solution for a Small Business?  Sometimes the best solution is right in front of you.  Built in

Sean
The Energized Tech

Powershell

A good friend called up today.

“Sean, my Favorite MVP!”

… He was buttering me up, this was going to be a tricky one.

“I need a script quick in Powershell to show me what Group Memberships a user holds in Active Directory and I need it NOW!”

When he says “NOW!” it’s that kind of “NOW!”

So a quick look at all the available properties of GET-ADUSER

GET-ADUSER –identity Joe.Schmoe –Properties * | GET-MEMBER

Shows a simple property called “MemberOf”.  Seems a little too easy.

GET-ADUSER –Identity Joe.Schmoe –Properties MemberOf | Select-Object MemberOf

Pulls down the answer.  I am about to leap out of my chair when I see it’s a Data Set, you know { gibberish, gibberish, jibbledyduff, cantexportthisstuff }

But that actually isn’t a problem.  Running a “GET-MEMBER” against the results like this

GET-ADUSER –Identity Joe.Schmoe –Properties MemberOf | Select-Object MemberOf | GET-MEMBER

shows me (ironically) another property attached to MemberOf called…… Wait wait, are you ready? ---- MemberOf

So quickly keying in that to pull down the property.

(GET-ADUSER –Identity Joe.Schmoe –Properties MemberOf | Select-Object MemberOf).MemberOf

Voila!  We have our list of GroupMemberships for Mr. Schmoe

Incidentally, if you’d like to use the Quest Commandlets, it’s IDENTICAL!

(GET-QADUSER –Identity Joe.Schmoe –Properties MemberOf | Select-Object MemberOf).MemberOf

 

Now would you like this as a function?

here you go!

 

Function global:GET-ADUSERMEMBERSHIP ( $Identity ) {
(GET-ADUSER –Identity $Identity –Properties MemberOf | Select-Object MemberOf).MemberOf
}

 

And you’re ready for dinner.  Plug in the identity any time now!

 

Remember, the Power of Shell is in YOU

Sean
the Energized Tech

Just a quick comment on MDT 2010 (Microsoft Deployment Toolkit 2010)

If you haven’t looked into it and still using other more costly imaging technologies, SERIOUSLY look into it.

Changes are a breeze.

My boss looked over at me and said “Kearney, I’m calling you out….”

No, no actually he DIDN’T say that. 

“Make a New Image in MDT 2010 with Windows 7 and Office 2010 to update the corporate image, make it snappy!”

Now we all know what the old methods were like.  Install the O/S.  Install the Apps.  Prep the system with Sysprep or using some imaging Technology from Symatnec or free third Party utils.  Two words for it.

“TIME CONSUMING” and most of all, usually hardware dependant.

MDT 2010, well I barely had to think about it.

I obtained the Windows 7 Media, added it to the system.   I obtained the Office 2010 added IT to the system.

I customized my selections to use Office 2010 and Windows 7 instead of the older O/S and Office but keep the same base apps.

Then I generated a Media Folder and .ISO file.

Want to guess how long it took?  about 15 minutes, and most of that was generating the folder structure and ISO file.  I’m pushing the estimate a bit high too.  The imaging process (because it’s a clean, proper and mostly automated install) is NOT dependant on Hardware either!

Then I was able to take that VERY Deployment folder and put it onto a bootable USB key, or burn it to DVD.   If I wanted to get really creative?  Add in WDS and have PXE boots from workstations for the install.

The cost?  I’m certain any system this EASY must cost money.   Nope.  Nothing. Nadda.  Just time to download it and the Windows AIK.  The beautiful part is the images aren’t even tied to a single SITE!  As a small Business owner, I remember having to keep alternate images for our clients.  With MDT 2010 I could have been running ONE computer to add in the New Office application or ZIP program to the client image.

I love when things are simple AND Free!  Thanks Microsoft and THANK YOU Michael Niehaus!  This thing rocks. :)

Sean
The Energized Tech

Powershell

This was just fun.

I was bent on the fact that “Windows can Make Zip files, so Powershell SHOULD be able to leverage this!”

I huffed and puffed.  I searched for ComObjects. I found the .DLL.  Nothing worked until I stumbled on a small VB.Net Function Posted in the forums.

Conversion to Powershell was surprisingly easy.  I’ve posted this Script, all it does it create the function SEND-ZIP.   You can add it to your profile.   Running HELP SEND-ZIP will give you the details on how to use it.

The only trick I found is you have to specify the EXACT location of the Zip file to send anything to it.  Something to with .NAMESPACE but it you like, take it and play with it.

Most of all

Enjoy the Power of Shell

Sean
the Energized Tech

 

#
# Powershell function (Works in 1.0 and 2.0)
# to create a .ZIP file using the native "Send to Compressed Folder"
# feature in Windows explorer.   It then copies files into the "Folder" thus allowing you
# to create a Zip archive natively in Powershell
#
# Original code from a post by Steve Fulton on
# http://social.msdn.microsoft.com/Forums/en-US/windowsgeneraldevelopmentissues/thread/d3e347cc-f4dc-44a6-8f84-977f958d89c6/
# Using VB.Net
#
# Orignal Notes and Code from Steve Fulton Follows....
#
#  1. Copy it EXACTLY as shown, make sure it works, then modify it. For example,
#  "ToString" shouldn't be required, but is..
#
#  2. This has only been tested on Windows Vista and Windows Server 2003
#  It should work on any version of Windows that pretends zip files are compressed folders
#
#  3. This works by creating an empty zip file. Then it copies the file you want to compress into the zip file. Windows will #see that you are copying into a zip file not a folder, and compress it on the way in.
#
#  -------------------------------------------------------------
#
#  Private Sub zipFile(ByVal filename As String, ByVal zipfilename As String)
#
#        Dim strZIPHeader As String
#
#        strZIPHeader = [char]80 + [char]75 + [char]5 + [char]6 + [char]0 + [char]0 + [char]0 + [char]0 + [char]0 + [char]0 + [char]0 + [char]0 + [char]0 + [char]0 + [char]0 + [char]0 + [char]0 + [char]0 + [char]0 + [char]0 + [char]0 + [char]0)
#        Dim fso = CreateObject("Scripting.FileSystemObject")
#        Dim tf = fso.CreateTextFile(zipfilename)
#        tf.Write(strZIPHeader)
#        tf.Close()
#
#        With CreateObject("Shell.Application")
#            .NameSpace(zipfilename.ToString).CopyHere(filename.ToString)
#        End With
#        MessageBox.Show("All done!")
#    End Sub
#
# -------------------------------------------------------------
#
# Sean (Energized Tech) Notes.
#
# I found this immensely cool to play with since (If you look at the Structure) not a
# lot changes between VB.Net and Powershell suggesting it would not be hard to
# translate many functions or applications from VB.Net to Powerhshell
#

function global:SEND-ZIP ($zipfilename, $filename) {

<#

.SYNOPSIS
Function to send Files / Folders to a ZIP file using the native
feature in Windows Vista / 7 / Windows XP

.DESCRIPTION
Function to send Files / Folders to a ZIP file using the native
feature in Windows Vista / 7 / Windows XP.  Requires
Two parameters to be sent.  The Zip file name (with .ZIP) and
A File / Folder

.EXAMPLE
Send a Folder called C:\FolderA to a file in the current
folder called MYZIPFILE.ZIP

SEND-ZIP C:\MYZIPFILE.ZIP C:\Foldera

You must ALWAYS Specify an EXPLICIT path to the ZIP file

.EXAMPLE
Send a File called FILE.TXT in C:\FOLDER to a
ZIP file called TEMPZIPFILE.ZIP in the C:\TEMP Folder

SEND-ZIP C:\TEMP\NEWZIPFILE.ZIP C:\FOLDER\FILE.TXT

You must ALWAYS Specify an EXPLICIT path to the ZIP file

.EXAMPLE
This will FAIL - Consider it a flaw in design :)

SEND-ZIP NEWZIP.ZIP C:\Foldera

.NOTES
This was originally a VB.Net Function written by Steve Fulton
from a post on MSDN.COM
http://social.msdn.microsoft.com/Forums/en-US/windowsgeneraldevelopmentissues/thread/d3e347cc-f4dc-44a6-8f84-977f958d89c6/

Converted to Powershell by Sean Kearney @energizedtech (www.powershell.ca)

#>

# The $zipHeader variable contains all the data that needs to sit on the top of the
# Binary file for a standard .ZIP file
$zipHeader=[char]80 + [char]75 + [char]5 + [char]6 + [char]0 + [char]0 + [char]0 + [char]0 + [char]0 + [char]0 + [char]0 + [char]0 + [char]0 + [char]0 + [char]0 + [char]0 + [char]0 + [char]0 + [char]0 + [char]0 + [char]0 + [char]0

#
# Check to see if the Zip file exists, if not create a blank one
#
If ( (TEST-PATH $zipfilename) -eq $FALSE ) { Add-Content $zipfilename -value $zipHeader }

# Create an instance to Windows Explorer's Shell comObject
#
$ExplorerShell=NEW-OBJECT -comobject 'Shell.Application'

#
# Send whatever file / Folder is specified in $filename to the Zipped folder $zipfilename
#
$SendToZip=$ExplorerShell.Namespace($zipfilename.tostring()).CopyHere($filename.ToString())

#
# Hey the cool part is if you send a folder, it automatically recurses and gives you the
# Progress bar as it is zipping.
#
# Sean
# The Energized Tech
# www.powershell.ca

}

office2010

I Learned a neat trick I’d like to share with you all.  It’s called “How to do a basic silent install of Office 2010”

This works on Project 2010, Visio 2010 and Office Professional 2010.   But the technique is not unique to them.  Just the particular commands.

In truth, this is nothing new.  You could ALWAYS automate the install of Microsoft Office.  If you had a Volume license version, you could setup a copy of the Network (Administrative Install).  Your other choice was the Office Customization Utility.

But again, those were targeted to the Volume licenses.

YOU can take advantage of those same techniques, if only to simply the install for your technicians and Customers.  Make life simpler.

Shhhhhh… don’t tell.  It’s actually quite easy.

First off, if you have the installer that is a Single file executable you’re going to need to produce the Install folder we all know and love.   It’s an easy task to pull off.

I cheated.

I typed on the command prompt

en_office_professional_plus_2010_x86_515486.exe /?

and it produced this lovely bit of info!

image

So I created a little folder on C: called “Office” (Did I mention I’m not very creative with my folder names?) and ran

en_office_professional_plus_2010_x86_515486.exe /extract:C:\Office

Giving me after a few seconds of a progress bar my familiar old friend the install folder.  Please note, if you have the DVD, you can just go ahead and copy the Files but presently we Technet/MSDN users have a giant executable

Next you need to create a file at the root of that folder called “Custom.XML”.   Now you can get a SAMPLE of it online at Technet’s Config.XML Technical Reference . It’s right near the bottom.  But if you look in the mail folder under the root ending .WW like this picture here

image image

 

You’ll find there is copy sitting right inside there.  Just to save you some time I found a few things about that file (and why It didn’t work for me the first time)

Lines beginning with “<! -–“ and ending with “ ––>” are comments.  Everything in between is just eye Candy until you get rid of the comments.

Don’t just uncomment everything.  Doesn’t work.  You’ll have a silent install launching and caching data and doing nothing.   Well nothing except eat up CPU cycles.

Simplicity is best.  Start with some SMALL automating (like the Company Name / User Name) and work your way up.   Makes troubleshooting the first time easier.

But here’s what I found, I only needed about 6 lines to make it all work. Best of all?  It’s takes NOTHING (I mean NOTHING) to carry that Config.XML file to another Office Product and change it for that Product. 

All you need are two pieces of info, The Product Name and the Product Key.  One is easy to find, it’s stuck on the box or with the OEM pack.   The other is found by looking into that magic .WW folder.   Inside there is another .XML file called “SETUP.XML”.  Open that with Notepad or your choice of editor for Text Based file and look for the line marked <Setup Id=”ProPlusr” Type (yadda yadda yadda doo dah)

image

That part between the quotes is your ProductID (Professional Plus Retail, Visio etc)

So with THIS simple XML file (Yes, I’m going to save you the nasty work)

------- Begin Custom.XML ------

<Configuration Product="VisioR">
<Display Level="Basic" CompletionNotice="no" SuppressModal="yes" AcceptEula="yes" />
<USERNAME Value="MyUserName" />
<COMPANYNAME Value="MyCompanyName" />
<OptionState Id="ProductFiles" State="local" Children="force" />
<PIDKEY Value="AAAAABBBBBCCCCCDDDDDEEEEE" />
</Configuration>

-------- End Custom.XML -------

This is for Visio (as can be seen by the first line

“<Configuration Product=”VisioR”>

This is the line you need to edit for whichever Office Product you are installing

The line marked

<Display Level="Basic" CompletionNotice="no" SuppressModal="yes" AcceptEula="yes" />

 

Controls just how much information gets thrown at the user. In this case it’s Basic (Status Bar), No completion Notice with the EULA Accepted and Errors hidden away

These Two fields are pretty self explanatory and no, you don’t need to have them in.

<USERNAME Value="MyUserName" />
<COMPANYNAME Value="MyCompanyName" />

 

This line marked “OptionState”

<OptionState Id="ProductFiles" State="local" Children="force" />

 

Will identify the options you’re going to install.  You can find several examples of these “OptionID” inside SETUP.XML But I found this one (the Root) the most useful.  In a nutshell I have selected “Install ALL of it”.  I like to keep this simple.

Of course this is the most important line, the Product Key.

<PIDKEY Value="AAAAABBBBBCCCCCDDDDDEEEEE" />

Replace the part between the quotes with your 25 digit product key WITHOUT the “-“ (Hyphens)

If you choose to NOT have the Product key entered, I recommend changing the “Basic” to “Full” under <Display Level="Basic"

It won’t be a true “silent install” but it’s only Two clicks of a mouse which isn’t bad.

If you’re running an OEM or RETAIL key on the install and WANT a silent install you’ll have to delete the subkeys BELOW this registry key on each workstation to prompt the user for the Key upon startup

HKEY_LOCAL_MACHINE\Software\Microsoft\Office\14.0\Registration\

That should prompt for a new Key upon startup of Office

But honestly?  Look into a Volume License copy of Office and Windows anyhow.  There are some great advantages with it (Like the ability to just have ONE deploy point and image and the Office 2010 Customization tool.   That Tool can take your Silent deploys to a whole Nudda level!)

But there you have it.   Office 2010.  East to deploy with just one file.

The Power is in YOU

Sean
The Energized Tech

*BEEP BEEP BEEP BEEP BEEP BEEP*

Dad smacks the "Snooze" button on the clock.  Gotta go back to bed.  Don't want to go into work today...

Zzzzzzzzzzzz...... Sleep blissful sleep.   Quiet happy sleep.  Sports cars.  Hamburgers.....

*BEEP BEEP BEEP BEEP BEEP BEEP*

Glancing over at the clock only a minute had passed, and the clock was blaring away trying to get his attention again.

Only one way to deal with that.

*SNOOZE BUTTON*

Back to happy land.   Zzzzzzzz......

And no sooner was Dad off juggling torches with Panda's than...

*BEEP BEEP BEEP BEEP BEEP BEEP*

The mighty slab of meat that was Dad's hand came up to the beast and numbly tried to find the teeny tiny "OFF" button for the Alarm.   That seemed to be a challenge.   Dad's fuzzy eyes stared at the Ultra-Wake-O-Matic-DigitalPhonic-MegaClock 3.0.   The Micronic quarter inch button marked "OFF" was pressed, only to find the entire system powered down.

It seemed like a good buy at the time.   Dad vaguely was aware of the events of the day where his old "Big Ben" failed him because of his inability to rewind it, or remember to rewind it.   Or perhaps the cat was sleeping on it that morning.   It was all a big fog.

But he did remember drooling at this baby at the time.  "The Ultimate Alarm Clock - Guaranteed Nevur Fayl!"

Those gleaming Neon letters called out to him.  An Alarm clock with a 1 Terawatt, 9.1 Surround sound Speaker setup with 2 Gigawatt 1 Hz Subwoofer.  It would wake the Dead, perhaps even get them up to have breakfast with the kids.

Five different types of numeric displays with Built in Screen Saver.  Holographic, Wall Projected, Floating in Water, Laser Drawn in mid air and Classic LED.   Even a tiny little Analog clock on the side.

The Clock had more buttons than a panel at Mission Control.  It had IPV4/V6 Ethernet, Arcnet, Token Ring, Fibre Optic, Serial and even a legacy IEEE-488 interface. Covered in a classic woodgrain style like an old Blaupunkt stereo with Dad's signature engraved in shining gold letters on the side.

Truly, she was a thing of beauty.  How Mom didn't kill him the day it entered the house, nobody is quite certain.

Well the clock seemed to be "malfunctioning".   Only one thing to do to resolve this.   Contact the lifetime 24 hour a day, 7 day a week on site tech support.  Dad would only pay for the Premium tech Support, nothing else made sense.

Dad grabbed the hammer on the side of the Clock and smashed open the glass shield stating "Break Here and Press Firmly for Emergency 24 Hour a Day 7 Day a Week On Site Tech Support"

Bit's of glass tinkled onto the dresser table below as feverishly cracked open the never used Emergency System.

The button was pressed.

Dad paused tensely waiting for Klaxons to sound, Lights to glow and impressive things to happen.

Tensely, Slowly, a piece of paper fell out.

"At the time this device was released, this option was not out of Alpha testing.   *oops!*"

Dad stared blankly at the small scrap of paper challenging him.  He blinked several times in disbelief.   "Alpha testing."  Well then, only way to fix this problem.  It was time for Dad to play "Operation"

Calling it "Operation" was the most accurate word.   For like in the game "Operation" every time you hit the wrong side, you got a sharp buzz.   Dad working on Electronics, well it was an awful lot like that game.

Just ask the Stereo downstairs or that poor helpless 35 inch tube Zenith.  There was also the neighbour's Microwave that nobody speaks of.  Everybody was surprised Dad's hair grew back after that.

Rolling out of bed, Dad instinctively went to get the one thing he KNEW would fix the problem.

"To my SuperCraft MicroSharp 10,000 piece toolkit!"

Yes, Dad never did anything lightly.  He had a toolkit that contained every possible bit, socket, adapter, extension you could imagine.   Even a few that didn't exist.

Stumbling downstairs into the basement Dad placed his palm upon the biometric scanner and took the Eye scan to unlock the toolkit.   Latches released as if guarding Fort Knox.   Dad obtained the small pouch which contain all the special bits always used on Electronics.  Tamper proof and Security bits only meant for true Electronics professionals..... and over zealous Dads.  Running up the stairs, Dad slowly examined the prize.

No screws to be found.  Nothing.  Nada.    Truly a well designed system.    

Carefully turning the 350 pound gleaming tribute to manhood over, Dad looked again.  Not an entry point to be found anywhere.  But beside the tiny 1/16 inch serial number, a tinier 10 digit number with a message"

"Dear customer, in the absence of the 24 hour a day 7 day a week tech support, please contact this number"

Dad blinked "{TECH SUPPORT!}" his mind cried out.

He dialed the number.   First round he hit Texas, then transferred to Singapore.   The representative determined it was closer to a software issue rounding that call to Sweden which bounced to California due to a national Swedish holiday.   California re-transferred the call a final time to Winnipeg Manitoba in Canada.

"Hello.   The Ultimate Alarm Clock - Guaranteed Nevur Fayl Alarm Clock Tech Support.  How can I help you Eh?"

Dad explained the problem.  Snooze kept going off.

"Ah, I see.  You've yourself the classic firmware don’t ye know.   We've release thirty seven updates since you bought that.   You just have to initiate the update sequence Eh?"

Dad nodded numbly.   "Firmware.  update."

"So all you have to do is press these twelve keys simultaneously, F1, ALT, OFF, SNOOZE, RESET, 2, 6, JABBERWOCKY, BING, TONG, ZING, and FM.   That will trigger the automatic update."

Realizing Dad only had Ten fingers, a solution was required.  Toes.

Dad nimbly climbed onto giant Alarm Clock, getting into a position only a trained Yoga of Fifty years could meet, pressing those twelve buttons at once.  While pressing the ear to the phone.

"Update" went the Alarm clock as the internal Raid 50 array sputtered to life shaking like a Chihuahua on Coffee.

"Crack" went Dad's back in response to his attempt at “Alarm Clock Telephone Yoga”

"*Flash!*" went the Camera as Mom snapped another one for the family album.

*KLUNK* went Dad as he fell off the "The Ultimate Alarm Clock"

He Blinked and looked.  Fixed.  It was worth it.   His gleaming prize.  Repaired and with only a few bumps and scratches.   Dad smiled like a warrior from a fierce battle.

Dad quickly reprogrammed in all the settings, time zones, classic Wake up sounds, favourite stations.   He quickly set the alarm to see if snooze would work.

The clock hit it's time.

*KLIK*

"*Wake up Eh?  Wake up Eh?  Wake up Eh?  Wake up Eh?  Wake up Eh?  Wake up Eh?*"

SNOOZE

Dad stared at the clock.  It waited patient and 10 minutes later.

"*Hey you still sleepin' Eh? Hey you still sleepin' Eh? Hey you still sleepin' Eh? Hey you still sleepin' Eh?*"

He blinked.   The firmware was from Canada.   Oh well.

Clock worked :)

Happy Father's Day to my Dad and Dad's Everywhere.

Sean
The Energized Tech

Powershell

So you’re staring at that Server 2008R2 core Box as a DC.  You’ve got Powershell and all those wonderful AD Modules.

“Didn’t this guy say you could manage AD on a Core R2 box WITHOUT the GUI?”

Yes I did.

If you ran that last command after doing an “IMPORT-MODULE ActiveDirectory” you saw a rather LARGE pile of Available Commandlets.

You know, THIS Commandlet

GET-COMMAND –module ActiveDirectory

So AFTER you picked your eyeballs off the ground (ala Wile E Coyote) you DID have to take a look.

Well I’ll show you a few I use daily.   Ever have a use screaming on the phone how they LOCKED themselves out by mistyping their password?  It’s absolutely NOT their fault?  No they DIDN’T have anything to Drink at lunch?

Easy fix.

UNLOCK-ADACCOUNT Username

How about a whole division of users forever locking themselves out?

UNLOCK-ADACCOUNT –filter ‘Title –eq “Coop Student”’

Need to quickly disable a user?

DISABLE-ADACCOUNT Ernest.DeRoach

Hey, did you say you needed to move Peter from the Seattle Office OU to Montreal OU? Noooo Problem!

Move-ADObject -Identity "CN=Peter PumpkinEater,OU=Seattle,OU=Offices,DC=Contoso,DC
=local" -TargetPath "OU=Montreal,OU=Offices,DC=Contos,DC=local"

As well you can Create users in AD with NEW-ADUSER, Check members of groups, and even Change the Domain Functional level.  All with simple CommandLets.

These are not only interactive Commands, these are tools you can use to build Scripts to automate your user deployments.  This is a box that can be dropped to as low a 64 MEGABYTES for your Domain controller.   Enterprise environments I wouldn’t recommend doing this, but how about a Small Business?

Have I wet your appetite?  Are you drooling on your Core R2 box?

 

Hold on folks, the ride is about to get a lot more exciting.  

The Power of Shell is in YOU

Sean
The Energized Tech

Powershell

As the announcer on the radio would normally say “….When we last left our heroes…”

Last time we just finished up Making Server 2008R2 the first (and most secure) DC in a new environment.  Now we’re going to kick things up a notch.  We’re going to show you how to manage it with JUST Powershell.

Yes I can already see the jaws dropping.

Granted there are some things where a GUI console is far superior.   Doing RSOP, editing GPO, I use the GUI for that.  It presents the information in a way that is sensible.

But there are things that a Powershell interface beats a GUI hands down.  Creating users, disabling, unlocking accounts, Querying A/D.  Powershell beats the GUI there.  Functions that normally need to be repeated?  GUI runs off crying in the corner.

First we need the tools to manage this Core AD box.   One line and we are off to the races.

START W/ OCSETUP ActiveDirectory-PowerShell

And a few moments later you have the ActiveDirectory Powershell module available to you on that box.

To use this on the box simply start up Powershell and then execute the following Commandlet

IMPORT-MODULE ActiveDirectory

Or if you REALLY want to impress your friends you could modify your Powershell profile by adding the command to it to automatically launch every time.   Or make people blink by memorizing THIS shortcut for launching Powershell

POWERSHELL.EXE –NOEXIT –COMMAND {IMPORT-MODULE ActiveDirectory}

Which will execute that Import command as well

What will this do for you?  You’ll have the ability to commands to manage Active Directory on that core box now.

For a list of available Commandlets just execute

GET-COMMAND –module ActiveDirectory

We have now just opened Pandora’s box.  Next time we’ll show you just how much power lays at your finger tips with Active Directory on Server 2008R2 with only using Powershell.

The Power of Shell is in YOU

Sean
The Energized Tech

Powershell

One of the little things I did for fun a while back was setup a Server 2008 Core box as a stand Alone DC.   I kept thinking to myself “Oh won’t this be cool! Other admins can’t mess with my stuff!”

In truth a Server 2008 R2 Core box as your DC makes perfect sense.   Really what IS the box supposed to do?  Hold Active Directory.   You don’t NEED a GUI to hold that.   But in R2 it’s even better with Powershell.   We have the option to manage that box without an external GUI (You still can).  But using Powershell it’s all easily repeatable.

Imagine this.  You’re on an airplane.   HR has just emailed you a list of 50 new people that need to have accounts ready in four hours.  Why?  Big data entry project and they’ve decided (Without asking you of course, because that NEVER happens) that these 50 people need to be prepped on Active Directory.

With Powershell you can actually Run that remotely on the server over a slow WAN link.  Even on a REALLY bad server, it would only take a minute to copy paste that CSV and execute it.

Cool?  Trying doing THAT on a GUI!

So let’s look at the first part, making a Server 2008R2 Core box into a DC.   This is actually easy.  You still use the same command, “DCPROMO.EXE”. The only difference is you supply the parameters. 

There are two ways to do it, one is an answerfile (A text file the DRPROMO calls up with all the parameters) or you CAN just type it directly into the line (which I think is pretty darn cool!)

To find out what parameters you can pass to DCPromo you can pull up this Technet Article which provides some good instruction. 

But in a pinch (since I’ll typically not have internet, it’s slow or … well… I’m LAZY, I can run THIS command in a command prompt

DCPROMO /?:Promotion

Which will show me all the parameters required for the Promotion of a Domain Controller. 

So again, two ways.   The First manner is typing it all in the Command line in one shot (Nerdy Cool)

So for the following setup

NETBIOS Name : CONTOSO-INC

DNS Name : HEADOFFICE.CONTOSO.COM

SafeModePassword : BadPassword4You

Admin Password : Prompted

DCPROMO /ReplicaOrNewDomain:Domain /DomainLevel:4
/DomainNetBiosName:CONTOSO-INC
/InstallDNS:Yes /NewDomain:Forest
/NewDomainDNSName:HeadOffice.CONTOSO.Com
/Password:* /RebootOnCompletion:Yes /RebootOnSuccess:Yes
/SafeModeAdminPassword:"BadPassword4You"

Now looking at that, THAT is a mouthful.   And truly chances a typo, which is why the ANSWER.TXT file is preferred by many.  To use the Answer.Txt file for promoting the name just fire up notepad and key in the following details for the same Domain.  This Article on Technet references the fight format for the Unattended answer file.

[DCINSTALL]
ReplicaOrNewDomain=Domain
DomainLevel=4
DomainNetBiosName=CONTOSO-INC
InstallDNS=Yes
NewDomain=Forest
NewDomainDNSName=HeadOffice.CONTOSO.Com
Password=*
RebootOnCompletion=No
RebootOnSuccess=No
SafeModeAdminPassword="BadPassword4You"

If you save this text file as DOMAINANSWER.TXT and run the command

DCPROMO /UNATTEND:DOMAINANSWER.TXT

This will create on a Server 2008R2 Core box a BRAND NEW Domain called “CONTOSO-INC” with a DNS name of “HEADOFFICE.CONTOSO.COM”.  It will install the needed DNS and reboot when done

Next time we’ll look at MANAGING that Domain with JUST Powershell on the same box.   GUI is an option, but it’s nice the know we can do it all from Powershell.

 

The Power of Shell is in YOU

Sean
The Energized Tech

Sung to “Heartless” by “HEART”

“Commandlets”

Commandlets (Heartless from Heart Rewritten)

I sat down to work at the beginning of the week cuz I needed
To get it all, and have a little fun, my mind pleaded
I opened the box of blue, it all came true, unleashed it there!

Commandlets! Commandlets! A greater simpler textual control
Commandlets! Commandlets! We keep on codin' on to meet our goal
Commandlets! Commandlets! My work is flowin' out without a toll
I never realized, how quick I fly, I'm scriptin' on a roll

Each night, in the back of the server room, Executing
Just a few more lines, my unwinding power, Elevating
A one liner here, a quick type there, Set it free!

Commandlets! Commandlets! A greater simpler textual control
Commandlets! Commandlets! We keep on codin' on to meet our goal
Commandlets! Commandlets! My work is flowin' out without a toll
I never realized, how quick I fly, I'm scriptin' on a roll

Oooooooo (x4)

Commandlets! Commandlets! A greater simpler textual control
Commandlets! Commandlets! We keep on codin' on to meet our goal
Commandlets! Commandlets! My work is flowin' out without a toll
I never realized, how quick I fly, I'm scriptin' on a roll
I never realized it
So simplified

You cannot talk about Teched 2010 and not, at one point in time touch on New Orleans itself.

SAM_0280 SAM_0279 SAM_0291

There is one thing that truly unique about New Orleans over any city is the food and the music.   The City Lives and BREATHES music.   Jazz music pours out of from every crevice of the city singing soulful yet lively sounds breathing in and out of you.  A being of pure chorus and sound.

SAM_0199 SAM_0204

It is also a city that has fought back from Disaster and is still fighting.  Everywhere I went about there were still signs of rebuilding.   Where people were contributing back to the community to make a difference.

SAM_0172

There are homes in New Orleans where Brad Pitt himself is helping to rebuild them.

Hurricane Katrina could not take down New Orleans, not a city with this much spirit.

 

 

 

 

 SAM_0237

 

The life and music that is Bourbon Street, the people carrying on, the food and soul that is New Orleans fought back.

Only making it stronger.

A tip of my hat to the people and the City of New Orleans

Sean
The Energized Tech

teched

So yesterday TechEd 2010 wrapped up in New Orleans.   It was more than I expected and better than I dreamed.   Sessions about technology sitting right on the edge, Vendors portraying their arts. 

The Lights, the Colours, the MUSIC!

For how could you have ANY event in New Orleans without music?  The event opened and closed with one of the most lively bands I have ever heard.    A chorus of music so powerful it drove a crowd of over 10,000!

From the quote from the lead singer “In New Orleans we Eat, Drink and Party and then start all over again”.   After having spent a week down here, *IT* is truly the “City that never Sleeps” not New York.    The Entire town is a living breathing organism of life, love and music.

TechEd North America 2010 lived as a part of this city while here.   Attendees networked with each others like old friends.   Presenters carried the life into their presentations.   It was a spectacle unforeseen.

Of course I had a few personal memories I’ll get to take away from TechEd.   Meeting some of the nicest people ever from the Powershell team, especially Jeffrey Snover and all the product team.   MVP leads as well as those in charge of the team.  

But it didn’t stop there! Chatting and meeting with the two hardest working guys at Microsoft, “Hey Scripting Guy” Craig Liebendorfer and Ed Wilson. Ragnar Harper of Crayon involved in the biggest and best version of Highway to Powershell.  Kirk “Poshoholic” Munro, Thomas “DR DNS” Lee as well as Jeffrey Hicks.  Even Glenn Sizemore a winner on “The Scripting Games” and a follower of my tweets!

If that wasn’t ENOUGH I got to help out Rick Claus of Microsoft Canada with his Podcast “Security Bulletins for the Regular IT Guy” as well as interviewed on stage with (Pause, Gasp, Faint) JEFFREY SNOVER and DON JONES! Too much!

Just when I thought I was settled down, the final bit came along.

I was about to cry (literally) in happiness at getting to see the Master in action.  MARK RUSSINOVICH!  The man who’s tools I use daily to under the nightmares that happen under the hood.    The Ultimate Technician. 

I saw him.

I got to shake his hand before the Channel9.MSDN.COM live interview (By the way, Mr. Russinovich, that handshake settled me down for the show!  THANKS!)

His theatre was packed.  Everybody was excited to see him.  He came out to chat with us before hand.  Oh I WISH my throat wasn’t quite so hoarse from the previous night.   It was DEFINITELY a d De-EnergizedTech he got to meet! 

And for Seventy FIVE glorious minutes I got to take in some of the deepest and most interesting Technical troubleshooting tips ever.  The use of WinDebugger and the Sysinternals tools to wield and control the problems at hand.

It was so amazing to see I wasn’t the only person to look at troubleshooting as an art and to understand the concept of the pyramid effect.  How one small piece can cause a greater problem.  The Solution of that small piece eliminating far greater issues.

I walked out his session about to burst into tears of joy.

It was THAT good :)

So to all of you out there I got to meet at Teched 2010 that I may have forgotten to mention, thanks for the opportunity.  You have TRULY Energized me.

For any of you out there that wonder “Should I take chance” at something?  Do it.

Pass or Fail, you will learn.  You can always attempt again.   Because I took a shot at my dreams, I was at TechEd 2010.

I will never forget this week or New Orleans as long as I live.

Sean
The Energized Tech

 

SAM_0308

And so another day begins with Teched 2010.

An interesting start for me.  A buddy from Microsoft Canada Rick Claus asked if I’d like to help out with his podcast.

Boy THERE was a difficult decision.  Get to do something cool and geeky or sleep.  Wasn’t much of a decision.    Who needs sleep?

So we sat down on that early morning Louisiana morning, Sun warming up the sky with our Beignet coated fingers to do the podcast.

Smoothly done too.  I put on my “Radio announcer voice” ;)

 

Soon after time to head off to TechEd 2010, more information, more knowledge, and rumor has it, a chance to be on Channel9

Sean, the Energized Tech

SAM_0301

I’ve woken up two or three times this morning from the excitement of it all.  The realization has just hit me like a brick in the head.

In just over a few hours I along with over 10,000+ people will Converge onto the Convention Center in New Orleans for one of the biggest conferences in North America, Teched 2010.

The amount of information my brain will download in this Technology driven, demo Intensive, Vendor and Community Cornucopea is difficult to fathom.

I may need to upgrade my internal ram and Hard drive for this baby.

Four solid days of information and training, networking with people, Content gathering. 

I myself have registered for FIFTEEN separate sessions (of course they all seem to contain one magic word – POWERSHELL) with which I will carry this knowledge back home.   To my company, coworkers and Community.  To improve myself but also others about me technically.

This is Teched.

So pardon me folks… The bus is now leaving… TechEd is arriving…

It is time to….. RELEASE THE KRAKEN :)

Sean
The Energized Tech

SAM_0109

At last we’ve arrived.   So far NOTHING but GOOD surprises.

The flight was relatively uneventful and better than my first flight ever to Calgary.

The Taxi Driver was quick, efficient, friendly and CHEAPER than what the online services suggested.

Hotel Le Cirque appears to be a hidden gem, directly off Highway 10.   The room is reasonably sized, the Wifi is fast and free and the A/C is running beautifully.

Finally of course certain weary bodies that have been up for beyond 24 hours can grab a snooze.  (Or more of a cat nap)

We have of course learned that apparently Pizza is NOT a good option for Breakfast… Strange that.

But I can’t really rest.  I’m too excited!

For you see as soon as this is posted? I’m moving down to register now.

Oh yeah baby.

TechEd 2010 is happening tomorrow!

Sean

SAM_0101

So we budgeted the right amount of time, for the border, the pickup and checkin.

We allocated reasonable delay times which should have put us near the airport about 4 to 4:30am

What do YOU suppose would happen if you PLANNED for NORMAL and completely REGULARLY expected delays?

That’s right.  They didn’t happen.  Not a one.  Nadda.  ZILCH!

So as a result we are now sitting here snacking on the “Border Wait” snacks with Red Bull.  And we HAVE to finish ALL the Red Bull BEFORE we board for the flight.

Ok, Cory (SyntaxC4) with 2 Red Bull not so bad.   But Me?  Didn’t they have big red warning signs at events saying “No Coffee for Sean the EnergizedTech.  No Coffee!” with guards protecting the pots?

I am now presently chugging down a Red Bull *urp*.    The second awaits with a mouthful of Corn nuts and some shared wifi from a PCMCMIA internet card.

Life is good.  And New Orleans awaits us in 8 hours…

SyntaxC4 and EnergizedTech charged up on 2 Red Bulls in New Orleans for TechEd.

Yes, this will be an interesting day

Sean

SAM_0099 

After a long bus ride listening to a lot of Blackberry buzzing and a very loud baby that understood how to make only one one noise

“WAAAAAAAAAAAAHHHHHH!!! WAAAAAAAAHHHHHHH!!!!!”

Or something like that.   I arrived to find a very stunned Developer chugging away on coffee.  

“Where’s mine?” I yelped?

“Ye are Banned from Coffee as decreed by the Lords of Microsoft.” are the words he speaks

Wildly and madly SyntaxC4 spun the car about as we head to the border.  

Along the way the digital Daemon Jarvis the GPS spits out incorrect directions while the Caffeinated Cory madly reprograms it’s O/S to teach it a lesson.   Jarvis the GPS bawls digitally.

It appears this will be an interesting drive to the border :)

Sean

SAM_0098

Switching from the Train to the Bus waiting for the Milton Bus there was a little mayhem.  The Blackberry shutoff sending my Developer friend quickly scrambling for code to rewrite the O/S on my phone.  

A large crowd of Party goers or people who were actually surprised a Toronto team won a game.

And apparently most of them though there was a complimentary open air urinal posted in the bus depot.  

“….Have I already arrived in New Orleans?” my mind wondered.   No just a late night in the normally quiet city of Toronto Ontario.

Ahh… my bus has arrived and the Blackberry Messages have returned.

Onto the next stop… Milton, where I shall meet up with my ever creative Developer friend SyntaxC4 (Cory)

He has already placed a coffee ban on me.  Hmmm.  He must have been speaking to Rodney.

Sean

SAM_0094

I stand on the ramp.   It is 9:35 on a cool night here in Oshawa.  Quite the contrast to what it should be in less than 12 hours in New Orleans.

If all goes well (Barring Mr. Murphy the bain of every ITPro and Developer) I should be in Milton to meet Cory (@syntaxc4) and make our way down to the border.

A Developer and an ITPro together, our powers, energy and excitement united.  Look out New Orleans, here we come!

Watch the blog for further updates.

Sean

This isn’t a “toot your own horn” (well maybe a tiny bit)

I get to sit on a stage with Jeffrey Snover and Don Jones with the live Channel 9 show at TechEd 2010 in North America down in New Orleans.

I have to pause for a minute here and wipe a tear…

For me, this is beyond belief and beyond words.

I am a geek.

Just a geek.

That’s all I will ever be.  But I will be the best I can at it every day.

I was never into sports.  I was in the band.  I played Trombone (My Axe), a bit of flute, trumpet, sax and Clarinet.  I spent my days, nights and mornings drooling over Byte Magazine articles, manually typing in software; somehow avoiding Carpel Tunnel.   Wishing I had Bionic arms.

……and even playing Piano on a Vic-20 (A story for another day)

On the greatest convention held in North America in one of the most beautiful cities I have the rare opportunity to be on stage with the very FATHER of Powershell as well as one of the most gifted individuals to Master Powershell.

To sit WITH them

Amongst them

as them

For a guy like me, who looks up to Computer guys as my heroes, People like Bill Gates, Steve Ballmer, Paul Allen, Steve Jobs, Steve Wozniak, Linus Torvalds, and Jack Tramiel; ALL of those that came before me, that inspired me.  All of them and you.

Those are my heroes. 

On Tuesday I will sit with them, and answer questions and CHAT with them.  I could not have imagined this in my dreams.

But dreams become reality given time, effort and pursuit for all of us.

I’ll be on stage wearing my Powershell shirt smiling like an idiot :)

 

Living the dream.

 

Cheers All and see you at TechEd 2010

Sean
the Energized Tech
”Seek out your dreams…”

teched

I was presented with a rare opportunity this year.  A chance to go to TechEd 2010 in New Orleans and see more than I could ever imagine in 4 days!  A chance to see more topics than at  Techdays_CA.   A rare chance to meet and network with people I’ve only ever met online via Twitter and LinkedIn

But even more importantly?  It’s a fantastic chance to learn.    To wrap my mind so deep into technology I may never be the same person again.   An opportunity to expand myself and bring abilities to my employer that mere mortals can barely imagine.

And yes, naturally as a result, a chance to grow.

So will YOU be at TechEd_NA 2010? If you try to find me, I’ll be a balding guy, with a Tilley hat wearing THIS truly unique shirt

 FrontPowershell BackPowershell

…and yes, with my eyes and mind open, ready to take in the week.

See you there!

Sean
The Energized Tech
MVP Windows Powershell

“Geek”