ScioSoft's Community Blogs Optimized IT musings for the technically inclined

PowerShell: Get OS Installation Date

by James Fielding 18. October 2011 19:43
Here is a quick, and oh-so-easy, one-liner to see when you installed a machine’s Operating System:
([WMI]'').ConvertToDateTime((Get-WmiObject Win32_OperatingSystem).InstallDate)
The main part of the command gets the install date:
(Get-WmiObject Win32_OperatingSystem).InstallDate
The problem is, if you just run this command, the result is not so human-friendly:
20090328134854.000000-240
To fix this up, we can apply the ConvertToDate method, which is actually a Common helper method (that has nothing to do with the Win32_Service WMI class). To do this I used /\/\o\/\/’s method of creating an "Empty" WMI class for this ([WMI]''):
([WMI]'').ConvertToDateTime()
Once we do this, we get a nice, human-friendly result:
March-28-09 1:48:54 PM
Happy OS Dating (…judging by the date on my system, it looks like it is time for a reimage),
James Fielding

Tags: , ,

IT Systems | PowerShell

Launch PowerShell Script from Shortcut

by James Fielding 4. October 2011 21:42

PowerShell is a great system management tool, and can help administrators to quickly perform tasks and collect information.

One frustration many users have with PowerShell is, unlike traditional .bat files, .ps1 files will not run by default due to PowerShell's enhanced security. Now this is OK when you’re dealing with a couple of machines, as a quick PowerShell one-liner at the prompt will fix things up for you:

 Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope Process

But, when you're dealing with a large number of machines, and/or you'd prefer to keep PowerShell’s security settings in place, here's a quick workaround. Run the script via a shortcut that temporarily allows the script to run:

  • In Windows Explorer, create a new shortcut. It doesn’t matter what your shortcut’s target is, as we’ll change that momentarily.
  • Right-click on your new shortcut, and choose “Properties”.
  • Change the shortcut’s Target to the following:
    %SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -File "E:\Scripts\MyScript.ps1" 
    
    Where “E:\Scripts\MyScript.ps1” is the path to the script you want to run.
  • Click “OK”.

From here, you just need to double-click your shortcut to run your script.

Sometimes you won’t want the command window to provide output. For example, say your scripts outputs to a text file. If this is the case, simply add:

-WindowStyle Hidden

Also, if you are using this on machines that could potentially have an altered Powershell profile, you'll likely want to add:

-NoProfile

I often use this trick to run .ps1 scripts locally via a USB flashdrive. For each set of scripts that I need to run, I have a shortcut. Then, I just plug in the flashdrive, and double-click the shortcut. This way, you can quickly run scripts locally on multiple machines. Try it out!

Happy PowerShell Shortcutting,
James Fielding

Tags:

PowerShell

Google, HTML5 and SEO

by James Fielding 31. March 2011 11:15

To use HTML5, or not use HTML5, that is the question...especially when you’re considering Google and SEO.

There are lots of people on both sides of the debate:

PROS & CONS

PROS: Moves the semantic web one step closer, which should help my search rankings (in the long run), and some of the new tags, like <video> and <canvas>, can leave users and clients awestruck, to say the least.

CONS: Not a standard, yet... so I risk having my search rankings and user experience ending up in the crapper.

THE RISKS

In reality, the risks of using HTML5 boil down to three separate issues:

  1. Google will not rank my site properly, because it can’t find my content.
  2. Internet Explorer users with <IE9 will ditch my site, because it won’t look right, or worse, won’t show up at all.
  3. Mobile users with older devices will have a really bad experience when they visit my site.

We’re going to look at all three issues, and how to mitigate them. More...

Tags: , , ,

Web Development | SEO

Google SEO Checklist

by James Fielding 14. March 2011 08:00

Here's a quick checklist to improve your Google ranking:

  • A great SEO plan starts with choosing the right keywords. Develop a good keyword list for each page that will lead searchers to your site. Two good resources are Google’s Keyword Tool and Microsoft Advertising Intelligence. Both tools are actually for search engine marketing (i.e. Pay-per-Click advertising), but the keyword information they provide is invaluable to SEO, too.

  • Use the keywords list from above to pepper your <title> and <meta name="description"> tags. NOTE: Both these tags should be human-readable descriptive statements; don’t use these as keyword dumping grounds. Don’t use any more than 80 characters in the title tag and 200 characters maximum in the description tag.

  • If you feel you must list keywords in your head section, use the <meta name="keywords"> tag; its SEO usefulness is questionable, but you’re not going to be penalized for it as long as you use a small, targeted list (10 words or less).

  • Moving into the <body> of your document, make sure your page’s one <h1> tag has your most important keywords and use <h2> tags to support your keywords, where appropriate.

  • If you have an existing site, fire up your favourite browser, and do the following search (of course, substituting your site's name) using your targeted search engine:

    SITE:yoursite.com -SITE:www.yoursite.com

    This search queries specifically for your site and uses an exclusion filter (“-SITE:”) to remove all indexed results that include the "www." subdomain in your URL. More...

Tags: , ,

Web Development | SEO

Open external links in a new window: Add target="_blank" using jQuery

by James Fielding 5. February 2011 13:32

When it comes to site optimization, there's always lots to do. Richard Florance has a great post on making ASP.NET sites run more efficiently. One thing that Richard doesn't talk about is on the client-side, specifically using jQuery (or JavaScript) to add repetitive, non-critical, page elements and attributes. Here's a quick tip that you can use to reduce a page's size: Add target="_blank" to <a> tags using jQuery.

$("a").filter(function () {
        return this.hostname && this.hostname !== location.hostname;
    }).each(function () {
        $(this).attr({
            target: "_blank",
            title: "Visit " + this.href + " (click to open in a new window)"
        });
    });

The above code filters all the hyperlink tags by hostname, and then adds a target="_blank" as well as a title attribute to each external link. If you don't like the title attribute, change or remove it. You could also take this one step further and add a css class or image/styling directly to each external link to identify them as external (although you could accomplish this using straight css, too); I'll leave this to you. More...

Tags: , , ,

jQuery | Web Design

Corporate Color Palette: 10 Free Online Color Tools

by James Fielding 28. January 2011 14:39

Intro | Part 1

A common color question for a web designer, at least where I live in Muskoka, is, "What tools do you use to build a website's color palette?"

Obviously a shelf of Microsoft and Adobe development tools helps a professional designer "play ball". But more and more, I find myself pulling up some really great online resources...and all are free. Now it used to mean that, at least in the design world, "free" was synonomous with "crappy". Not any more. Here are 10 Free Online Color Palette Tools that will help you knock your website's color scheme out of the park:

Colour Lovers Trends1. Colour Lovers Trends – If you are shopping for a color palette, this is the place to start.

Pros: Expansive and regularly updated Trends list of live A+ designed websites to peruse, complete with each site’s color palette.

Cons: Sciosoft Systems website hasn’t been included in the Trends list, yet.

More...

Tags: , , , , , ,

Business Decisions | Web Design

Corporate Color Palette: Choosing your company's color scheme

by James Fielding 27. January 2011 08:11

Intro | Part 1

In web design, particularly for business, a design consideration that is usually top-of-mind for the designer is choosing the right color palette. Interestingly, the color scheme selection for the client is often relatively low on priority list, usually well behind layout and design elements.

Choosing a Corporate Color Palette

I’m no Ph.D. in color psychology, but I’d be willing to bet this juxtaposition is because a client is often looking at the blank website canvas and saying, “What’s the overall impression we’re aiming for?” Meanwhile, the designer is thinking, “How do we start building pieces to get the overall impression we’re aiming for?” The bottom line is that the client and designer have the same end goal, just different entry points.

A car mechanic understands how to repair cars – not by seeing the car as a single system but as a complex interaction of individual systems – building a website is no different. Color sets the tone, and leads to an overall theme for the site, which gives rise to eye-catching design elements that are laid out to form your TOTALLY AWSOME & AMAZING website. It’s just that easy, right?

Over the next few articles I’m going to delve into choosing a corporate color palette. My hope is to help your company pick a color scheme that works for you, and your customers. I’m gearing this series towards clients (meaning you’ll be hiring someone to build the website for you), but hopefully designers can pick up some tips along the way, too. More...

Tags: , , , ,

Business Decisions | Web Design

Sciosoft Systems: Muskoka Web Design & Development Specialists in Central Ontario

by James Fielding 26. January 2011 20:13

Well, as you can see, we've done a revise on our main website's design theme, as well as matched the new theme to this blog. So let me be the first to say, "Welcome, Welcome, Welcome."

ASP.NET 4, MVC, jQuery, CSS3, HTML5...all the good (and buzz wordy) stuff; we've packed it all in there. It's been a bit of a, "Do what you preach," exercise for us.

We've also introducing our new tag:

Sciosoft Systems: Muskoka Web Design & Development Specialists in Central Ontario

Let me know what you think of our new theme and tag. More...

Tags: , , , ,

General | Welcome

Meta Keyword & Description in ASP.NET MVC via Master Pages

by James Fielding 30. November 2010 21:00

As of late, we've been trying to do some optimization on our ASP.NET MVC base projects that are the starting point for client builds. It is obvious that having META tags, particularly "Description" and "Keywords", on the .aspx pages of our sites is important.  Moreover, the content of the tags has to be easily added to and/or updated on any given view's .aspx page.

As you're undoubtedly aware after Googling this topic, most online help will have you instantiate an BaseViewData class on your Master page or write tags by implementing some variance of a base Page/Interface/Abstract class.

After experimenting with a number of these methods, I concluded that the KISS (Keep it Simple Stupid) principle should apply.

The bottom line is this: Save your sanity, and be thanked by the next guy that has to work on your project. Add a MetaContent <asp:ContentPlaceHolder> to your Site.Master page and be done with it.

When you start a new MVC site, the Site.Master head section should look like this:

<head runat="server">
    <title>
        <asp:ContentPlaceHolder ID="TitleContent" runat="server" />
    </title>
</head>

We're going to add another <asp:ContentPlaceHolder> that contains some default values, More...

Tags: , , , , , , , ,

MVC | Web Development | ASP.NET | SEO

Hosting Your Server: Dedicated vs. Colocation

by James Fielding 22. April 2010 16:21

As hardware costs drop, and the need to control IT costs increases, we’ve noticed that colocation is becoming a viable option for many small and medium-sized businesses (SMB). Whether you're using a Microsoft or Linux-based system,  here’s the bottom line:

Dedicated server(s): You’re renting servers from someone on a server-by-server basis.

With dedicated servers, you pay a premium for not worrying about the hardware: If there are any hardware issues, someone else replaces/fixes it.

Colocation: You’re renting space for your server from someone.

In the case of colocation, you get an allotted amount of physical space in a facility that provides your hardware with power and bandwidth, as well as an ideal environment (e.g. climate control, power supply management, facility security), but what you put in your space is up to you.

What’s Best for You?

Of course, there’s no "one-size-fits-all" answer, but here are some things to consider:

  1. In general, for short-term projects (less than a year), dedicated servers are cheaper and easier. But if your hosting requirements are more than two years in duration, you’ll likely see significant cost-savings in going with colocation.
  2. In the past, it used to be that if you needed only one or two servers, and after factoring for Microsoft license costs, you were left with the non-choice choice: You went dedicated. But today, with MS Small Business Server, and Essential Business Server being really cost-effective alternatives for SMB, we’ve seen a dramatic shift. Now, you can run a Small or Essential Business Server offsite using colocation, which is something that many dedicated server providers won't do for you. This has dramatically shifted the landscape for SMBs looking to implement MS server solutions.
  3. Also, a lot depends on your technical experience and abilities. If you, or a member of your team, is comfortable with computers, then colocation is a reasonable choice. If you know and/or care little about servers, switches, networking, and firewalls, then you may need to factor in the cost of outsourcing this portion of your IT administration.
  4. Finally, if you want to have physical access to your machine, then colocation is the obvious answer for you. More...

Tags: , , , ,

Business Decisions | IT Systems | Server

RecentComments

Comment RSS

The opinions expressed herein are the personal opinions of the contributors and do not necessarily represent the views of Sciosoft Systems Inc.