Monthly Archives: June 2010

Restoring your O/S onto new Hardware with Windows 7 and Vista

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

FacebookTwitterGoogle+Share

Restoring your O/S onto new Hardware with Windows 7 and Vista

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

FacebookTwitterGoogle+Share

Powershell – Active Directory – Show Group Memberships for a User

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

FacebookTwitterGoogle+Share

Powershell – Active Directory – Show Group Memberships for a User

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

FacebookTwitterGoogle+Share

MDT 2010 – How easy it is to change

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

FacebookTwitterGoogle+Share

MDT 2010 – How easy it is to change

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

FacebookTwitterGoogle+Share

Powershell – Send Files to a Compressed Folder

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

}

FacebookTwitterGoogle+Share