My First Experience w/ PowerShell 3.0

PowerShell LogoYou are all lucky enough to read about my first experiences with PowerShell! For those of you that do not know, PowerShell is a scripting language; which is used for creating temporary fixes and to automate repetitive tasks. I am going to start with the implementation and getting PowerShell working, then onto some basic terminology towards the end of the post.

 Getting Up and Running with PowerShell

1. Download Windows Management Framework 3.0 from Microsoft – Download Here

2. You may or may not need to install .NET Framework 2.0, 3.0 or 4.0 depending on your OS

3. I recommend using old DOS commands to familiarise yourself with PowerShell (all old DOS commands still work), otherwise Here are some usefull PowerShell cmdlets.

The Cmdlet

As in all previous PowerShell versions, Microsoft uses the term Cmdlet (command let); a Cmdlet is a built in PowerShell command, which corresponds to a single verb-noun pair. A Cmdlet is often followed by an alias, if I want to get the mailbox properties for a user on Exchange, I would run the following for example: ‘Get-Mailbox as366498 ’ Note that ‘Get-Mailbox’ is the cmdlet and ‘as366498′ is the alias. If you do not specify an alias, you will get a list of all the mailbox objects.

Get-Mailbox ran in PS ISE with Alias

In order for you to be able to run the PowerShell script above;

  • You need to have the correct permissions
  • You will need to connect to the mailbox server you are trying to get data from and also authenticate yourself

For pretty much every task you want to complete in your enterprise environment, there is most likely a PowerShell cmdlet which will cater for it!

The Pipeline (|)

Pipelining, was created by Microsoft and could almost be described as PowerShell’s signature tune. Your probably asking yourself ‘what even is a pipeline?’. well, a pipeline is this.. (|) without the brackets either side. PowerShell encourages you to join two statements so that the output of the first clause, becomes the input of the second clause (‘piping the result’ to the second cmdlet).

HELP ME PowerShell !

One of the things i love about PowerShell is that the ‘help’ is clear, concise and full of useful examples. If you dont have many colleagues that are always in the office, and they aren’t always around to help you, you can assure PowerShell is!

All that you need to query the vast help information store, is either put ‘help’ before the cmdlet, for example, help Get-Mailbox; or else append ‘-?’ for example, Get-Mailbox-? (hyphen question mark).  The executable powershell.exe even has its own help, try this at the PS prompt, type:  powershell -?

Overall, this experience has been somewhat enjoyable and I am happy to say I will be relying on PowerShell throughout my ne career!

Until next time…..

Directory Synchronization 102 Error

Dirsync password expiration is something we see crop up – especially in test Office 365 environments.  Whilst the system as a whole will not be affected it will be difficult to migrate users and ensure data is correctly populated in the cloud.  Signals of this problem are evident, as per the screenshots below.  This is from the Dirsync server:

Directory Synchronization 102 Error

In the Microsoft Online Portal this problem is fairly evident when you login as an administrator:

Office 365 Portal Directory Synchronization Issue

If the password has changed (or needs changing, re-run Dirsync setup on the Dirsync server and re-enter user credentials.

Directory Synchronization Update Password

We’ve updated our migration tool Ascend to detect this problem automatically, details to follow.  You could also change the user password not to expire, as would usually be set for on-premise service account passwords.

Boot-Camp Week 6 – Time Flies

It feels like I am writing a new blog post to you guys every day, the weeks seem to be flying by so fast!  We started off by carrying on where we left off last Friday, which was writing SQL statements and JOINS.

QA Apprenticeships

After going back over what we learnt previously, we then later moved on to talk about:

  • SQL Updates and Referential Identity
  • Defining and using views
  • Summarised and  sub – queries
  • SQL EXAM
  • ADO.NET
  • Introduction to Stored Procedures
  • LINQ primer with Entity Framework
  • Introduction to web development
  • Web Application architectures
  • HTML and  XHTML

As you can see, it has been a pretty busy week, both physically and mentally due to the amount of homework and the late nights doing it.

The leap from last week’s SQL topics to this week’s SQL INSERT, UPDATE and DELETE statements and also the summarised queries which consisted of MIN, MAX, AVG, COUNT statements.

We then faced a SQL City & Guilds exam which was based around everything we had learnt over the past week or so whilst studying the SQL topics. Towards the back end of the week I was awarded with a distinction for the exam. As you can imagine I was over the moon, a little bit of hard work really does go a long way!

Another topic I especially enjoyed was when we were learning how to write LINQ and lambda expressions in a C# project. I used Visual Studio to create an entity data model whilst using the Entity Framework to connect my database with my Windows Forms project. I particularly liked this because we were basically creating a new user friendly UI for a database which would normally be used in the real world.

Towards the end of the week we were given an introduction to web development and also the languages, software and tools involved, along with the actual architecture itself. I have previously written HTML code with a separate CCS file for a music artist, so I felt confident on those terms but I still think it will be good practice to still pay full attention, as I will most likely pick up bits of information I may have missed in the past.

Overall I think this week has been very productive. I’ve learnt that a little bit of work truly does go along way as I succeeded in gaining top marks in my SQL exam. I am looking forward to carrying on with web development and MVC3 next week.