Monthly Archives: January 2010

Windows 7 – Deployment Deep Dive – FREE!

I know I said it before but hurry now and register! 

Absolutely FREE event on Windows 7 and Deployment is being held NEXT Monday (February 8th 2010) at Microsoft Mississauga!

Details are as follows! If you’re interested Click HERE to get directly to the Microsoft site to register!  Just bring your interest and passion!

———————————————————-

Deployment Deep Dive on Windows 7 Community Tour-Mississauga

Event ID: 1032436872

 

February 8, 2010 6:30 PM – February 8, 2010 8:30 PM Eastern Time (US & Canada)
Welcome Time: 6:00 PM

Microsoft Canada Headquarters

MPR A/B/C
1950 Meadowvale Boulevard
Mississauga Ontario L5N 8L9
Canada

Event Overview

Are you running Windows XP?  Are you feeling the pressure of creating a deployment plan? Have no fear!  Leveraging learning’s from two Windows 7 early adopters this session will give you the skills you need to proceed with your own deployment.  The session will focus on free Windows 7 deployment planning and deployment tools that customize operating system packages and automate deployment planning and network deployments seamlessly. We will dive right into:        

  • How to use the Microsoft Assessment and Planning (MAP) tool to identify your current hardware and application inventory.
  • How to use the Windows Automated Install Kit (WAIK) to build a customized image for your organization.
  • How to use the Microsoft Deployment Toolkit (MDT) to build, deploy and maintain Windows installation images.
  • How to migrate the end users profile from their current installation to the Windows 7 installation using the User State Migration Toolkit (USMT).
  • How to integrate MDT and Windows Deployment Services (WDS) to perform Lite Touch installations of Windows 7.

Finally we will look at how we can leverage the various tools to solve any application compatibility issues you might encounter.  We will look at how you can overcome common obstacles using the Application Compatibility Toolkit (ACT), or larger obstacles using Windows XP Mode and Microsoft Enterprise Desktop Virtualization (MED-V) and even how you can leverage Application Virtualization (App-V) to streamline application deployment and ensure all your applications work!

Please note: there is no cost to attend this event.

FacebookTwitterGoogle+Share

Windows 7 – Deployment Deep Dive – FREE!

I know I said it before but hurry now and register! 

Absolutely FREE event on Windows 7 and Deployment is being held NEXT Monday (February 8th 2010) at Microsoft Mississauga!

Details are as follows! If you’re interested Click HERE to get directly to the Microsoft site to register!  Just bring your interest and passion!

———————————————————-

Deployment Deep Dive on Windows 7 Community Tour-Mississauga

Event ID: 1032436872

 

February 8, 2010 6:30 PM – February 8, 2010 8:30 PM Eastern Time (US & Canada)
Welcome Time: 6:00 PM

Microsoft Canada Headquarters

MPR A/B/C
1950 Meadowvale Boulevard
Mississauga Ontario L5N 8L9
Canada

Event Overview

Are you running Windows XP?  Are you feeling the pressure of creating a deployment plan? Have no fear!  Leveraging learning’s from two Windows 7 early adopters this session will give you the skills you need to proceed with your own deployment.  The session will focus on free Windows 7 deployment planning and deployment tools that customize operating system packages and automate deployment planning and network deployments seamlessly. We will dive right into:        

  • How to use the Microsoft Assessment and Planning (MAP) tool to identify your current hardware and application inventory.
  • How to use the Windows Automated Install Kit (WAIK) to build a customized image for your organization.
  • How to use the Microsoft Deployment Toolkit (MDT) to build, deploy and maintain Windows installation images.
  • How to migrate the end users profile from their current installation to the Windows 7 installation using the User State Migration Toolkit (USMT).
  • How to integrate MDT and Windows Deployment Services (WDS) to perform Lite Touch installations of Windows 7.

Finally we will look at how we can leverage the various tools to solve any application compatibility issues you might encounter.  We will look at how you can overcome common obstacles using the Application Compatibility Toolkit (ACT), or larger obstacles using Windows XP Mode and Microsoft Enterprise Desktop Virtualization (MED-V) and even how you can leverage Application Virtualization (App-V) to streamline application deployment and ensure all your applications work!

Please note: there is no cost to attend this event.

FacebookTwitterGoogle+Share

Powershell – List SQL Server Databases

Powershell

Oh my love affair with Powershell gets overwhelming some days.  It really is a troublesome little mistress.

For every time somebody comes up to me and asks “Can this be done in Powershell?” the answer is almost invariably “YES!”

Sometimes the answer takes a bit of thought and bit of effort.

But what I love, is once you design the answer it is almost ALWAYS Neutral of your Infrastructure or Development Environment!  You can take those solutions with you anywhere!

Today we had a question.  “Can’t we just query the SQL servers to see what instances we have?”

I’m not an SQL guy.  I can’t even pretend to be.  I can install it, I can navigate it, I can drop tables and make messes.

But I’m not a SQL guru.

But I DO know that SQL server 2008 Management tools has a Powershell Snapin.  It sits INSIDE the Management Studio but it’s there.

It’s a very Dead simple command to for Powershell people.  Just use the SQL Provider and good old “GET-CHILDITEM”

Yup.

GET-CHILDITEM SQLSERVER:\SQL\SERVERNAME\DEFAULT\Databases

 

Where “SERVERNAME” is the name of an SQL server.  And you can navigate to the different servers this way to by just changing the name.

Now the problem I ran into is if you don’t have credentials, you can’t connect (DUH).  I couldn’t find the answer yet on how to pass alternate credential in the SQLProvider in Powershell.  But I DID discover that the database list on a SQLServer (like a LOT of information in Windows) can be obtained by good old WMI.

 

So the alternate method you can ALSO use to show the Databases on a SQL Server is run a GET-WMIOBJECT against “win32-perfformatteddata-mssqlserver-sqlserverdatabases” (*Yes, it’s a mouthful*)

 

GET-WMIOBJECT win32-perfformatteddata-mssqlserver-sqlserverdatabases

 

Need the list from a foreign computer?  Just drop in the IP address or resolvable name!

 

GET-WMIOBJECT win32-perfformatteddata-mssqlserver-sqlserverdatabases –computer SERVERNAME

 

And of course like everything else in Powershell, passing credentials will validate you if necessary. 

 

GET-WMIOBJECT win32-perfformatteddata-mssqlserver-sqlserverdatabases –computer SERVERNAME –credential DOMAIN\Username

 

Now you’d like that to be readable, because WMI usually gives a LOT of information we don’t need, so just format the output to a table and pick what you need.

 

GET-WMIOBJECT win32-perfformatteddata-mssqlserver-sqlserverdatabases –computer SERVERNAME –credential DOMAIN\Username | format-table Name

See?  And I didn’t even trip on a single “Table” in the “process”.

Yes my worst Pun of the day.

 

Powershell, Enjoy the good life

Sean
The Energized Tech

FacebookTwitterGoogle+Share

Windows Vista and Windows 7 – Deleting old profiles and clean up

Sometimes we ITPros do blunt and stupid things.   Sometimes we do them without thinking.

There and RIGHT and WRONG ways to delete USERProfile data on a workstation.

In the Pre Vista/7 days you could just go in to “Documents and Settings” and DELETE the old user data and all was good.  DONE!

Found something out in Vista and Windows 7.

*AHEM* – Don’t do that.  Or *IF* you do make sure you delete the reference of the user from the registry.  There is a spot in Windows 7 and Vista that says “User Profile for JOHNSMITH is HERE!”

If you do it the old way, just look for an entry under

HKEY-LOCAL-MACHINE\Software\Microsoft\Window NT\CurrentVersion\ProfileList

You’ll find a series of keys, under each one is an entry called “ProfileImagePath”. That will contain the path on the hard drive of where the User profile was.  If you do NOT delete that key you’ll find out the hard way that IF “JOHNSMITH” ever tries to log into that machine again?  He’ll keep getting logged in with a TEMP profile, which is … IRRITATING!

OR If you’re really “Lazy” (AHEM EFFICIENT) you can run a Script with Powershell like THIS to get rid of the offending key. :)

—– Profile Cleaner —–

$OLDUSERID=’John.Smith’
$REGPROF=’REGISTRY::HKLM\Software\Microsoft\Windows NT CurrentVersion\ProfileList’
$PROFLIST=GET-CHILDITEM $REGPROF
FOREACH ( $ITEM in $PROFLIST )

{

$userid=(get-itemproperty registry::$item).ProfileImagePath
if ($userid -like ‘*sean.kearney*’) { $userid; remove-item registry::$item -whatif }

}

—— Profile Cleaner —–

 

Ok that’s not such a lazy script but I just couldn’t RESIST using Powershell to do something :)

Cheers all and clean up your mess the right way

Sean
the Energized Tech

FacebookTwitterGoogle+Share

Powershell – List information being Backed up in DPM

Powershell

One of the nice things in Powershell is that Microsoft has made it so easy to translate information that is sitting in the GUI to useful scriptable data or just even a simple report.

Point at hand.  If you want to show what your DPM server is monitoring or backing up, do you…

 

a) Make lots of screen shots of the configurations and keep them in a binder

or

b) Have Powershell do the work for you in a repeatable manner?

 

Well although I LIKE wasting lots of Color paper on the Company Color Laser Printer, I also prefer being efficient.   Sometimes being “efficient” means sitting down for about 30 minutes to figure how to do it.   But once done you have solid repeatable process.

 

So I decided I wanted a way to be “Efficient”, at a moments notice dump that configuration into something useful that could be read at any time

Now A poke for the DPM team.  Beautiful job in Putting in Powershell, Bad job documenting the Cmdlets.   They DO work but the examples were a little buggy.   

 

But here’s what we’re interested in, two nice CmdLets in DPM called “GET-PROTECTIONGROUP” and “GET-DATASOURCE

The first CmdLet will allow us to list all the available protection Groups in a particular DPM server.

 

Get-ProtectionGroup -DPMServerName MYDPMSERVER

Name                                Protection method
—-                                    —————–
ProtectedFileServers        Short-term using disk
MailServers                       Short-term using disk
 

That’s all fine, but really I wanted to be able to show my boss, at any point in time WHAT we’re backing up.  Make’s him happier.  I like having a happy boss.  That’s where “GET-DATASOURCE” comes into play.  It’s job is to show you the “Source” of the “Data” being backed up.  (well maybe not, but that’s how *I* remember it) ;)

You just have to pipe in a “Protection Group” in the GET-DATASOURCE to get the list.

So I cheat and throw the results in a variable called $GROUPLIST and just do a FOREACH-OBJECT to pull out the lists for each ProtectionGroup.  If you only have one, you can simplify it.

 

$GROUPLIST=GET-PROTECTIONGROUP -DPMSERVERNAME MYDPMSERVER; foreach ( $MEMBER of $GROUPLIST ) { GET-DATASOURCE -ProtectionGroup $Member}

 

And now you have a perfectly viewable and format able list of what you’re backing up.   Where it gets NEAT is if you plug in a GET-MEMBER into the results on a GET-DATA, you can see what OTHER useful information shows up, like say Oooooo the STATUS of those Protection Groups?

 

I am saddened the GUI interface for DPM cannot sit on my PC.  I am brightened and cheered up DAILY when I discover just how MUCH of it is not needed once you start into the DPM Management Shell, with Powershell driving it.

 

Sean
The Energized Tech

FacebookTwitterGoogle+Share

Powershell – Exchange 2007 – List emails matching wildcard for Primary SMTP

Powershell

Dropping or adding a domain normally can be a headache.  Especially in the Enterprise where who KNOWS what the addresses were attached.  One of nastiest headaches in the past was trying to find out the default email address for a User.  in Exchange 5.5?  BHA!  Look at the objects one at a time, or get really good with vbScript and a bottle of Vodka!

But now in Powershell, life has changed for the better.

With ONE line!  ONE Line!  I can find all the users in a particular domain for the default email.  Distribution Groups *OR* Email addresses.  It doesn’t matter.

One line.

All you have to use is the GET-MAILBOX or GET-DISTRIBUTIONLIST Cmdlets.  Each one of those holds the field “PrimarySMTPAddress”.  But the nice part is that field is already a set of data.   So if you’re looking for a user who’s email end’s in a particular domain (say ABC.COM) just run a quick

 

GET-MAILBOX * | where { $-.PrimarySMTPAddress.Domain -eq ‘abc.com’ }

or

GET-DISTRIBUTIONLIST * | where { $-.PrimarySMTPAddress.Domain -eq ‘abc.com’ }

But of course if you’re dealing with over 10,000 plus users you might want to limit it to the odd OU.  That’s quite easy.  Just add in the -ORGANIZATIONALUNIT parameter to the Cmdlet like so.  If we’re in the fictional domain of “FABRIKAM.COM” trying to find our Distribution List from a particular OU.

 

GET-MAILBOX * -Organizationalunit ‘Fabrikam.com/Office/Redmond/Mailgroups’ | where { $-.PrimarySMTPAddress.Domain -eq ‘abc.com’ }

or

GET-DISTRIBUTIONLIST *  -Organizationalunit ‘Fabrikam.com/Office/Redmond/Mailgroups’ | where { $-.PrimarySMTPAddress.Domain -eq ‘abc.com’ }

 

And of course you can get really fancy too once you have this information.   You could just as EASILY modify that same Cmdlet and just SWITCH those users to the new email domain.  No muss.  No fuss!

 

Powershell, It really is so Easy to use!

 

Sean
The Energized Tech

FacebookTwitterGoogle+Share

Server 2008 R2 CORE – In just one line YOU can add a DC !

I had to deploy a new DC at work to take advantage of some of the management capabilities supplied in Server 2008 R2 (Powershell Active Directory Modules) but wanted this DC to be Special.

Yep “Special”.  I wanted a REAL DC.  CORE.  Secure.  Restricted.  

Bet ya thought it was going to be tricky too didn’t you?

Well it isn’t

Thanks to the fact we now have a built in utility in the Core edition called “Sconfig” a LOT of the nasty stuff is easily taken care of.  

You can assign those static IP addresses to your network cards, name your machine, allow management and reboot without any stress on the CORE version of Server 2008 R2.

But Making that  a DC?  I’ll bet you thought I’d pull the last of my hairs out with that one.

Nope.  I *DID* in fact already setup in my test Environment almost just under two years ago a NEW Domain on a single Core box.   So I DID remember the command line structure really wasn’t nasty.  It takes a little typing but thanks to this article on Technet all the information you need is there.

The beautiful part is the process automatically calls up the OCSETUP and gets the Active Directory binaries installed at the same time.   And unlike PREVIOUS Core versions you can extend POWERSHELL to it for better management and Remote CmdLets and Shell sessions.

OH.

the COMMAND LINE.

You were waiting for the command line.  Sorry!

dcpromo /ReplicaorNewDomain:Replica /Password:* /UserDomain:"CONTOSO.LOCAL"
/Username:"AdministratorName" /AutoConfigDNS:Yes /DomainNetBiosName:"CONTOSO.LOCAL"
/ParentDomainDNSName:"CONTOSO.LOCAL" /ReplicaDomainDNSName:"CONTOSO.LOCAL"
/SafeModeAdminPassword:"StupidSecretPasswordYouCanTRemember1"

This is for the ficticious Domain of CONTOSO.LOCAL. You’ll have to tie the lines together of course.  And It also sets your “SAFEMODE” password.

If you’re like to Automate this process?  There are two EXCELLENT articles written by Mitch Garvis and Steve Syfuhs on the subject.

Now if you’re adding this Server 2008 R2 to an EXISITING Domain that ISN’T already running a Server 2008 R2 DC, you’ll have to run a /FORESTPREP and /DOMAINPREP in that order from the ADPREP provided under the SUPPORT folder on the server media.   There are additional objects and Schema that need to be added into Active Directory.

But that takes very little time.  

The best part is if you have Windows 7 and the new RSAT tools.  This configuration allows you to immediately leverage ADWS (Active Directory Web Services) so you can use the new Administrative center on your A/D.  Life for Admins get’s a LOT nicer and easier to work with.  Plus you get the EXTRA bonus of the Active Directory Modules for Powershell V2.  Creating an manipulating users in a SINGLE line!

Sweet!

Enjoy Server 2008 R2 and all it has to offer YOU!

Sean
The Energized Tech

FacebookTwitterGoogle+Share