Wednesday, 9 September 2015

CREATE A SHORTCUT FOR POWERSHELL ON DESKTOP

There are some really helpful scripts out there. Not just for Lync and Exchange. But many other apps and administrative tasks. Sometimes, however, the people who need to run them aren’t well versed in PowerShell. This makes is cumbersome for them to open PowerShell, navigate to a folder containing a script, and execute it with the correct parameters. This often leads to complaints about the difficulty of the process, or those admins just not using that tool. As not all admins have our PowerShell prowess, we can create a desktop shortcut that will allow an admin to simply double-click on it to execute it. Let’s see an example.

For this example, I’m going to use Johan Veldhuis’ very slick sefautil GUI, a wrapper for the Lync sefautil.exe program. Sefautil is a resource kit utility that allows an admin to set things like delegates, call forwarding, and other settings, on behalf of users. Sefautil has some really painful syntax, and a complete lack of error reporting. Using it is often frustrating. Johan’s GUI for it makes life SO much easier, that I found myself using it a LOT.

Let’s say, for the sake of this example, that the script, called sefautil_gui.ps1, is in a folder called c:\_scripts. When you execute Johan’s script, you must pass it a front end pool name using the “-pool” parameter. Normally running it would require something like the following:

.\sefautil_gui.ps1 -poolpool01.contoso.com

With a shortcut, we need to tell it to launch PowerShell, and call the script along with the parameters. The syntax is the full path to powershell.exe, along with the “-command” parameter and the syntax used for the script. The syntax is wrapped in quotes, and prefixed with an ampersand. PowerShell resides at C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe

Give the shortcut a name. We’ll call it “sefautil GUI”. Then click Finish.

Let’s set the starting path. Right click on the newly created shortcut, and click Properties. Click on the Shortcut tab. In the “Start In” field, let’s set it to “C:\windows\system32\WindowsPowerShell\v1.0”.

You may have noticed that the shortcut has the PowerShell icon. While that’s all fine and damn sexy, we might want to change that. That’s simple enough since we’re already on the Shortcut tab, click the Change Icon at the bottom and choose whichever icon you’d like. For mine, I chose the Deployment Wizard icon. This is available by browsing to %ProgramFiles%\Microsoft Lync Server 2013\Deployment and choosing Bootstrapper.exe.

While Johan’s script is a GUI based script, many are not. If that’s the case, we can tweak the session settings a little further. On the Options tab of the shortcut, you can tailor settings like Quick Edit mode, which makes selecting, copying, and pasting easier. Obviously, the Font, Layout, and other tabs provide further control over the experience.

Also note that non-GUI scripts will close the PowerShell window when they are done running, so a script might need to be tweaked to pause before closing. YMMV.

Sunday, 6 September 2015

Here is the step by step migration process for CRM 4.0 to CRM 2011 OnPremise

There are 2 ways you can do a migration from Microsoft CRM 4.0 to Microsoft CRM 2011 on-premise: an in-place migration where you upgrade the existing CRM 4.0 install to CRM 2011 using the very same server(s) OR an upgrade where you migrate to a new CRM 2011 server(s).

If you have the available server hardware, the 2nd approach is probably best. With this approach, the existing production server running CRM 4.0 is not changed. So if your migration goes bad, you haven't affected the production environment. Also, keep in mind that since CRM 2011 requires the latest Microsoft technologies (Windows Server 2008, SQL Server 2008) a lot of people are forced to migrate to new servers anyways.

Here is a step by step guide to migrating using this 2nd approach (where you have new server(s) that will host CRM 2011):

1. Perform a fresh install of Microsoft CRM 2011 on a new server(s). You can have 1 server that hosts both the web application and the SQL databases or you can have 2 servers: 1 to host the web application and 1 to host the SQL databases.

NOTE1: Attached is a zip file that contains the Microsoft CRM 2011 implementation guide in compiled help format.

NOTE2: Ideally, when you create an organization, use a name that does not match your current organization. When you eventually import your current organization, you won't be able to re-use the same organization name if the new organization name you create right now matches your old name. So use a name like "Test company" or "new company".

2. Make a backup using SQL Server Management Studio of your existing CRM 4.0 sql organization database (it will have a name like OrganizationName_MSCRM).

3. Physically copy the backup from step 2 to your new server that will be hosting the SQL Server 2008 databases behind your CRM 2011 install.

4. Create a new sql server database on your new server hosting the SQL Server 2008 databases for CRM 2011 using SQL Server Management Studio. You can give it any database name.

5. Restore the backup from step 2 over your new sql server database from step 4.

6. Open the CRM 2011 Deployment Manager software that is running on your new machine that is running the CRM 2011 web application. Click on the Import Organization Wizard.

8. If you just type in http://server in your browser, your browser will re-direct you to one of these 2 organizations. If you have disabled the "new organization" you may even get an error message when you type http://server/ into the browser as it will try to re-direct you to a "default organization" that you have disable.

9. Each CRM user has a "default organization". See the article for discussion of this issue.

10. Were there any add-ons to CRM 4.0 installed? Normally, Microsoft's guidance says to remove them from CRM 4.0 before you migrate the data to CRM 2011. But that's a bad idea if your trying to do the CRM 2011 conversion without touching your production CRM 4.0 box. This website has some thoughts: