Archive for December 2008

Star Trek

December 30, 2008

While this isn’t exactly tech related…I grew up watching the original Star Trek series (and yes I still laugh at it to this day.) Just watched the trailer for the new movie and it looks interesting…

Advertisements

Task Scheduler 2.0 Email

December 29, 2008

I was originally excited about the new Task Scheduler built into Windows Server 2008 & Vista….I liked the idea of being able to easily select an event from the Event Viewer and schedule a task to trigger when it occurred. I was thinking this would make a really easy way to monitor some simple server stats…for example, anytime a login (failed or successful) occurred I could have an email alert sent. This was nice for servers that I know people shouldn’t be physically logging into on a regular basis.

The part that sucks though is that from everything I’ve read the email is sent using NTLM authentication for Windows SMTP servers. If you’re not using Windows SMTP server the email will still be sent if the server allows anonymous access. Well, if you’re trying to use a non-Windows server on the Internet and it does not allow anonymous access, looks like you’re out of luck.

Time to redo that PowerShell script to email alerts.

For reference, here’s a Technet post with info about the email settings: http://social.technet.microsoft.com/Forums/en-US/winservergen/thread/f087c57c-57b8-4c7f-ba2a-feb04c51f5ba/

Simply option to create a demo

December 23, 2008

I need to create a quick video tutorial for an application and figured it would be much easier to have a little guided demo that shows the actual steps and clicks rather than the long, boring step by step list of what to click. I know there’s tons of apps out there than can create presentations and demos but wasn’t looking for anything fancy. Then I came across this link – How to Create a video Presentation,  which reminded me I could do this from within Windows using the Windows Media Encoder.

After a quick test it looks like it will work…have to see what the end users think to know for sure. If you’re installing on Vista, there’s also a patch available to fix 3 known issues.

Send Email using PowerShell from CSV data file

December 21, 2008

Just finished phase 1 of a project which required sending out an automated survey email to a dynamic list of people. The email message is the same in all of these except for an ID number embedded in a link within the message. Currently the list of emails along with the ID is automatically dumped out of the database nightly into a CSV file so I didn’t need to do anything there just yet.

Here’s the PowerShell script that I pieced together from various sites to get this to work

$EmailFileLocation = “d:\scripts\email\dailyemaillist.csv”
function SendSurvey($SendTo,$EmailID)
{
$SmtpClient = new-object system.net.mail.smtpClient
$MailMessage = New-Object system.net.mail.mailmessage
$SmtpClient.Host = “mailserver.domain.com”
$FromAddress = new-object System.Net.Mail.MailAddress(“email@domain.com”, “Your Name”)
$mailmessage.sender = $FromAddress
$mailmessage.from = $FromAddress
$mailmessage.To.add($SendTo)
$mailmessage.Subject = “Your Message Subject Here”
$mailmessage.IsBodyHtml = 1

# The line below will pull the message body from the specified file
# This is currently commented out to have the message body created within this script but can be changed easily.
# $mailmessage.Body = Get-Content .\emailbody.htm
$mailmessage.Body = “<html><body>
<p>This is an example message.</p>
<p>If this had been an actual message there would be something worth reading here.</p>
<p>bla bla bla…here’s the link example:
$EmailID </p>
<p><br>End of message</p>
</body></html>”
$Credentials = new-object System.Net.networkCredential
$Credentials.UserName = email@domain.com
$Credentials.Password = “Password”
$SMTPClient.Credentials = $Credentials
$SMTPClient.Port = 25
$smtpclient.Send($mailmessage)
}

$Guests = import-csv $EmailFileLocation -erroraction stop
foreach ($guest in $guests) {
SendSurvey $guest.email $guest.number
}

Hope this helps. One other note, if you’re setting this script to run automatically, you will either need to sign the script or change the permissions in PowerShell to allow it to run. You can use the following command to make the change:

set-executionpolicy RemoteSigned

Last but not least, here’s a few of the sites I found info on to get this working:

PowerShell Notes

December 12, 2008

Been doing some projects in PowerShell lately and have found tons of great info available online to learn from. I was reading some old blogs and came across this link that talks about how to include help info in your PS functions:

This sample is from Media and MicroCode:

#.Synopsis
#      Turns a Hashtable into a PowerShell object
#.Description
#      Creates a new object from a hashtable.
#.Example
#      # Creates a new object with a property foo and the value bar
#      Get-HashtableAsObject @{"Foo"="Bar"}
#.Example
#      # Creates a new object with a property Random and a value
#      # that is generated each time the property is retreived
#      Get-HashtableAsObject @{"Random" = { Get-Random }}
#.Example
#      # Creates a new object from a hashtable with nested hashtables
#      Get-HashtableAsObject @{"Foo" = @{"Random" = {Get-Random}}}  

Another cool short PS script I read was doing a lookup on an IP address to find the location. This was posted on the Get-PowerShell blog and shows a really short script to find out the public IP address of the system being run and then do a lookup to find the georgraphical area it is located in.

Wireless Scanner: inSSIDer

December 9, 2008

I heard about this product recently and keep meening to try it out but since I keep pushing it off I figured I’d at least post it here for future reference and in case it helps anyone else looking for a wireless scanner that works in Vista. I used to use NetStumbler but since Vista came out that really hasn’t been an option. I downloaded some other apps which work but not really the same features as NetStumbler. Then heard about inSSIDer which seems pretty cool and they have some other products as well if you do a lot of wireless deployments that may save you some time & money compared to the high end scanners out there.

Tivo nearing retirement

December 9, 2008

I love my Tivo…it is without a doubt one of the greatest tech tools in our house that everyone (yes that includes my 2 year old) uses and loves daily. For mom & dad it means being able to wait and watch shows after the kid is alseep (i.e. quite) and for my son it means being able to watch the same Mickey Mouse Clubhouse for the 40th time in a single week.

The thing I hate about my Tivo is that it seems to be getting old and tired and, if it were a Windows system I would be doing the old “Fdisk – Format – Reinstall…do dah…do dah…” song. The Tivo has lost it’s network adapter repeatedly…at least once every other week, sometimes more. The downloaded shows tend to download almost all the way and then disappear. It’s getting rather frustrating.

The sad part is, when thinking about this…is that I’m apparently a well trained old time Windows user. I just expect the issues and the restarts and deal with it because it’s still better than the alternatives….but then again, I haven’t had a single crash on my Vista system since I installed it. Now if only they could improve the Media center functionality to be equal to Tivo!