Grinding-IT-Out

Your basic ITPro blog... What's going on at work, what I'm interested in.

Thursday, January 26, 2012

Long time, no blog…

So, it has been quite a while since I have posted anything here. Did you miss me? Heh… as if anyone is here.

Anyway, here’s a quick synopsis of the current goings-on around here:

1) Moving forward on our Exchange migration project. This is a biggie. We are currently running to forests/domain side by side. One domain (Win08) hosts everything EXCEPT email. The second domain (Win03) hosts our email. This has not be ideal, to say the least, from a usability and management point. But, we are going to be rectifying that shortly. We are going to be putting in an Exchange 2010 infrastructure in our new domain and migrating everything to that. So, we will finally be able to decommission our old domain and be rid of this multi-domain structure. Looking forward to that!

2) Continuing my ‘developing development’. I finished version 1.0 of my Friendly URL Management App. It is an Arena module and works pretty well, though it is a bit slow form a performance standpoint. I haven’t done any work on trying to optimize it yet. But, it is functioning. Users can visit the page to see which Friendly URLs (fURLs! Just thought of this… and like it!) exists, check their destinations, create requests to add new or edit fURLs, etc. Users can also get a QR Code for the fURL, even choosing the size of the QR Code. The app also has a management component so I can add/edit/remove fURLs from the web interface. All in all, it is a great app and I learned a ton writing it! As always, I have to give huge shout-outs to Nick and Jason for their guidance, input, and mentoring. Thanks guys!!

3) Along the lines of Point 2 above, I have been working on a new Arena App recently. This app is for our Prayer Ministry and is intended to replace an existing app with the same functionality. The existing app is hosted off-site (at a cost to us) and does not leverage any of the functionality/data available to us in Arena. So, I have been working on creating an Arena’ed version of the app. Basically, this is an app to collect prayer requests for various contributors and then create a book/compilation that is distributed to prayer team members. This has been a fun project to work on and, again, I have learned so much. I am excited by the prospect of actually rolling this out for use by our Prayer Ministry.

4) In addition to all of this, I still have my day-to-day work on network management, Windows server admin, backups, etc. etc. etc.

Wednesday, August 17, 2011

IIS7 Virtual Directory Reporting–Part II

My last post was on the topic of IIS Virtual Directory reporting in Powershell. The script worked well and gave me a nice little report that I could then send off to others in our Communications Department, for example, when requested. It wasn’t long after this that it was suggested that we build a webpage that generated this report. Then, our Communications Department could just go view the report for themselves.

Coincidentally, I have been working on improving my web development skills. So, I was asked if I wanted to try and tackle this task. I did and we came up with the following short list of features:

  • Report a list of current Virtual Directories and their httpRedirect – or “Friendly URL” – attributes.
  • Provide a QR Code for each Friendly URL.
  • Link to our Arena assignment page to Add/Change a Friendly URL.
  • FOR ME: A page to create/modify Friendly URLs.

My initial thoughts on how I would accomplish this included parsing the XML in web.config files, traversing physical folders, reading other .config files for the relevant data, etc. It seemed like it was going to be very complicated. Then, as I was researching this project further, I came across the magic that is the Microsoft.Web.Administration Namespace. As you can imagine (or already know if you are familiar with it), this made things MUCH simpler.

Now, I’m no developer (yet), but I am learning and hope to become somewhat proficient someday. I have two great friends, resources, and mentors in Nick and Jason here at Central. With their help, I am actually getting this project built. The goal is to implement it as an Arena module to leverage various Arena features.

I hope to have more to come in the near future as this project develops. It has been fun so far and I have already learned a ton… Mostly, I am learning just how much I DON’T know!

Wednesday, June 22, 2011

IIS7 Virtual Directory Reporting

WARNING: This post is bred out of ignorance. I don’t know much at all about IIS7 administration (it’s new to us) or the IIS7 Powershell cmdlets. Everything below is a result of web searches and trial-and-error. I am completely confident that there is a better and easier way to accomplish this stuff. I would love to hear about it! Thanks!

***

I got a request for a list of our virtual directories and their ‘HTTP Redirect’ settings on our web server. We are running IIS7. I knew that there is a Powershell module for IIS7 management – named ‘WebAdministration’ – so I figured that this would be an easy one-liner… something like:

- Get-WebVirtualDirectory | Select Name, HTTPRedirectDestination

Or something similar…

But, this did not work. After looking around for a while, it looks like the WebVirtualDirectory cmdlets don’t have any capacity to report on, or modify, these settings. Further, some of my vDirs had this information stored in a web.config file in their physical path location and some did not (was it in the IIS metabase?!). I would look at the web.config files of two vDirs that looked the same in the GUI and the web.config files would have totally different settings. I was getting very confused and frustrated.

But, I need this report so I needed a plan of attack. I settled on the following:

  • Get all vDir configurations to be consistent, using a web.config file.
    • Make sure each vDir has a unique physical path.
    • Make sure each vDir has a web.config file with the proper configuration items.
  • Write a Powershell script to list vDirs and pull the redirect destination information out of the web.config file.

To that end, I ended up with the following few lines of Powershell -

$hashTable = @{}

foreach ($virtualDirectory in Get-WebVirtualDirectory)
{
$vdName = $virtualDirectory.Path.Trim('/')
$vdPath = $virtualDirectory.physicalPath
$webConfig = $vdPath + "\web.config"
$webConfigXML = [xml](Get-Content $webConfig)
$redirectDestination = $webConfigXML.configuration.FirstChild.httpRedirect.destination

$hashTable[$vdName] = $redirectDestination
}

$hashTable.GetEnumerator() | Sort Name
From here, I just Out-File the script results to a text file and send the report off. Functional, I guess.
 
*******************
 
UPDATE: I updated this script a bit to add a little more information to the output. I also changed the output object from a hashtable.
 
$vDirs = @()

foreach ($virtualDirectory in Get-WebVirtualDirectory)
{
$vdName = $virtualDirectory.Path.Trim('/')
$vdPath = $virtualDirectory.physicalPath
$webConfig = $vdPath + "\web.config"
$webConfigXML = [xml](Get-Content $webConfig)
$redirectDestination = $webConfigXML.configuration.FirstChild.httpRedirect.destination
$vdCreationDate = (Get-ChildItem $vdPath).CreationTime #.ToShortDateString()

$obj = New-Object object
Add-Member -InputObject $obj -MemberType NoteProperty -Name "Name" -Value $vdName
Add-Member -InputObject $obj -MemberType NoteProperty -Name "RedirectDestination" -Value $redirectDestination
Add-Member -InputObject $obj -MemberType NoteProperty -Name "CreationDate" -Value $vdCreationDate

$vDirs += $obj
}

$vDirs

Monday, May 9, 2011

Test Lab!

So, this is something I have been wanting to do for a long time. Being able to ‘play’ with new technology is a huge benefit in my industry and job.

With our virtualization environment being as robust as it is now, we have some headroom and the ability to put a small lab environment in place. So, I have used this guideline to create a base lab environment.

Looking forward to using this to explore new technologies.

Blog Archive

Additional Info

My Photo
email: support (AT) mangrumtech (DOT) com
mobile: 480-270-4332