PowerShell: Improved .bat file

Discovery

I found a great article that describes a great .bat file for running a PowerShelll script!

Read More…

PowerShell: Office365 / Exchange Online migration

Problem

We had an Exchange Server 2007 and we wanted to go to the cloud, because lets face it, the cloud is cool.
So we got a consultant to set up ADFS and all necessary connections so we could start migrating to the cloud.
Problem was, now we had to “migrate” mailboxes and we where not going to do that manually.
Read More…

PowerShell: Check if credentials are valid

Discovery

When I was trying to configure a scheduled task to use a specific service account the task manager did not want to accept my service account credentials.
I wanted a quick way to find out if the credentials I was using where correct. Some quick browsing on the web lead me to this.
Read More…

PowerShell: Using .bat file

Discovery

The one thing I always loved about .bat files is that you can just double click them.
So I use them to run my scripts for actions I use often.

Read More…

Team Foundation Services and PowerGUI – Using PowerShell with Version Control

This is a very comfortable setup.
Version Control combined with the (currently) best PowerShell editor.

Best part is: it’s all free and very scalable.
This setup can be used for teams of every size.

Nicely written and structured article as well.

Mark Rhoades-Brown's Blog

Version control allows you and others to work on the same scripts, check them in and out, etc. By following these steps, it is possible to use version control system for PowerShell as well as a number of other programming languages.

For PowerShell, PowerGUI is by far my favourite GUI/Script Editor, it is free, far superior to ISE (which is improving) and my preference to PrimalScript. Although PowerGUI is my preference for PowerShell development, for pretty much all other scripting, PrimalScript is superb.

Primal’s PowerShell Studio is an excellent PowerShell GUI/Script Editor. It has a similar feature set to PowerGUI, with some advantages and some disadvantages- one thing that it excels at is PowerShell GUI development.

One thing that PowerGUI, PowerShell Studio and PrimalScript all have in common, is that they support the MSSCCI provider/Source Control Plug-in API. The following guide shows you how to install the provider and…

View original post 400 more words

Test GPO WMI filter using Powershell

Very useful when setting up new wmi filters.

Soyka's Blog

GPO WMI filters can get screwed up when edited. Quick way of testing a WMI filter is available using Powershell:

  1. Grab the GPO WMI filter from GPMC and put it into clipboard
  2. in Powershell console:
    gwmi -Query ‘Paste your WMI filter here’
    in words:
    write gwmi -Query ‘ (single qoute)
    paste in your wmi filter
    ‘ (single qoute) 

Result could look like this:
gwmi -Query ‘SELECT ProductType, CSName FROM Win32_OperatingSystem WHERE (ProductType = “1”) AND Not CSName = “CB002021”)

When any results are returned WMI filter evaluates to $true (GPO applies), else $false (GPO does not aplly)

Don’t forget that you get the luxury to test against multiple computer just by adding the -Computername parameter:

gwmi -Query ‘SELECT ProductType, CSName FROM Win32_OperatingSystem WHERE (ProductType = “1”) AND Not CSName = “CB002021”)‘ -Computername PC01,PC02

View original post

PowerShell: Using REST API from MagicCardMarket

Problem

When i’m not doing anything productive I sometimes play Magic: The Gathering.
As a result I have many cards, and most of them I don’t even play. I try selling those cards on magiccardmarket.eu.
While this is a great site for selling, their user interface and especially their inventory listing is not really great.
BUT they have a REST API, and I decided I wanted to get my inventory using PowerShell.
Read More…