Fianbakken.com - The source
Coder from the Dark North
  • About

Administering IIS using Powershell – Part 1

By Harald S. Fianbakken On May 19, 2012 · Leave a Comment

A small introduction to how you can administer IIS through powershell, to automate your processes in setting up web-applications, removing them, recycling your application pools and more.

Getting started:

First, you need either IIS 7.5 , or if you are running on an earlier version, you need to download and install the IIS Powershell Snap-in [...]

Continue Reading →

Change network location – Windows

By Harald S. Fianbakken On May 18, 2012 · Leave a Comment

Changing the network location in Windows 7 is nearly impossible from the GUI.

Using the GPEdit and enabling the policy doesn’t help much for Local connections that has no name.

I’ve created the following script to force all NIC interfaces to a “work profile” (category 1).

Use on your own risk:

* Start powershell
[...]

Continue Reading →

Twitter Bootstrap – Dialog extension with ASP.NET MVC3

By Harald S. Fianbakken On May 16, 2012 · Leave a Comment

I created a neat little extension for creating dialogs in MVC3 using Twitter bootstrap in order to make the whole process a little bit more flexible and easier to use.

// Bootstrap (Add this to the end of your file) (function ($, undefined) { $.ajaxSetup({ cache: false }); $(".openModalDialog").live("click", function (e) { e.preventDefault(); var [...]

Continue Reading →

Payex – Neat testable API for C# / .NET

By Harald S. Fianbakken On March 13, 2012 · Leave a Comment

The payex API is awfull to work with by default. Also, theres a lot of boiler plate coding and parsing you need to handle that can be rather boring. In order to make this process more barable

I created a neat little framework wrapping the payex framework into something that is easy to work with [...]

Continue Reading →

MVCMailer – Nullreference exception

By Harald S. Fianbakken On March 6, 2012 · Leave a Comment

I recently installed MVCMailer and configured a couple of emails for sending.

However, when trying to run it I got a Object Not set reference (Nullreference) when populating the body.

The exception trace pointed me to a method get_remoteIp() in the Framework.

There were basically no clues on what failed apart from this. After disassembling the [...]

Continue Reading →

Minimize and merge Javascript/CSS files through Powershell

By Harald S. Fianbakken On March 2, 2012 · Leave a Comment

I recently had to merge all the javascript files to a single file in order to reduce the number of HTTPRequests to the webserver and minimize the load time.

The project was containing quite the few CSS files that should be merged.

Since it’s a production server, I could optimize this further by removing all [...]

Continue Reading →

Writing tests – HttpContext.Current (when code uses Session)

By Harald S. Fianbakken On February 7, 2012 · Leave a Comment

Some people relies on the HttpContext.Current.Session to be present and uses this in their code. While this is a bad practice, it could however be useful to write automated tests for code using the HttpContext.Current.Session.

How to do it however, is not a trivial tasks. But, adding some reflection to your TestInitialize and you have [...]

Continue Reading →

Executing SQL through Powershell

By Harald S. Fianbakken On February 4, 2012 · Leave a Comment

There are a couple of ways to execute SQL through Powershell.

Most of the methods I’ve seen refers to loading the right assemblies, constructing and settings the command object and / or using the dataadapter. This is cumbersome and requires a lot of boilerplate scripting. However, there’s an easier, untold way to do it.

SQLPS [...]

Continue Reading →

Scan files for pattern – Filtering age and length

By Harald S. Fianbakken On January 30, 2012 · Leave a Comment

I’ve recently had to do sysadmin work (again). And by sysadmin job I mean parsing through a lot of logs looking for patterns. This is rather dull. But, why not have some fun meanwhile;)

I wrote this neat little function to just do that (from Powershell):

I called the method Get-Logs, and you can use [...]

Continue Reading →

Powershell – Remove / Move old files – batch

By Harald S. Fianbakken On January 19, 2012 · Leave a Comment

Often it’s useful to perform batch operations on a set of files matching some criteria.

Some usages:

Move (and delete) old logs Make backups of all new files Scan files for patterns

The sample script below can be used to do just that. Using the Get-ChildItem with recurse and filter allows you to get a [...]

Continue Reading →
← Previous Entries
  • Recent posts

    • Administering IIS using Powershell – Part 1
    • Change network location – Windows
    • Twitter Bootstrap – Dialog extension with ASP.NET MVC3
    • Payex – Neat testable API for C# / .NET
    • MVCMailer – Nullreference exception
  • Admin

    • Log in
    • Entries RSS
    • Comments RSS
    • WordPress.org
  • Tags

    .net Active Directory AD Administration ASP.NET Automation C# Captiva Capture Flow CaptureFlow Credentials Documentum Dql earthquake ECM Email EMC IIS Information Management Inputaccel JQuery MVC3 Outgoing email Passwords Powershell Productivity PSRemoting quake Roots2011 Rootsconf Safecontrols Scripting SecureString Sharepoint Sharepoint .net C# SVN Talk Users Virtualbox WCF Webpart Webservices Windows wp7 WPF
"Playing around with Mustache (Nustache for .NET). Pretty awsome templating engine!" — CmdrTchort

Fianbakken.com – The source

Pages

  • About

The Latest

  • Administering IIS using Powershell - Part 1
    A small introduction to how you can administer IIS through powershell, to […]

More

Thanks for dropping by! Feel free to join the discussion by leaving comments, and stay updated by subscribing to the RSS feed.
© 2011 Fianbakken.com - YADB
Platform by PageLines
  • follow:follow:
  • Connect with me Connect with me
  • RSS RSS
  • Tweet with me Tweet with me