PowerShell Ping Test

Posted by gygon on Wednesday, November 16th, 2011

Used this little script the other day for a basic network test to an access point I was testing. It just pings the device every 10 seconds (or whatever you set it at) and only outputs when there is an error and the time it occurred. Made for an easy way to leave this running over […]

continue reading

Using PowerShell to monitor a web server

Posted by gygon on Monday, November 14th, 2011

A couple years ago I posted about a PowerShell script that would read in a web page. I used that to setup a basic web site test to go through a list of web sites/servers and make sure they were up and running and email an alert if they were down or the size of […]

continue reading

Monitoring the Event Log with PowerShell

Posted by gygon on Saturday, March 21st, 2009

One of my goals with learning more about PowerShell is to be able to monitor the event logs on servers and notify me via email when certain events happen. The system I’m looking to monitor are not part of a domain, are in remote locations on isolated networks. Some of the main things I’m looking […]

continue reading

Sharing Printer between 32-bit and 64-bit versions of Windows

Thursday, May 22nd, 2014 - Tips, Windows

Ran into this the other day when trying to share an old printer connected to a 32-bit version of Windows Vista to a 64-bit version of Windows 7 where there were it wouldn’t connect. Found this little trick and worked easily enough.

  1. Share the printer on the computer it is attached to as normal.
  2. On the other/remote computer, add a LOCAL (yes, local) printer and choose to create a NEW local port
  3. Use \\CompName\SharedPrinter for the portname, where CompName is the network name of the computer and SharedPrinter is the name of the shared printer.
  4. Now select the driver as normal and you should be good to go.

Original reference post:


Sunday, June 17th, 2012 - Tech, Tips

I’ve tried various tools to keep track of my to-do list/notes in the past including everything from Outlook, Gmail, Notepad, PriorityMatrix, and many more but never stuck with anything longer than notepad (when used in conjunction with mesh) to keep my notes/lists in sync and on multiple computers. Then I found iQ-Notes which so far seems to be working great for what I need.

In addition to providing the post-it note type quick access and the notepad simplicity, it also has additional features baked in that make it my top choice. It has a sync feature built-in, but what I really like about it is that I’m not storing my notes on some random system in the cloud but rather it’s where I want…you use your own system (via FTP/SFTP) to sync the systems. I love this as I don’t worry so much about typing in quick notes while working on something and then having to worry that the info is now or may soon be available for others to see.

There’s other features as well such as multiple tabs on a note (LOVE IT!) and having multiple notes and categories if you want. So you can use the app in many ways. New features have been getting added over time as well. Check it out at  Oh…and the price can’t be beat: free!

Tab key changing window focus

Monday, June 4th, 2012 - Tech, Tips, Windows

This is one of those issues that if it had not happened to me and someone called to tell me they were having this problem, I’d probably think they were nuts! I use the tab key all the time to move between fields, so when it started switching the window focus, I started checking my keyboard to see if the ALT key was stuck as it was acting the same way Windows does when you press Alt-Tab.

After digging around, I found some posts that recommended pressing the keys:  ALT-0-0-9  (press and hotel the Alternate key, then press zero, zero nine.)

This fixed the problem and now back to normal. Not 100% sure if it was the cause but I had installed an updated VMware on the system so that may have been the cause.

QuickBooks Enterprise Business Planner Unable to Print

Friday, December 2nd, 2011 - Tech, Tips

Recently had someone try using the Business Planner tool in QuickBooks (Enterprise v11) and after entering all of the info, ran into an issue with the preview button being greyed out and unable to view the report. After following the instructions on the Intuit knowledge base article, the preview button was now visable but when clicking it, a Printer Not Activated error -30 would appear.

Several phone calls with Intuit support later, and numerous printer re-installs, they determined this is a bug. Version 12 was recently released but we haven’t upgraded yet…so I installed it on a test system and tried again, same issue.

So if you’re having issues trying to view the business planner…save you time and skip it for now.

PowerShell Ping Test

Wednesday, November 16th, 2011 - PowerShell, Tips

Used this little script the other day for a basic network test to an access point I was testing. It just pings the device every 10 seconds (or whatever you set it at) and only outputs when there is an error and the time it occurred. Made for an easy way to leave this running over the weekend and see any time that the device went offline.


function Test-Ping
 trap {$false; continue}
 $timeout = 1000
 $object = New-Object system.Net.NetworkInformation.Ping
 (($object.Send($ip, $timeout)).Status -eq 'Success')

 Write-Host "Running ping test to every 10 seconds. Logs errros to screen. Press <CTRL> C to stop." -Fo Cyan
while ($killswitch -ne 0) {

If (!(Test-Ping {
 Write-Host 'Lost connectivity at: ' $(Get-Date -format "dd-MM-yyyy @ hh:mm:ss") -Fo Red
 Else {
 Start-Sleep 10

Using PowerShell to monitor a web server

Monday, November 14th, 2011 - Featured, PowerShell, Tech

A couple years ago I posted about a PowerShell script that would read in a web page. I used that to setup a basic web site test to go through a list of web sites/servers and make sure they were up and running and email an alert if they were down or the size of the returned page had changed indicating something had changed. It came up recently and figured it would be easier to post here for future reference.

This can definitely be cleaned up and made more versatile but it does what I need it to do and the only changes I’ve made over the last two years has been to adjust the size checks of the websites as changes were made.

# WebSiteCheck.ps1
# Checks websites to ensure they are within the size range for the specified page.
# If site size is out of range, email alert is sent.
# Usage: ./WebSiteCheck.ps1 (-debug)
#   ex:  ./websitecheck.ps1
#   ex:  ./websitecheck.ps1 -debug


if ($debug) { $DebugPreference = " continue" }
write-debug "Starting website check now..."

function Get-Web($url,
    #    Downloads a file from the web
    #    Uses System.Net.Webclient (not the browser) to download data
    #    from the web.
    #.Parameter self
    #    Uses the default credentials when downloading that page (for downloading intranet pages)
    #.Parameter credential
    #    The credentials to use to download the web data
    #.Parameter url
    #    The page to download (e.g.
    #.Parameter toFile
    #    The file to save the web data to
    #.Parameter bytes
    #    Download the data as bytes
    #    # Downloads and outputs it as a string
    #    Get-Web
    #    # Downloads and saves it to a file
    #    Get-Web -toFile
    $webclient = New-Object Net.Webclient
    if ($credential) {
        $webClient.Credential = $credential
    if ($self) {
        $webClient.UseDefaultCredentials = $true
    if ($toFile) {
        if (-not "$toFile".Contains(":")) {
            $toFile = Join-Path $pwd $toFile
        $webClient.DownloadFile($url, $toFile)
    } else {
        if ($bytes) {
        } else {

function SendEmail($SendTo,$SendSubject,$SendMessage)
	$SmtpClient = new-object
	$MailMessage = New-Object
	$SmtpClient.Host = "SMTP.YOURDOMAIN.COM"
	$FromAddress = new-object System.Net.Mail.MailAddress("", "YOUR NAME")
	$mailmessage.sender = $FromAddress
	$mailmessage.from = $FromAddress

	$mailmessage.Subject = $SendSubject
	$mailmessage.IsBodyHtml = 1

	$mailmessage.Body = $SendMessage

	$Credentials = new-object System.Net.networkCredential
	$Credentials.UserName = ""
	$Credentials.Password = "YOURPASSWORD"
	$SMTPClient.Credentials = $Credentials
	$SMTPClient.Port = 25

# Set who the email goes to and what the subject will be.
$sendtoemail = ''
$BaseSubject = 'Website Check: '

# Uncomment the line below to output the retrieved web page to the screen
# write $webpagecall.length
# write $webpagecall

########### Site 1 ##################
write-debug 'Checking Site 1'
$webpagecall = Get-Web ''
write-debug $webpagecall.length
if (($webpagecall.length -lt 15948) -or ($webpagecall.length -gt 15948)) {
   write-debug 'out of range'
   write-debug $webpagecall.length
   $SendSubject = $BaseSubject + 'SITE 1'
   SendEmail $sendtoemail $SendSubject $webpagecall

########### Site 2 ##################
write-debug 'Checking Site 2'
$webpagecall = Get-Web ''
write-debug $webpagecall.length
if (($webpagecall.length -lt 12428) -or ($webpagecall.length -gt 13455)) {
   write-debug 'out of range'
   write-debug $webpagecall.length
   $SendSubject = $BaseSubject + 'SITE 2'
   SendEmail $sendtoemail $SendSubject $webpagecall

########### Site 3 ##################
write-debug 'Checking Site 3'
$webpagecall = Get-Web ''
write-debug $webpagecall.length
if (($webpagecall.length -lt 11000) -or ($webpagecall.length -gt 11005)) {
   write-debug 'out of range'
   write-debug $webpagecall.length
   $SendSubject = $BaseSubject + 'SITE 3'
   SendEmail $sendtoemail $SendSubject $webpagecall

write-debug 'Finished running checks.'

A few notes:

  • Be sure to change the email credentials in the SendEmail function.
  • The Site 1, 2, 3 can be reduced to a single site or have however many sites you want to check added on. Just edit the info for the site you want to check.
  • I left all the size checks as a range as some of the sites I check vary slightly (ex: current date/time) so this allows a range for them to still pass the check and not throw false alarms.
The way I use the script is on a server that has it scheduled to run every 10 minutes. This way if a site goes down I find out pretty quick.

Recover Offline Files and Folders for Vista / Win 7

Friday, November 4th, 2011 - Tech, Tips, Windows

After moving over several systems from an old SBS2003 domain to a new SBS2011 Essentials server, one user noticed that there were several files missing from their documents. To be more accurate, the files were there but they were very old versions of the file, not the current one they had been working on.

After checking the server and the workstation, no other versions of the file were found. Since the old domain used to redirect the “My Documents” folder to the server and use Offline Files, I figured the current version was probably in the offline files on the computer and had never re-synced with the server when the migration was done.

Getting access to this was easy using a Ubuntu live CD to boot up Ubuntu without installing on the workstation. This gives you access to the drive…you can then go to the \Windows\CSC folder and drill down to the domain & username you want to get the files for. Then just copy the files out to another folder on the drive. Reboot back into Windows and you have access to all the files from the Offline files cache.

Set default printer with batch file script

Thursday, November 3rd, 2011 - Tech, Tips, Windows

For some reason QuickBooks seems to like changing the default printer on some workstations. Haven’t found the cause yet but decided to put in this work-around to make everyone happy. Added this to a login batch file that runs on the system to reset the default printer for each local computer:

rundll32 printui.dll,PrintUIEntry /y /q /n “Printer name”

Note that the PrintUIEntry appears to be case sensitive as it was giving me errors when I had it all lower case. Obviously change Printer Name to the actual name of the printer.

QuickBooks Enterprise Scheduled Backups

Wednesday, April 20th, 2011 - Tech, Tips

Recently upgraded to QuickBooks Enterprise 2011 and after setting up the scheduled backups, noticed they weren’t running. Manually backups ran fine but scheduled backups would just create a file in the backup folder called QBTempBackup.tmp followed by the date. After doing some digging around online I found out there’s a QB Backup log file that is located in C:\Users\<username>\AppData\Local\Intuit\QuickBooks\Log\QBBackup.txt Looking in this log, the only error showed Bad Connection Handle used when it tried to run the scheduled backup.

After giving up trying to find a solution online, called support and after some poking around they found the issue. It’s a simple fix that would have saved a lot of time if it was documented somewhere. The local user QBDataServiceUser21 needed to be added to the Shares permissions for the folder with the QB company files. Once the user was added with permissions, the scheduled backups ran without problem.

Running app from Mapped Drive – Avoiding UAC Prompts

Wednesday, March 2nd, 2011 - Tech, Tips, Windows

While reinstalling a Windows Vista system the other day I ran into a problem with the UAC security prompt. The primary applicaiton that is run on this computer is not installed locally but run directly from a mapped drive. Normally the user just clicks on the shortcut and the app launches but after a clean install and all updates I was now getting prompted to enter credentials to allow the app to run. Since the user isn’t an admin and I don’t want them to have admin rights, this was an issue. I knew it can be set as I’d done it before but took a little bit to figure out the workaround I’d used. So for when I forget again, here’s the workaround used:

I setup a batch file (see below) that first checks that the drive is mapped, if not, it will map the drive. Then it will launch the program. This part I had done but was still getting the error. The trick I forgot was that the batch file needs to be placed into a “secure location” in order to run without the elevation request. The three locations that I know of that are considered secure are

  • \Program Files (including subfolders)
  • \Windows\system32
  • \Program Files (x86)\  (including subfolders for 64-bit versions of windows)

Once the file was setup here, I no longer get the security prompts. So the users are happy they don’t get the UAC prompts and I’m happy that I don’t need to give out the admin rights to run apps.

Here’s a copy of the basic batch file used:

If NOT exist R:\somefile.exe (
  net use R: /delete
  net use R: \\\SharedFolder /user:USERNAME PASSWORD /persistent:no
Start /D R: somefile.exe

A reference link on Microsoft Technet: