We recently deployed a five-node CRM 2011 topology using Windows Azure IaaS with the following objectives:

  • Understand how a multiple node CRM setup can be provisioned using Windows Azure IaaS. Specifically, how the networking capabilities offered by the Windows Azure platform (i.e. stateless load balancing) map to the CRM requirements.
  • Develop an automated way to provision and de-provision a CRM setup. This is not only useful for dev and test scenarios, but also for production scenarios where it is notoriously difficult to conduct capacity planning before acquiring the necessary hardware. For example, it is hard to know upfront what CRM functional building blocks (aka CRM roles) the business stakeholders will want to focus on, such as async processes, sandbox, reports, etc. By dynamically scaling out the “needed” features on demand, we can enhance the business agility of the CRM.
  • Offer our customers an educated choice between CRM Online (no setup costs but less control) and CRM On-Premises (extensive setup costs but complete control).
  • Take advantage of hybrid apps that combine CRM capabilities with Windows Azure services, such as Windows Azure Active Directory, mobile services, etc.

Read More…

We’ve reached the end of this series.  In part one, we discussed the basics of PowerShellPart two showed some of the ways to interact with SharePoint via PowerShell.  Today we’ll look at parts of a script I compiled to build out a SharePoint 2013 development virtual machine.

Environment and Build Notes

I want to start off with some notes about the assumptions I took and the configuration I used. First, this VM is running in Hyper-V on Windows 8 and uses Windows Server 2012 which was installed through the GUI. (I’ll try to figure out PowerShell remoting and Hyper-V at a later date, but that wasn’t in the cards for this post.) Second, I’ve configured two virtual networks, one internal with a static IP and one external with a dynamic IP. I configured those through the GUI as well. However, almost everything else has been built using PowerShell. While we’ll only highlight some of the script in this post, you can find the full script at my CodePlex Project: Useful PowerShell Cmdlets.

Read More…

PowerShell is great. It’s a powerful tool/programming language that can help you automate and solve any number of challenges. However, PowerShell files can also get quite ugly. With functions, parameters, inclusions (of other files and libraries) and all sorts of comments, making necessary changes can feel like looking for a needle in a haystack.

I worked on a project recently and saw this ugly side firsthand, through thousands of lines of PowerShell script. Scripting spread out over dozens of files. I fought to learn the pattern of execution, and discovered that making even simple changes had side effects in processes that I didn’t even know were related. To overcome this, my team began using an XML file to maintain the list and order of commands to execute, and then had a simpler, generic PowerShell file to execute everything.

Today, our configuration has grown complex, supporting the installation and configuration of several enterprise software components that need to exist in concert with each other.  Even with the complexities in the XML, it is easy to trace an error to the problem step, make corrections, and continue.

In this post we will lay down a foundation for anyone to build upon and organize their own PowerShell execution process cleanly inside of XML.

Read More…

The first post in this series covered the basics of PowerShell including variables, loops, and decisions. It also introduced a few scripts I’ve used over the last several weeks. In this post, we’ll discuss how to use PowerShell in a SharePoint farm, some of the more useful capabilities (especially to developers), and a few more scripts that I’ve written to bring the topics covered together.

Integrating PowerShell With SharePoint

PowerShell has been natively supported in SharePoint since SharePoint Foundation 2010 and SharePoint Server 2010. When SharePoint is installed, in addition to the Product Configuration Wizard and Central Administration shortcuts, a shortcut for the SharePoint Management Shell is available. This application is a PowerShell console with a blue background and the SharePoint Snap-in loaded. The PowerShell Snap-in is a PowerShell version 1 object that, when loaded, makes additional functions (or cmdlets) available to call in the current PowerShell session. To do this, simply execute the following:

Add-PSSnapin "Microsoft.SharePoint.PowerShell"

This will allow you to access the SharePoint cmdlets in any PowerShell session. It’s also important to run the PowerShell or SharePoint Management Shell console as administrator as the logged-in user may only have limited access to the SharePoint farm.

Read More…

When I apply for speaking engagements, I usually submit at least one session that will require me to learn a new language or technology.  I did this with the upcoming SharePoint Saturday Austin with a session titled “PowerShell for Developers: IT Pros Need to Share.”  This session is the catalyst for this three-part blog series, which will be published over the next few Fridays. This first post is intended to get everyone up to speed with the basics of PowerShell.

What is PowerShell?

PowerShell is a command-line language built on the Microsoft .NET Framework. This is a ridiculously simplified explanation, though. PowerShell is a task automation tool that takes common command-line languages and magnifies their power exponentially through the use of Cmdlets.  Cmdlets are verb-noun commands that perform computer and application management tasks. These tasks can be as simple as restarting the computer or changing the time zone.

PowerShell is a sophisticated development language that contains many of the constructs found in other modern languages. Variables, functions, looping, and decision statements are all present among other important features. We will discuss these features and how they function in this post. Read More…

I was recently working on an automation task that involved opening an XML document, reading the values its contents, and passing them as arguments to install a variety of processes, etc., etc. All rather routine and mundane. Of course, my XML document was littered with environment variables and other special monikers that would be replaced after the file had been loaded. So I reached for my PowerShell editor and started putting together a solution. Then I got to thinking…why don’t I just embed PowerShell variables directly in the file?

Well, why not indeed. The problem was as PowerShell read the file in, it simply ignored my variables and I was stuck with an XML attribute value of something like $Domain\$User. It didn’t help me one whit. Surely there must be some way to convince PowerShell to evaluate that.

As luck would have it, there is! Or I should say, there are! Because it turns out there are multiple ways to do this, none of which are specific to XML (that was just my target data). So, let’s review the options…

Read More…

I’ve been working with Powershell lately, and I wrote a couple of functions to help verify server permissions in Microsoft SQL Server.

Why would I want to verify server permissions instead of verifying server roles? In my case, I’m interested in knowing if a particular user is able to create a database on a SQL Server. While the dbcreator role does allow a user to create a database, there are other roles that will also allow a user to create a database, such as sysadmin. Additionally, if a user is a member of an AD Group that has the role assigned, then the role is not directly assigned to the user. In the end, I found it simplest to check for the actual CREATE ANY DATABASE permission.

In this post, we will see how to check if the current AD user has a specific server permission and how to check if an AD account other than the current user has a specific server permission.

Read More…

This week, many AIS team members are attending the Microsoft SharePoint Conference in Las Vegas, Nevada. We’ll be posting blog posts from each of them as they learn what’s new and what’s exciting during sessions, demonstrations and other conference highlights.

We’re out at the SharePoint Conference 2012 this week and learning a ton about the new features of SharePoint 2013. One of particular interest to the IT pros should be the introduction of PowerShell 3.0. There are a number of new features available in PowerShell 3.0 not to mention the cmdlets!

Read More…

Some end-of-the-week reads from AIS employees’ personal blogs:

Windows Azure Planning: A Post-Decision Guide to Integrate Windows Azure in Your Environment: AIS’ CTO Vishwas Lele posted a complete planning guide on how to best adopt and integrate Windows Azure into your organization. (Fleeting Thoughts)

SharePoint Saturday Cincinnati Session: Clint Richardson (who wrote the excellent three-part series on The Best New Features of SQL Server 2012) presented a Voluntold admin session at last week’s SharePoint Saturday Cincinnati. His presentation, relevant links and PowerShell code are all available at his blog. (pointblankadmin)

Understanding and Using System.Transactions: Ash Tewari has compiled an excellent library of resources to help you understand and effectively use System.Transactions functionality in your .NET projects. (tewari.info)

Adaptive Problems Require Responding to Change Over Following a Plan: More deep thoughts on the Scrum framework and Agile values from Ryan Cromwell. (cromwellhaus)

Aliasing Multiple Properties in Knockout JS Bindings: David Benson figured out another handy use for Knockout JS’s “with” statement: you can emulate c# style “using” directives. (dben codes)

Teach Your Kid to Code: Steve Michelotti (and his 5th grade son!) will be co-presenting a great, fun session called Teach Your Kid to Code at the CMAP meeting next Tuesday evening in Columbia, MD. (Don’t forget to get out and vote early, too.) (Steve Michelotti)

I was recently asked to write my own custom performance metric and publish it to Amazon’s CloudWatch using PowerShell.

Part I: How do I get this thing running already?

I initially used this blog post as a general guide, but since I had some experience with PowerShell already, the real learning part for me was how to call the API through .NET. (There is a second part, which actually shows you how to publish the metric. Unfortunately, his test “Tutorial” namespace ended up in the wrong region [US East] as compared to my instance [US West Oregon].

I figured out the correct way to do this by teasing apart the free community scripts available on AWS, which I will discuss later (see Part 2).

Read More…