Module: ExchangeServices – Functions to stop/start/query Exchange services

April 1, 2014 2 comments

Description

Exchange 2013 logo 128x128Being someone who’s converted from Exchange to Lync, I have the luxury of cmdlets for managing Lync services. This includes starting, stopping, and querying those services. I’ve heard from a few Exchange guys who have said it would be nice if the Exchange guys had the same ability. Sure, you can manually type a PowerShell query each time, but why not convert that into some functions? I’ve created a module that has three functions in it. Start-ExWindowsService, which will start any Exchange service that is not disabled and not currently running. Stop-ExWindowsService will stop all running Exchange services. And finally, Get-ExWindowsService, which will display all Exchange services and their status and startup type.

 

Syntax

Start-ExWindowsService [[-ComputerName] ] [[-Name] ] [-WhatIf] [-Confirm] []
Stop-ExWindowsService [[-ComputerName] ] [[-Name] ] [-Force] [-WhatIf] [-Confirm] []
Get-ExWindowsService [[-ComputerName] ] [[-Name] ] [-WhatIf ] [-Confirm ] []

Installation

Open PowerShell and type $env:PSModulePath. Note that it will generally include two paths. One is to c:\Windows\System32\WindowsPowerShell\v1.0\Modules\. Placing the module in this location will make it available to everyone who uses that computer. The other path is to a subfolder of your My Documents folder. Something like C:\Users\administrator\Documents\WindowsPowerShell\Modules. Placing the module in there will make it available just to you. In either case, unzip the contents of the zip file, including the folder, to the modules folder. One thing to note: if you place the module in your personal modules folder, it will not show in the list when you run Get-Module -ListAvailable. But it will still work fine. Import the module by typing Import-Module ExchangeServices

Download

v1.0 – 04-01-2014 – ExchangeServices.v1.0.zip

Changelog

See the changelog for information on what’s changed/included in each version.

 

Categories: Exchange Server, PowerShell Tags:

Changelog – ExchangeServices

This is the changelog for ExchangeServices. You will find a complete list of released versions, their dates, and the features and issues addressed in each. Please refer to the script’s main page for more information including download links, installation details, and more.

v1.0 – 04-01-2014

  1. Original version
Categories: Exchange Server Tags:

New Syntax Highlighting and Auto-Complete Files for UltraEdit includes PowerShell v4, AD, Lync 2013, and Exchange 2013

March 12, 2014 Leave a comment

Syntax highlighting

Updated the wordfile a little bit. This one includes all previous functions as well as the following:

  1. PowerShell v4 cmdlets (the ones available when you open a new v4 session).
  2. Exchange 2013 SP1 cmdlets
  3. Lync 2013 cmdlets
  4. Active Directory cmdlets

That adds up to 2834 cmdlets/functions that get syntax highlighting on top of the 137 aliases that are also in the file. The file also has variable highlighting, as well as operators and comp operators highlighting.

Formatting changes include the following:

  1. code folding for (), so your long param() blocks can now be collapsed/expanded.
  2. code folding for region/endregion. This mimics the behavior of ISE.

If you’d like to change the colors and/or fonts used for highlighting, go to View>Themes>Manage Themes, as the styling in the wordfile is ignored starting with v20 of UltraEdit.

manage themes

As with all other wordfiles, they are stored in “%appdata%\IDMComp\UltraEdit\Wordfiles\”, unless you change the path in Advanced>Configuration>Editor Display>Syntax Highlighting.

wordfile path

You can optionally set the “Highlight new file as:” to PowerShell, as I do (also shown above).

As soon as you place this wordfile in that folder, you should see PowerShell as an option under View>View as (Highlighting File Type)

view as highlighting

Auto-complete

I’ve also created an auto complete file that contains the same cmdlet/function names as the syntax highlighting file. When enabled, you get tab completion of cmdlet and function names similar to the PowerShell console and ISE. Note, however, that in UltraEdit, you only get auto-complete of the cmdlet/function names, not their parameters.

You can save the file anywhere. Then, go to Advanced>Configuration>Editor>Word Wrap/Tab Settings to specify the location within UltraEdit:

auto-complete path

Then go to Auto-complete and check the box “Show auto-complete dialog automatically” and also enter a number in the box. 5 works for me.

auto-complete options

Now, when typing a cmdlet/function that’s in the auto-complete file, you’ll get suggestions.

auto-complete suggestions

Up/down errors navigate through the list, and tab uses the highlighted suggestion.

Download

UltraEditSyntaxHighlighingAuto-CompleteFiles.zip

Function: Set-PowerPlan – Adjust The Power Plan of a Server

February 25, 2014 Leave a comment

Just something I worked up based on a suggestion by someone. This will change the power plan of the machine it’s run on. This can be critical if you want to ensure that the machine doesn’t go to sleep while an extended process is running. Simply run the function with the desired power plan and the change is immediate. For example:

Set-PowerPlan "High Performance"

The three power plans you can choose from are “high performance”, “balanced”, and Power Saver. That’s all there is to it.

function Set-PowerPlan {
	[CmdletBinding(SupportsShouldProcess = $True)]
	param (
		[ValidateSet("High performance", "Balanced", "Power saver")]
		[ValidateNotNullOrEmpty()]
		[string] $PreferredPlan = "High Performance"
	)
	 
	Write-Verbose "Setting power plan to `"$PreferredPlan`""
	$guid = (Get-WmiObject -Class Win32_PowerPlan -Namespace root\cimv2\power -Filter "ElementName='$PreferredPlan'").InstanceID.ToString()
	$regex = [regex]"{(.*?)}$"
	$plan = $regex.Match($guid).groups[1].value 
	
	powercfg -S $plan
	$Output = "Power plan set to "
	$Output += "`"" + ((Get-WmiObject -Class Win32_PowerPlan -Namespace root\cimv2\power -Filter "IsActive='$True'").ElementName) + "`""
	Write-Verbose $Output
}
Categories: PowerShell Tags: ,

Function: New-TrustedIESite – Add URLs to IE’s Security Zones

February 8, 2014 2 comments

Description

This function probably doesn’t have a lot of users to most people. But in Lync, adding the Simple URL for the Lync Server Control Panel to the Local Intranet zone resolves the issue of having to enter credentials each time. Of course, I like to automate the configuration of things, so I whipped up this little function, and it will be included in some of my build scripts. The script basically creates the required registry entries under HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains. Immediately after running the function, we can see the new entry in Internet Explorer

Internet Explorer Trusted Intranet Zone

Internet Explorer Trusted Intranet Zone

Syntax

New-TrustedIESite [[-url] ] [[-zone] ] []

Zones are as follows:

1 Local Intranet
2 Trusted Sites
3 Internet
4 Restricted Sites

example:

New-TrustedIESite -url https://lyncadmin.contoso.com -zone 1

Will add https://www.lyncadmin.contoso.com to the Local Intranet zone

Download

v1.0 – 02-08-2014 – New-TrustedIESite.v1.0.zip

Script: New-CsLyncRoomSystem.ps1 – Easily Deploy Lync Room Systems

January 28, 2014 3 comments

Description

One of the really cool features of Lync Server 2013 is the Lync Room System. LRS is comprised of a single or dual screen system, video camera, and control unit. This system provides for a rich conferencing experience by providing HD video, touch screens with white-boarding, audio & video inputs, and more. For more information on Lync Room system, see the Product Group’s blog post. To see the systems optimized for Lync, see the catalog.

Deploying a Lync Room System involves several steps, and is outlined (albeit poorly) in the LRS Deployment Guide. I say poorly because from a PowerShell perspective, the 10 steps outlined can be combined down to about 6. Some are Exchange related, some are Active Directory related, and some are Lync related.

What I’ve done is to automate & streamline the process, add a ton of error checking, optimization, and validation. Instead of picking an Exchange server, the script will automatically find and connect to Exchange. It then performs the following tasks:

  1. Create an Exchange mailbox configured as a room resource. Additionally, the description is defined, and the company name on the account is configured (see http://www.ehloworld.com/2266 for why this is important). The room account is enabled. You’re prompted for a password for the account, and that password must conform to the organizations’ password policy for complexity. If the mailbox already exists, which would be common in most scenarios, the script will handle it gracefully, ensuring it’s configured properly.
  2. The mailtip for the account is defined. It merely reminds users to make meeting requests a Lync meeting.
  3. Set calendar processing to AutoAccept so that when the room account is added to meetings, it will automatically accept the request.
  4. The AD account is enabled
  5. The Lync Meeting room is created, and uses the email address for the SIP address. This is important to avoid Exchange Web Services (EWS) issues.
  6. If a LineURI is defined, the meeting room is enterprise voice enabled. LineURI should be specified in E.164 format.

Any other configuration, such as conferencing policies, etc., can be set after the script runs. I’ve used this script to deploy a 70″ dual display SMART Room System.

See the assumptions section below for more info.

Syntax

New-CsLyncRoomSystem.ps1 [[-Alias] ] [[-Name] ] [[-UPN] ] [[-SamAccountName] ] [[-RegistrarPool] ] [[-LineURI]
] [[-CompanyName] ] [-WhatIf] [-Confirm] []

example

New-CsLyncRoomSystem.ps1 -alias nycconfroom -name "New York City Conference Room" -upn "nycconfroom@contoso.com" -registrarpool "frontendpool.contoso.com"

The SamAccountName only needs to specified if it needs to be different than the alias.

Installation

Execution Policy: Third-party PowerShell scripts may require that the PowerShell Execution Policy be set to either AllSigned, RemoteSigned, or Unrestricted. The default is Restricted, which prevents scripts – even code signed scripts – from running. For more information about setting your Execution Policy, see Using the Set-ExecutionPolicy Cmdlet.

Assumptions

  • The SIP address is set to match the SMTP address. This is to avoid issues where the two don’t match and Exchange Web Services (EWS) calls fail.
  • Exchange 2010 or 2013 exists in the environment
  • The user running the script has the appropriate rights in Exchange (Recipient Management or higher) and Lync (RTCUniversalUserAdmin or higher)
  • The machine that the script runs on has both the Lync and Active Directory modules installed.

Download

v1.1 – 02-08-2014 – New-CsLyncRoomSystem.v1.1.zip

v1.0 – 01-28-2014 – New-CsLyncRoomSystem.v1.0.zip

Changelog

See the changelog for information on what’s changed/included in each version.

Changelog: New-CsLyncRoomSystem.ps1

January 27, 2014 Leave a comment

This is the changelog for New-CsLyncRoomSystem.ps1. You will find a complete list of released versions, their dates, and the features and issues addressed in each. Please refer to the script’s main page for more information including download links, installation details, and more.

v1.1 – 02-08-2014

  1. comment help optimized per suggestions at http://www.lazywinadmin.com/2014/01/powershell-tip-adding-help-in-param.html
  2. validation for registrar name
  3. cleaned up param block
  4. validate that FE pool is 2013, exit if not
  5. new version of Set-ModuleStatus

v1.0 – 01-28-2014

  1. Original version

Resetting the Font in Lync Server Control Panel – Goodbye Times New Roman!

January 20, 2014 4 comments

Many people have noticed that after installing the Lync Server 2013 Cumulative Update from October, 2013, that the font in the Lync Server Control Panel changed to Times New Roman from the original Segoe UI font.

LSCP font2

Lots of people commented online that they were not fans of the change (myself included), and wanted it changed back. The issue was raised with Microsoft who verified that there was no change in the font requested when displaying the Control Panel. This was confirmed by looking through the logs. The problem was an Internet Explorer compatibility issue. Servers that have IE 8 don’t exhibit the problem, but those with IE 9 or later, do. Instead of looking at the font defined by MS Shell Dlg registry value (HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\FontSubstitues\MS Shell Dlg), the Control Panel was using the font configured in IE. If you look in Internet Options>Fonts, you see that the Webpage font is set to Times New Roman.

LSCP font

We can get the original Segoe UI font back by simply changing the webpage font option to Segoe UI, closing the Control Panel, and opening it back up. We can also make the change using PowerShell by changing the value of the registry key that gets set when you use the above method. To do so, open PowerShell, and enter the following:

Set-ItemProperty -path "HKCU:\Software\Microsoft\Internet Explorer\International\Scripts\3" -Name IEPropFontName -Value "Segoe UI"

And after restarting the Control Panel, we see it’s back to the way it should be.
LSCP font3

You can set the value to any font, really, including Comic Sans MS, as requested by my buddy Ken “The Hoff” Lasko.

Something to keep in mind is that changing that value does have the potential for changing the way other web pages look as well, as this is more of a work-around than a fix. But I’ve not run into that, yet. I’ll post more info as I get it.

Review: Logitech H650e USB Headset

December 12, 2013 3 comments

Logitech H650e USB HeadsetI have to admit that I’m a heavy user of wired headsets for Lync and Skype. This is really due more to the fact that spare power outlets in my office don’t exist. In fact, the fire marshal had better never show up and look behind my desk. Also, I rarely need to move more than a couple of feet from my desk chair. So the wireless benefit is somewhat lost on me. That being the case, I’m constantly checking out new headsets to see which will be the most comfortable and have the best sound quality.

Logitech’s Lync Optimized H650e headset is a dual ear USB wired headset. But not only dual ear, it’s stereo. While I’m not likely to use it to listen to my extensive hair metal music collection through them, it’s a nice touch. The headband is narrow, light, and very comfortable. The padding is soft, but not so soft that I feel the plastic headband itself. The ear cups are also very soft, and remind me of those found on my Bose QC3 noise cancelling headphones. I’ve worn the headset for several multi-hour calls, and it was comfortable throughout. The sound is fabulous.

One cool aspect of this headset is that the USB cable is flat instead of round. This might not seem like much, but take it from someone who routinely has at least four headsets hanging together. This 7 foot cable just doesn’t tangle. And the integrated control head provides for hook and mute buttons – both of which are Lync integrated. Pressing the mute button on the control head mutes the Lync client – not just the headset. There are also volume up/down buttons on it as well.

Logitech H820e presence indicatorThe mic boom is a flexible rubber that’s easily positioned in any angle you need. It has great, natural sound, so I’m told by those I speak to with it. One cool feature on this is that at the end of the boom where it connects to the ear piece, is a presence indicator. This is designed for people who are behind you. They can see your presence and know you’re in a call. One might think that would be evident merely by having the headset on, but I would point back to the headset being stereo. So a user could be listening to non-call audio. It’s only illuminated when in a call/conference/meeting. A neat idea that would be beneficial in a Dilbert style cube farm.

I really like this headset. In fact, my old favorite, the Blackwire 720, has been pushed to standby status as I use the H650e pretty much exclusively. Great sound, comfortable, and a non-tangling cord are all wins. For a list of $89.99 USD, it’s a fabulous unit that should suit most chair jockeys that don’t need to get away from the desk while on the phone.

Categories: Reviews Tags: , , ,

Customizing the Lync Server 2013 Meeting Page

December 11, 2013 5 comments

In Customizing the Lync Server 2010 Meeting Page, I showed how simple it was to update the Lync Server 2010 Meet page with your organization’s logo. Here’s some info for updating the Lync Server 2013 pages.

Here we see the page with the default “Lync Web App” text image.

original LWA page

That test image file is called LyncWebApp_logo.png. It’s a 350×68 pixel 32 bit .png file. You’ll find the image in two folders: one for the external web site, and one for the internal website:

  1. c:\Program Files\Microsoft Lync Server 2013\Web Components\LWA\Ext\Images\LyncWebApp_logo.png
  2. c:\Program Files\Microsoft Lync Server 2013\Web Components\LWA\Int\Images\LyncWebApp_logo.png

If you’re going to swap out the image, it’s much easier if you overwrite the existing file with your custom file of the same name: just backup the original file first. This will eliminate the need to dive into the code that writes the page. Just create a new file of the same size, and save it into the appropriate folders.

The image background is not actually white. It’s a light gray with an RGB value of R:247 G:247 B:247. If you want to match the blue on the left, it’s R:3 G:110 B:202.

Once you overwrite the existing file, restart the Lync Server Web Conferencing service using either the Services.msc tool, or by using the following in PowerShell:

Restart-Service RTCDATAMCU

Once the service has restarted, you can check out the Meet page by creating a Meet Now, and going to the meeting URL on a machine without the Lync client (to avoid having the Lync client immediately attempt to join the meeting, which would close the Meet web page).

updated LWA page

If you’re hard core and want to tweak or completely overhaul the web page itself, the CSS style sheets are available for the external and internal sites at:

  1. C:\Program Files\Microsoft Lync Server 2013\Web Components\LWA\Ext\Styles
  2. C:\Program Files\Microsoft Lync Server 2013\Web Components\LWA\Int\Styles

Just make sure you back everything up before making changed. Also, I have not paid much attention to if these files get overwritten during a Cumulative Update installation. So keep copies handy in case you need to re-apply your changes.