RSS

Category Archives: Microsoft

PowerShell – Book review of : Windows PowerShell Best Practices

Windows PowerShell Best Practices

Last week I completed PowerShell Deep Dives which got me excited again to read more about PowerShell. As such, I continued reading the next book on my reading list: Windows PowerShell Best Practices by Microsoft Scripting Guy Ed Wilson.

The book was released late January 2014 and is the most recent book about PowerShell that has been released to my knowledge. This means it includes PowerShell 4.0, Desired State Configuration DSC and references to Windows 8.1 and Windows Server 2012 R2.

In my opinion the book was very well written and contains a good mix of theory, sample scripts and “notes from the field” from many PowerShell specialists. The sample scripts are available for download at Technet Script Center.

The best practices that are described in the book are very recognizable and I had already adopted many of them based on the many great blog posts by the community. In the book they are all bundled and well explained including examples. Where the book really shines though in my opinion is that it describes how PowerShell is used in real-life, how it relates to many other processes within a company and what you need to consider.

I think this book is a must-have for anyone working with PowerShell. For those starting with PowerShell, I recommend first reading the books “Learn Windows PowerShell In A Month Of Lunches” and “Learn PowerShell Toolmaking In A Month Of Lunches” and then read this book.

Notes:

 
 

Tags: , , , , ,

PowerShell – Book review of : PowerShell Deep Dives

PowerShell_Deep_Dives

I’ve had the book PowerShell Deep Dives laying around since August 2013. I had read some parts of it because I follow many of the great PowerShell community members that contributed to it. But I hadn’t gotten to reading it completely yet until now.

The title of the book includes “deep dives” implies very deep technical content and I can assure you, this type of content is present in the book. some of the stuff I still need to wrap my head around to understand properly. On the other hand, other parts of the book are more simplistic which you might not expect from a deep dives book.

The book covers a very broad number of topics and technologies. What I liked is that the articles were written by professionals and community members that are specialized in or are very knowledgeable about this specific topic/technology.

As a result of having the broad number of topics and technologies, not all parts of the book might be relevant to you (especially as a deep dive). I found myself skimming over some parts later in the book since it is very unlikely it is or will become useful for me. This will differ from person to person though, so take a good look at the topics being covered in the table at the end of the article.

All in all it was a good read and I think I’ll use the book mainly as a reference for those times that I need the deep dive insights. The book can be ordered from by example Manning.com and all royalties go to charity: Save the Children

 

Part 1 PowerShell administration
1 Diagnosing and troubleshooting PowerShell remoting (Don Jones)
2 CIM sessions (Richard Siddaway)
3 Collecting and analyzing performance counter data (Arnaud Petitjean)
4 TCP port communications with PowerShell (Boe Prox)
5 Managing systems through a keyhole (Bartosz Bielawski)
6 Using PowerShell to audit user logon events (Mike F. Robbins)
7 Managing and administering a certification authority database with PowerShell (Cadims Podans)
8 Using PowerShell to reduce Active Directory token bloat (Ashley McGlone)
Part 2 PowerShell scripting
9 The 10 PowerShell scripting commandments (James O’Neill)
10 Avoiding the pipeline (Jeff Wouters)
11 A template for handling and reporting errors (Will Steele)
12 Tips and tricks for creating complex or advanced HTML reports with PowerShell (Jonathan Medd)
13 Using and “abusing” dynamic parameters (Bartosz Bielawski)
14 PowerShell type formatting (Adam Driscoll)
15 Scalable scripting for large data sets: pipeline and database techniques (Matthew Reynolds)
16 Building your own WMI-based cmdlets (Richard Siddaway)
17 Turning command-line tools into PowerShell tools (Jefferey Hicks)
Part 3 PowerShell for developers
18 Using Source Control Software with PowerShell (Trevor Sullivan)
19 Inline .NET code (Richard Siddaway)
20 PowerShell and XML: better together (Josh Gavant)
21 Adding automatic remoting to advanced functions and cmdlets (Karl Prosser)
22 Taming software builds (and other complicated processes) with psake (Jim Cristopher)
Part 4 PowerShell platforms
23 PowerShell and the SQL Server provider (Ben Miller)
24 Creating flexible subscriptions in SSRS (Donabel Santos)
25 Inventory database table statistics using PowerShell and SQL Server Management Objects (Robert C. Cain)
26 WSUS and PowerShell (Boe Prox)
27 Provisioning IIS web servers and sites with PowerShell (Jason Helmick)
28 Active Directory Group Management application (Chris Bellee)

 

 
1 Comment

Posted by on June 7, 2014 in Automation, ICT, Microsoft, Powershell, Windows

 

Tags: , , , ,

Introduction to PowerShell – Also relevant for NON Microsoft administrators

Today I had the privilege that many colleagues of mine from Open Line decided to sacrifice their free time and attend my session: “Introduction to PowerShell – Also relevant for NON Microsoft administrators”

The goal of this session was to:

  • Inform people of the advantages of scripting/automation in general.
  • Inform people of the advantages of PowerShell over CLIs and other scripting languages.
  • Inform people that PowerShell is not just for Microsoft administrators.
  • Teach people about the PowerShell basics.
  • Inform people about the many possibilities with PowerShell.
  • Provide people with a lot of practical resources to increase their knowledge and skill.

I really enjoyed the session and got a lot of interactivity and positive feedback. Next up is a follow-up session which will be more of a workshop style.

I’ve uploaded the presentation in PowerPoint and PDF format here:
https://bjornhouben-web.sharepoint.com/Lists/Files/DispForm.aspx?ID=22

Please share this so that others can benefit from it as well.

Notes:

  • I’ve included many useful resources as notes in the PowerPoint presentation, which makes the presentation also interesting to people who are not PowerShell beginners.
  • Also if anyone has suggestions to make the presentation better, please let me know.
 
 

Tags: , ,

OneDrive / SkyDrive – fix for onedrive sync engine host stopped working

As an IT professional I tend to work on multiple systems (tablets, laptops, desktops) and I use OneDrive (SkyDrive) extensively to always have access to the latest versions of my documents.

I love OneDrive, but today when I wanted to continue working on my desktop I got an error : “onedrive sync engine host stopped working”. So first thing I tried was just restarting OneDrive, which didn’t work. Then I figured … ah well let’s just reboot and see what happens.

When this also didn’t work I looked online and saw I wasn’t the only one experiencing this. I also came across the OneDrive Troubleshooter tool. After I ran this, followed the instructions and waited about 5-10 minutes, it worked properly again.

I hope this helps you to resolve similar issues.

Notes:

  • In processes the process shows as OneDrive Sync Engine Host , but the process is still SkyDrive.exe
  • In the application log, an event 1000 was generated with the following information:Faulting application name: skydrive.exe, version: 6.3.9600.17055, time stamp: 0x53291a62
    Faulting module name: unknown, version: 0.0.0.0, time stamp: 0x00000000
    Exception code: 0x00000000
    Fault offset: 0x0000000000000000
    Faulting process id: 0x1050
    Faulting application start time: 0x01cf78c9a55d1428
    Faulting application path: C:\Windows\System32\skydrive.exe
    Faulting module path: unknown
    Report Id: 43b283ee-e4bd-11e3-826f-bc5ff4e873f4
    Faulting package full name:
    Faulting package-relative application ID:

 

 
 

Tags: , , , , , ,

PowerShell – Using PowerShell 5 to automate the installation of your favorite Windows applications

In this blog post I will explain why to automate installations of Windows applications and how you can do this.

Why automate the installation of applications?

But first, why is this useful? Well this depends on your situation and there are probably many good reasons. For me though, it basically boils down to this:

  1. I often reinstall my computers with new (preview) versions of Windows operating systems and having to install applications each time is a waste of time. Also sometimes you forget to install some things.
  2. On a regular basis, friends and family either want me to install or upgrade their PC and I want to provide them with a standard set of programs that most people need/want without having to spend a lot of time on it. By example virus scanner, burning program, media player, codecs, etc.
  3. I want to update existing installed applications to the latest (and hopefully more secure and feature packed) versions.
  4. When installing applications, there are often checkboxes enabled to install other applications (you generally don’t want to install). Automated solutions using packages generally prevent these additional unwanted applications from installing.

Which tools to use to automate the installation of applications?

Before PowerShell 5 preview was released, I used both Ninite and Chocolatey to perform to automate installations. They both have their advantages as described on this wiki page.

The PowerShell 5 preview version of OneGet installs and searches software from Chocolatey repositories, but support of additional repositories will come in subsequent versions.

How to automate the installation of applications using PowerShell 5 preview?

To automate the installation of applications a couple of things are required:

  1. You need to determine which applications you want to install automatically.
  2. You need to determine the package name that Chocolatey uses for this application. Options include:
    -Using a browser to browse the Chocolatey packages
    -Using PowerShell and a part of the name of the application you’re looking for. By example if you’re looking for Irfanview, use:
    Find-Package -Name “fan”
  3. Store the package names to install somewhere (e.g. in a .txt file on OneDrive for easy access). My .txt file by example includes:
    AdobeReader
    Directx
    ffdshow
    Flashplayerplugin
    GoogleChrome
    Imgburn
    IrfanView
    Javaruntime
    Keepassx
    Mp3tag
    mpc-hc
    PDFCreator
    Silverlight
    TeamViewer
    Totalcommander
    Winrar
    greenshot
  4. Use the Install-Package cmdlet to install all the packages whose name is in the file from step 3.
    Install-Package -Name (Get-Content C:\OneDrive\AppsToInstall.txt) -Confirm:$False
  5. Wait for the programs to install

My opinion

It’s great to be able to use PowerShell to install my list of favorite applications similar to like I did with Chocolatey and I’m also looking forward to see what benefits the additional repositories will bring in the future.

I did encounter some errors however while trying to install some applications like Firefox and dotnet3.5. But since it’s still a preview, this will probably be fixed.

For regular users, I think they are better off sticking to by example Ninite because they’re often afraid of anything that involves a CLI.

Blog posts by other people about OneGet

Some other people have also blogged about the OneGet module and have gone in more technical detail, so be sure to take a look at their posts as well:

More information about PowerShell 5 Preview including a download link

Windows Management Framework v5 preview, includes also Desired State Configuration (DSC) improvements and NetworkSwitch commandlets to manage network switches that pass the Certified for Windows Program. For more information including a download link, you can read the initial blog post. : Windows Management Framework V5 Preview

 

 

 

Tags: , , , , , , , ,

Microsoft – Passed the free exam 74-409 Server Virtualization with Windows Server Hyper-V and System Center

As I mentioned earlier, Microsoft is offering free exam vouchers for the new exam “74-409 Server Virtualization with Windows Server Hyper-V and System Center”. For more information, take a look here.

I took the exam today and passed after having studied very hard for over a week (including pulling an all nighter today). I’m happy to have my first certification for the year 2014 already though :)

In my opinion the exam contained too many repeating (easy) questions on specific subjects, but there were also some very difficult questions about really specific situations. I personally would’ve preferred more “medium difficulty” questions.

All in all I learned a lot from preparing for the exam and I’m very happy with all the new things Microsoft has added to their new products.

If you are looking to take the exam as well, take a look at my previous post that contains the resources I used for preparation.

Good luck and enjoy. I’ll be going for some well earned sleep now :)

 

Tags: , , , , , , , , ,

 
Follow

Get every new post delivered to your Inbox.

Join 867 other followers

%d bloggers like this: