Archive | PowerShell RSS for this section

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…

Advertisements

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…

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: Generate (semi) Random Password

Problem

I want to generate a random passwords that meets a few rules.

Read More…

PowerShell: Write-Progress

Problem

I wanted to get a better indication of my scripts progression.
This would definitely be an improvement for the scripts that take several minutes (or even hours) to finish.

Read More…

PowerShell: Convert String to DateTime and vise versa

Discovery

For the hundredth time I Googled how to convert String to DateTime.
It’s time I put it in my memory extension.

Read More…