Automate Bootable USB creation with Powershell–Part 4

So we now have a pile of bootable USB keys.  Woohoo! Now what we need to do is get ROBOCOPY to transfer data to them.   Automating THAT should be quite easy.   For that we have some very simple requirements. All Data is in a folder called “C:\MDTImage\Content” We are going to dump the data to all blank USB drives that fall into the same parameters as before (larger than 8GB, smaller than 64GB) For this we COULD play with DISKPART some more, pull up the DETAIL on each drive and match the VOLUMES somehow, or I could cheat. You see […]

Automate Bootable USB creation with Powershell–Part 3

And now the fun begins.   Getting DISKPART and Powershell to do all the dirty work for us.  Cue the “Muah ha ha haaaaa!” So automating DISKPART is actually very easy.   You have a text file that contains all the commands you need to run and you execute it in the following manner. DISKPART /S Script.txt That’s it! But the challenge when creating a bootable USB key (at least for automating) is the the Disk number for removable devices may not always be the same number, or that you MIGHT have in an external hard drive when you do this. So […]

Automate Bootable USB creation with Powershell–Part 2

So the first challenge was the trickiest part.   Now for the fun!  Making some bootable USB keys! Well not QUITE yet.   We want to be smart about this.  We’re going to define some parameters for a bootable USB key. Think about it.  If I had a script that could just arbitrarily go out and take every disk attached and WIPE it as a bootable device, wouldn’t that be a little dangerous?  So we’re going to be smart about this. First let’s define SOME parameters.   For this to be useful and somewhat safe we’re going to use the following parameters USB […]

Automate Bootable USB creation with Powershell–Part 1

So I sat down the other day and decided I wanted to be able to do something really cool. I wanted to be able to automatically create a bootable USB key, regardless of where it was in the computer. Creating a Bootable USB key is actually not difficult in Windows.   It’s a well documented process that follows the lines of. Insert USB Flash drive into a port Launch DISKPART as Administrator Execute some Commands in DISKPART Use Robocopy to mirror your boot Media or Bootable content to the key. Now in Truth I could write most all of this as […]

Get a List of all Windows TimeZones with Windows Powershell

There is an excellent post on getting and setting the TimeZone done by Pat Richard using Powershell and TZUtil which I thought was absolutely cool. The only thing I noticed was the Script had a defined list for the Time Zones.   Knowing much of this information is contained directly in Windows I was wondering if there was a way to pull the list in and use it as the master. Within .NET there is System.TimeZoneInfo which has a nice simple method called (are you ready?) GetSystemTimeZones So to leverage this method in Windows Powershell all we need to do it […]

The 2013 Scripting Games–Release the Hero Within !

It’s time to release the Inner Hero within!  Compete online and show your skills! The 2013 Scripting Games are here! Novice Users, Experts, Hobbyists!  ALL ARE WELCOME! Thrills! Chills! the Agony of the feet (Oh! Sorry! Socks!) REGISTER NOW at Powershell.Org and join in the fun! [youtube] The 2013 Scripting Games–See for Details The Inner Hero within you is calling.  REGISTER and COMPETE TODAY! Related posts: PowerShell Summit Videos

Powershell–How do I find the Mac Addresses of my Server Network cards?

Here’s a quick one.  A friend was working on a Hyper-V server and couldn’t find the MAC address of a network card.  “It’s not showing up under IPCONFIG as it’s not bound to TCP/IP” Welcome to Powershell.   With Windows Powershell we can query the Win32_NetworkAdapter in WMI. GET-WMIOBJECT Win32_NetworkAdapter This would produce a list of ALL Network Adapters (Physical and Virtual) and their corresponding properties. If you want, you can break that down to “All Physical Network Adapters” which should make your task easy.   GET-WMIOBJECT –query ‘SELECT * from Win32_NetworkAdapter Where PhysicalAdapter=”TRUE”’ This however will still return some phantoms.   So […]

Determining Language Locales and values for MDT 2012 with Powershell

Within MDT 2012 (and previous versions) you can pass along to the operating system certain definitions.  One of these is the default keyboard and language locales.   These are defined by the Variables in CustomSettings.ini or your “Rules” Tab in MDT 2012. The Variables you need to modify are UILanguage=en-US UserLocale=0409:00000409InputLocale= 0409:00000409KeyboardLocale= 0409:00000409 You will also need to supply the following line as well SkipLocaleSelection=Yes To find out the LCID for a French version you can run this line in Windows Powershell [system.globalization.cultureinfo]::getcultures(“AllCultures”) | where { $_.Displayname –like ‘*french*’ } the Returned object in your Console which show you ALL Cultures […]

Getting a list of Windows Language Locales with Windows Powershell

I shall never profess to be a developer.   I just like finding answers.   One of the challenges I had today was finding a list of Language locales in Windows.   I poked about and found an online list posted which could help me out with MDT and programming in the Locales for Non english versions of Windows and Office 365 cached downloads. The problem was the list links from Microsoft weren’t current.   I’m certain there are updated versions (if you have them, email them please or add them to comments) but I went for a programmatic solution.     But I wanted to […]

Listing the MDT Variables with Windows Powershell

I was trying to find out Where MDT got all of it’s lovely variables like %SERIALNUMBER% when I stumbled across this Great post from Andrew Barnes on Variables.DAT. So I popped over and swiped a VARIABLES.DAT file from the WinPE environment and looked at it.   As Andrew stated, it was XML data.  I find reading XML data about as exciting as painting a bathroom wall with a toothbrush. Yes, not all the enticed about it, am I? But I DO love playing with Windows Powershell.  And since it can NATIVELY deal with XML files (unless my poor fuzzy human brain) […]