Tuesday, October 16, 2012

Adding Hyper-V Powershell cmdlets

I'm brand-new to the virtualization game and this is a great step-by-step for enabling the Powershell cmdlets for Hyper-V.

Virtualization Admin

Wednesday, October 10, 2012

Powering-up The PowerShell

I have never, ever...ever-ever-ever used PowerShell before as I tend to hate all things programming. I've created basic batch files to delete backups, but those are relatively straightforward. For the task I was trying to tackle today, we need to download the differential backup files for one of our databases, unzip them, and then load them into SQL. I wrote this PowerShell script to do everything except the last part (loading into SQL), but tomorrow is a new day. Just a quick note beforehand- you have to use a program like 7-Zip for .bak files because the built-in extractor will not work (trust me, I tried). This is being done on Windows Server 2008 R2 using the latest version of PowerShell. &lf; > I am sure there is a prettier way to do this, but it works and I've got time to refine if it need be.


I have never, ever...ever-ever-ever used PowerShell before as I tend to hate all things programming. I've created basic batch files to delete backups, but those are relatively straightforward.

For the task I was trying to tackle today, we need to download the differential backup files for one of our databases, unzip them, and then load them into SQL. I wrote this PowerShell script to do everything except the last part (loading into SQL), but tomorrow is a new day.

Just a quick note beforehand- you have to use a program like 7-Zip for .bak files because the built-in extractor will not work (trust me, I tried). This is being done on Windows Server 2008 R2 using the latest version of PowerShell.


Set-Location -Path E:\folder\$dtoday

$dToday = Get-Date -Format "yyyyMMdd"

New-Item E:\folder\$dtoday -type directory -Force

$WebClient = New-Object System.Net.Webclient

$source = "http://www.SiteIWantToDownloadFrom.com"

$destination = "E:\folder\$dtoday\Diff.zip"

$WebClient.Credentials = New-Object System.Net.NetworkCredential("username","password")

$WebClient.DownloadFile($source,$destination)

$shell=new-object -com shell.application

$CurrentLocation=get-location

$CurrentPath=$CurrentLocation.path

$Location=$shell.namespace($CurrentPath)

C:\7z.exe x $destination -pMy7zipPassword -oE:\folder\$dtoday </script>

I am sure there is a prettier way to do this, but it works and I've got time to refine if it need be.

Thursday, October 4, 2012

Lenovo Computers & Recent Microsoft Updates

Our laptops, desktops, etc. are all Lenovo products and one of the recent Windows 7 Updates (KB2647753) has been causing all sorts of problems (the machine will reboot, attempt to configure the updates, fail at about 15%, revert the changes, and reboot again). Not exactly sure how Microsoft releases an update that is supposed to fix a problem, but ends up causing another one...oh wait, that's right- because it's Microsoft!

To get around this, install KB2647753 by itself, reboot the machine, and proceed to install your remaining updates.

Microsoft's Answer

Wednesday, October 3, 2012

Introduction

Well, this is my first post of this blog and it probably best to begin with an introduction and why I decided to start this blog. My name is Daniel Goodman, I'm 27 years old, married, no kids (yet), and just moved to the Dallas-Fort Worth area. My wife, Joanna, and I have been married for 5 years. I was in the Air Force from 2003-2010 and split-up my time between a 3C0X1 (Computer Systems Operator) and a 8R000 (Enlisted Recruiter). I bounced around from Lackland AFB, Keesler AFB, Lajes Field AB, Langley AFB, and Peekskill, NY. I currently work as the IT Manager at an automotive finance company in Irving, TX and am attending Texas A&M Commerce for my second Masters in Management.

I decided to start a blog to highlight the various things I'm into- weightlifting, technology, sports, movies, etc.- because I find there are a lot of little projects I get involved in where I have to pool a lot of resources in order to accomplish whatever it is I'm working on. I hope some other people will stumble upon this looking for the same information I was looking for and can use it to their advantage. Here goes nothing!