Archive

Posts Tagged ‘PowerShell’

Changelog: New-ExpiringCertificatesReminder.ps1

September 14th, 2012 No comments

This is the changelog page for New-ExpiringCertificatesReminder.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.3 – 02-13-2017

  1. added parametersets to param block
  2. code optimization
  3. updated Remove-Variables to v1.1
  4. updated domain name info and comment help block

v1.2 – 01-27-2014

  1. -noprofile switch added to install routine
  2. minor code tweaks per best practices

v1.0 – 09-11-2012

  1. Initial version
Categories: PowerShell Tags: , ,

Script: New-ExpiringCertificatesReminder.ps1 – Receive a Reminder When Certificates Have Expired/Are Expiring

September 14th, 2012 2 comments

Detailed Description

Sometimes we’re so deep in projects or putting out fires that some things just get forgotten, or we don’t get that far down the “to-do” list. Some of those things aren’t that big of a deal and don’t impact users. Other tasks can have drastic impact. Such as forgetting to renew your server certificates. It’s true that some services like the phenomenal DigiCert will remind-you-to-death about certs that are expiring. But not all services do that, or they do it once and are forgotten. Other certs, like internal certs, don’t generate a reminder – and some environments don’t allow, or aren’t configured to automatically renew internal certificates. So this lazy, forgetful guy decided to do something about that. A script was born.

This script monitors certificates in the Local Machine store on the local server, and sends a reminder when a cert is expiring soon, or has already expired. An example is shown below.

Sample email about an expired certificate

Sample email about an expired certificate

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.

Download the script and ImageFiles.zip files from the DOWNLOAD section below. Copy the image files to a location available to all users who will receive the reminder email. I suggest a web server with public access. NOTE: These images are the SAME files and names as the ones for New-PasswordReminder.ps1, so you can use the same path if you use both scripts.

Open the script in a text editor and edit the variables in the param block to suit your needs. At a bare minimum, you need to adjust:

  • $Company – this should be your company name
  • $PSEmailServer – this is the email server the script will send the emails to
  • $EmailFrom – this is the SMTP address that the emails will come FROM
  • $EmailTo – set this to the SMTP address of the user/distribution group that should receive the reminder emails
  • $HelpDeskPhone – if not empty, this appears in the email message
  • $HelpDeskURL – if not empty, should be a URL to a web version of the email. If blank, the “If this email does not appear…” and “This email was sent by…” lines shown in the above example are not included.
  • $ImagePath – where the images are stored. This should be publicly reachable for users checking email from mobile devices and web clients

optionally, adjust $threshold from the default 15 to indicate how many days in advance the script should start reminding about an expiring certificate.

Save the script.

If you don’t already have a Receive Connector in Exchange to allow PowerShell scripts to send email, create one using the information at Creating A Receive Connector To Use For Sending Email From PowerShell.

If you have certs that are already expired, or are expiring soon, you can manually run the script to test. To do that, open PowerShell and type

New-ExpiringCertificatesReminder.ps1

Once everything is done, you can run the script in Install mode:

New-ExpiringCertificatesReminder.ps1 -Install

and the script will prompt for the user password, then automatically create a scheduled task on the local server to run every day at 7:30am. You can open the Scheduled Tasks GUI and adjust parameters as needed, but I’ve found the defaults to be fine.

Repeat on any other servers you’d like to monitor.

Donations

I’ve never been one to really solicit donations for my work. My offerings are created because *I* need to solve a problem, and once I do, it makes sense to offer the results of my work to the public. I mean, let’s face it: I can’t be the only one with that particular issue, right? Quite often, to my surprise, I’m asked why I don’t have a “donate” button so people can donate a few bucks. I’ve never really put much thought into it. But those inquiries are coming more often now, so I’m yielding to them. If you’d like to donate, you can send a few bucks via PayPal at https://www.paypal.me/PatRichard. Money collected from that will go to the costs of my website (hosting and domain names), as well as to my home lab.

Download

v1.3 – 02-13-2017 – New-ExpiringCertificatesReminder.v1.3.zip

v1.2 – 01-27-2014 – New-ExpiringCertificatesReminder.v1.2.zip

v1.0 – 09-14-2012 - New-ExpiringCertificatesReminder.v1.0.zip

ScriptImages.zip – these are the images specified in the emails

Changelog

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

Categories: PowerShell Tags: ,

Changelog: New-FirewallRule

September 14th, 2012 No comments

This is the changelog page for New-FirewallRule. 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 – 09-14-2012

  1. Initial version
Categories: PowerShell Tags: ,

Script: Grant-CsPolicyByADGroup.ps1 – Assign Lync/Skype for Business Policies to Users According to AD Group

September 10th, 2012 13 comments

Lync 2013 logo 128x128This idea is from a LinkedIn post that I responded to. The original poster wanted to know if there was a way to manage Lync external access policies based on AD group membership. Absolutely!

This is a fairly simple script that uses a scheduled task that runs every 4 hours, looks at the members of a given AD security group, including nested groups, and applies a Lync policy to each member. The name of the AD security group and the type and name of the policy are all configurable. The ActiveDirectory and Lync PowerShell modules are used to complete this. The actual moving parts are pretty simple – really just two lines of code. But some extra error catching, installation code, and safeguards make it a tad bigger.

Caveat – users get policies when they launch the Lync client. So even though a policy might be assigned to a user, they won’t see any change until the client is restarted.

Caveat #2 – if you configure this script with several scheduled tasks to handle different policies and different AD groups, make sure users don’t end up in multiple groups, or you could have unintended results. Also removing a user from a group does NOT revert their policy back. The reason I didn’t add that is because moving a user from one group to another could cause problems if the script set them back to a default policy, yet another group needed to change it to a different policy.

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.

Download the script from the DOWNLOAD section below. Open it in your favorite text editor.

Find the line that reads

[string]$GroupDN = "",

and put the Distinguished Name of the group in between the quotes. For example

[string]$GroupDN = "CN=Lync Policy Group,DC=contoso,DC=com",

Next, define the policy that will be granted to members of the group. Find the line that reads

[string]$PolicyName = "",

and put the name of the Lync policy in between those quotes, such as

[string]$PolicyName = "Executives External Access Policy",

The last thing we need to do in the script file is define what KIND of policy we’re going to grant.

Find the line that reads

[string]$PolicyType = "ExternalAccess",

And adjust accordingly. The allowed values are Archiving,Client,ClientVersion,Conferencing,ExternalAccess,HostedVoicemail,Location,Mobility,Pin,Presence,Voice to represent the various types of policies you can apply to a user. The default is ExternalAccess.

Next, ensure that the server where the script will run has both the ActiveDirectory and Lync PowerShell modules installed. Domain controllers typically have the ActiveDirectory module, and Lync servers have the Lync module. Install the appropriate ones using these steps.

To install the ActiveDirectory module, open PowerShell and type the following:

Import-Module ServerManager
Add-WindowsFeature -name AD-Domain-Services -IncludeManagementTools

To install the Lync Server Management Tools, which includes the PowerShell module, install the core components. See Install Lync Server Administrative Tools for details.

This will ensure that both modules are available. The ActiveDirectory module is used to get the members of the AD security group, and the Lync module is used to actually grant the policy.

The script must run as a member of the CsUserAdministrator or CsAdministrator groups, as those have the rights to assign policies.

Next, open PowerShell and run the script with the -install switch. The script will prompt for the password of the currently logged on user, and then create the scheduled task to run the script every 4 hours.

Grant-CsPolicyByADGroup.ps1 -install

The scheduled task will run every 4 hours, with a start time of when you ran the -install option. You can open the scheduled task in Task Manager and adjust as needed.

You can run the script manually as well. Just run

Grant-CsPolicyByADGroup.ps1

Note that it may take a while before the policy is visible on the user account due to AD replication.

Donations

I’ve never been one to really solicit donations for my work. My offerings are created because *I* need to solve a problem, and once I do, it makes sense to offer the results of my work to the public. I mean, let’s face it: I can’t be the only one with that particular issue, right? Quite often, to my surprise, I’m asked why I don’t have a “donate” button so people can donate a few bucks. I’ve never really put much thought into it. But those inquiries are coming more often now, so I’m yielding to them. If you’d like to donate, you can send a few bucks via PayPal at https://www.paypal.me/PatRichard. Money collected from that will go to the costs of my website (hosting and domain names), as well as to my home lab.

Download

v1.7 – 02-03-2017 – Grant-CsPolicyByADGroup.v1.7.zip

v1.6 – 09-23-2014 – Grant-CsPolicyByADGroup.v1.6.zip

v1.5 – 02-08-2014 – Grant-CsPolicyByADGroup.v1.5.zip

v1.4 – 01-27-2014 – Grant-CsPolicyByADGroup.v1.4.zip

v1.2 – 10-16-2012 – Grant-CsPolicyByADGroup.v1.2.zip

v1.1 – 09-19-2012 – Grant-CsPolicyByADGroup.v1.1.zip

v1.0 – 09-10-2012 – Grant-CsPolicyByADGroup.v1.0.zip

Changelog

See the changelog for this script for a description of changes with each release.

 

Changelog: Get-CsVoiceCalls.ps1

June 12th, 2012 No comments

This is the changelog page for Get-CsVoiceCalls.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.4 – 06-12-2012

  1. Added some additional code to handle named SQL instances better. Still needs some testing in more environments.

v1.2 – 06-05-2012

  1. Original version

April 2012 Technical Rollup: Unified Communications

April 6th, 2012 No comments

News

Premier

OpsVault – Operate and Optimize IT http://www.opsvault.com

Microsoft Premier Support UK – Site Home – TechNet Blogs http://blogs.technet.com/b/mspremuk/

Antigen & Forefront

Forefront Team Blog – Site Home – TechNet Blogs http://blogs.technet.com/b/forefront

Forefront Server Security Support Blog – Site Home – TechNet Blogs http://blogs.technet.com/b/fssnerds

Exchange

Exchange Team Blog – Site Home – TechNet Blogs http://blogs.technet.com/b/exchange/

MCS UK Unified Communications Blog – Site Home – TechNet Blogs http://blogs.technet.com/b/msukucc

  1. Demystifying the CAS Array Object – Part 2 http://blogs.technet.com/b/exchange/archive/2012/03/28/demystifying-the-cas-array-object-part-2.aspx
  2. Demystifying the CAS Array Object – Part 1 http://blogs.technet.com/b/exchange/archive/2012/03/23/demystifying-the-cas-array-object-part-1.aspx
  3. Exchange Server Deployment Assistant Update for Exchange 2010 SP2 and Office 365 Hybrid Deployments http://blogs.technet.com/b/exchange/archive/2012/03/21/exchange-server-deployment-assistant-update-for-exchange-2010-sp2-and-office-365-hybrid-deployments.aspx
  4. Check out Microsoft Script Explorer for Windows PowerShell (pre-release) http://blogs.technet.com/b/exchange/archive/2012/03/14/check-out-microsoft-script-explorer-for-windows-powershell-pre-release.aspx
  5. Exchange Client Network Bandwidth Calculator Beta 2 http://blogs.technet.com/b/exchange/archive/2012/03/09/exchange-client-network-bandwidth-calculator-beta2.aspx
  6. Introducing: Log Parser Studio http://blogs.technet.com/b/exchange/archive/2012/03/07/introducing-log-parser-studio.aspx
  7. MEC is Back! http://blogs.technet.com/b/exchange/archive/2012/03/06/mec-is-back.aspx

Lync

NextHop – Site Home – TechNet Blogs http://blogs.technet.com/b/nexthop/

DrRez: Microsoft Lync Server Technical Reference Hub http://blogs.technet.com/b/drrez/

  1. Lync Server 2010 Updates Now Available: March 2012 http://blogs.technet.com/b/nexthop/archive/2012/03/28/lync-2010-updates-now-available-march-2012.aspx
  2. Lync Server Documentation Update: March 2012 http://blogs.technet.com/b/nexthop/archive/2012/03/15/lync-server-documentation-update-march-2012.aspx
  3. Lync Wikis—Start a Wild and Wooly Conversation http://blogs.technet.com/b/nexthop/archive/2012/03/15/lync-wikis-start-a-wild-and-wooly-conversation.aspx
  4. Deploying and Troubleshooting Lync Server 2010 MSPL Applications http://blogs.technet.com/b/nexthop/archive/2012/03/14/deploying-and-troubleshooting-lync-server-2010-mspl-applications.aspx
  5. Lync 2010 Training Release Updates http://blogs.technet.com/b/nexthop/archive/2012/03/09/lync-2010-training-release-update.aspx

Outlook

Outlook Blog http://blogs.msdn.com/b/outlook/default.aspx

Other

The Master Blog – Site Home – TechNet Blogs http://blogs.technet.com/b/themasterblog

Documents

Exchange

Exchange Server 2010 SP2 Help
This download contains a standalone version of Microsoft Exchange Server 2010 SP2 Help. http://www.microsoft.com/download/en/details.aspx?id=28207

Microsoft Exchange Server 2010 Install Guide Templates
You can use these templates as a starting point for formally documenting your organization’s server build procedures for servers that will have Microsoft Exchange Server 2010 server roles installed on them. http://www.microsoft.com/download/en/details.aspx?id=17206

Best Practices for Virtualizing Exchange Server 2010 with Windows Server® 2008 R2 Hyper V
The purpose of this paper is to provide guidance and best practices for deploying Microsoft® Exchange Server 2010 in a virtualized environment with Windows Server® 2008 R2 Hyper V technology. This paper has been carefully composed to be relevant to organizations of any size. http://www.microsoft.com/download/en/details.aspx?id=2428

Migrate from Exchange Public Folders to Microsoft Office 365
This document outlines these considerations, discusses the most common public folder scenarios and how they are represented in Office 365 services. It also provides the information you need to decide whether Office 365 is a good match for you based on your current public folder usage. http://www.microsoft.com/download/en/details.aspx?id=27582

Lync

Unified Communications Phones and Peripherals Datasheets
These datasheets list the phones and peripheral devices that are qualified to display the “Optimized for Microsoft Lync” logo. http://www.microsoft.com/download/en/details.aspx?id=16857

Microsoft Lync Server 2010 Protocol Workloads Poster
This poster shows each workload in Microsoft Lync Server 2010 communications software, describing relationships, dependencies, flow of information, and certificate requirements. Version 5.11 corrects minor errors. http://www.microsoft.com/download/en/details.aspx?id=6797

Microsoft Lync Server 2010 Device Management and Troubleshooting Guide
The purpose of the Microsoft Lync Server 2010 Device Management and Troubleshooting Guide is to provide guidance on how to manage and update devices. It is also intended to answer frequently asked questions. This document identifies supported topologies, configurations, and scenarios described in detail in the Lync Server device deployment and planning documentation. http://www.microsoft.com/download/en/details.aspx?id=16277

Microsoft Lync Server 2010 Mobility Guide
This document guides you through the process of deploying the Microsoft Lync Server 2010 Mobility Service and the Microsoft Lync Server 2010 Autodiscover Service. http://www.microsoft.com/download/en/details.aspx?id=28355

Troubleshooting Microsoft Lync Server 2010 Clients: Help Desk Resource
This resource is for first-level help desk agents who support Microsoft Lync Server 2010 clients. Note: The .zip file contains both the print documentation and the Help file. http://www.microsoft.com/download/en/details.aspx?id=7373

Microsoft Lync Server 2010 Reference: Call Data Recording and Quality of Experience Database Schema
This document describes the call detail recording (CDR) and the Quality of Experience (QoE) databases schemas in Microsoft Lync Server 2010. http://www.microsoft.com/download/en/details.aspx?id=18099

Microsoft Lync Server 2010 Reference: Group Chat Database Schema
This document describes the Group Chat database schema in Microsoft Lync Server 2010. http://www.microsoft.com/download/en/details.aspx?id=21632

Microsoft Lync Server 2010 Security Guide
The Security Guide provides guidelines for assessing and managing security risks to your Lync Server 2010 deployment. http://www.microsoft.com/download/en/details.aspx?id=2729

Migrating from Office Communications Server 2007 R2 to Lync Server 2010
This document provides guidance from migration from Office Communications Server 2007 R2 to Microsoft Lync Server 2010. http://www.microsoft.com/download/en/details.aspx?id=9109

Migrating from Office Communications Server 2007 to Lync Server 2010
This document provides guidance from migration from Office Communications Server 2007 to Microsoft Lync Server 2010. http://www.microsoft.com/download/en/details.aspx?id=7327

Microsoft Lync Server 2010 Supportability Guide
This guide provides a central, high-level reference for supported server topologies and configurations and supported client configurations. It is also intended to answer frequently asked questions. This document identifies supported topologies, configurations, and scenarios described in detail in the Lync Server deployment and planning documentation. http://www.microsoft.com/download/en/details.aspx?id=13148

Enabling Quality of Service with Microsoft Lync Server 2010
If your Windows Server network supports Quality of Service (QoS) management, you can take advantage of this functionality to optimize media traffic in your Microsoft Lync Server 2010 deployment. This guide shows you how. http://www.microsoft.com/download/en/details.aspx?id=12633

Microsoft Lync Server 2010 Monitoring Deployment Guide
This document guides you through the process of deploying Lync Server 2010 Monitoring Server. http://www.microsoft.com/download/en/details.aspx?id=8207

Microsoft Lync Server 2010 Standard Edition Deployment Guide
This document guides you through the process of deploying Lync Server 2010 Standard Edition and configuring dial-in conferencing. http://www.microsoft.com/download/en/details.aspx?id=5317

Microsoft Lync Server 2010 Enterprise Voice Deployment Guide
This download contains two documents: Deploying Enterprise Voice at Central sites and Deploying Branch Sites http://www.microsoft.com/download/en/details.aspx?id=4816

Deploying Lync Server 2010 in a Multiple Forest Environment
This document explains how to deploy Lync Server 2010 in a multiple forest environment. http://www.microsoft.com/download/en/details.aspx?id=11300

Microsoft Lync Server 2010: Deploying Lync Server 2010 Enterprise Edition by Using the Planning Tool
This document describes the how to deploy Lync Server 2010 Enterprise Edition by using the Planning Tool. http://www.microsoft.com/download/en/details.aspx?id=8692

Microsoft Lync Server 2010 Group Chat Deployment Guide
This document guides you through the process of migrating and deploying Lync Server 2010 Group Chat Server and the related components that are required to let organizations set up searchable, topic-based chat rooms that persist over time, allowing geographically distributed teams to better collaborate with one another while preserving organizational knowledge. http://www.microsoft.com/download/en/details.aspx?id=9735

Microsoft Lync Server 2010 Remote Call Control Deployment Guide
This document describes the how to deploy remote call control in a Lync Server 2010 deployment. http://www.microsoft.com/download/en/details.aspx?id=16598

Microsoft Lync Server 2010 Edge Server Deployment Guide
This document guides you through the process of deploying Lync Server 2010 edge servers and Directors. http://www.microsoft.com/download/en/details.aspx?id=11379

Microsoft Lync Server 2010 Response Group Deployment Guide
This download guides you through the process of configuring the Response Group feature for Enterprise Voice. http://www.microsoft.com/download/en/details.aspx?id=6233

Microsoft Lync Server 2010 Active Directory Guide
This document guides you through the process of preparing Active Directory for Microsoft Lync Server 2010 and includes the Active Directory schema reference. http://www.microsoft.com/download/en/details.aspx?id=9448

Backing Up and Restoring Lync Server 2010
This document describes a methodology for backing up and restoring the data that is required for full recovery of Microsoft Lync Server 2010 services. http://www.microsoft.com/download/en/details.aspx?id=3364

Microsoft Lync Server 2010 Enterprise Edition Deployment Guide
This document guides you through the process of deploying Lync Server 2010 Enterprise Edition and configuring dial-in conferencing for Lync Server 2010. http://www.microsoft.com/download/en/details.aspx?id=9596

Microsoft Lync Server 2010 Client and Device Deployment Guide
This download guides you through the process of deploying client software and devices for Lync 2010. http://www.microsoft.com/download/en/details.aspx?id=15985

Microsoft Lync Server 2010 Group Chat Administration Guide
This document guides you through the process of administering Lync Server 2010 Group Chat Server and the related components that are required to let organizations set up searchable, topic-based chat rooms that persist over time, allowing geographically distributed teams to better collaborate with one another while preserving organizational knowledge. http://www.microsoft.com/download/en/details.aspx?id=6126

Microsoft Lync Server 2010 Announcement Deployment Guide
This download guides you through the process of configuring the Announcement call management feature for Enterprise Voice. http://www.microsoft.com/download/en/details.aspx?id=9823

Microsoft Lync Server 2010 Documentation Help File
This download contains a compiled help file (chm) of all the available Lync Server 2010 IT professional documentation on the Technical Library. http://www.microsoft.com/download/en/details.aspx?id=23888

Microsoft Lync Server 2010 Archiving Deployment Guide
The purpose of the Microsoft Lync Server 2010 Archiving Deployment Guide is to guide you through the process of deploying Lync Server 2010 Archiving Server and the related components that are required to support archiving of instant messaging and web conferencing (meeting) content. http://www.microsoft.com/download/en/details.aspx?id=4711

Microsoft Lync Server 2010 Administration Guide & Windows PowerShell Supplement
The Lync Server Administration Guide and the Windows PowerShell Supplement contain procedures and guidance for administering a Lync Server 2010 deployment. http://www.microsoft.com/download/en/details.aspx?id=13161

Uninstalling Microsoft Lync Server 2010 and Removing Server Roles
To maintain any system, you need to modify the deployment over time. An important part of maintenance is the retiring or decommissioning of existing components that you replace with different or newer components. “Uninstalling Lync Server 2010 and Removing Server Roles” includes procedures for removing server roles and decommissioning a deployment. http://www.microsoft.com/download/en/details.aspx?id=18692

Microsoft Lync Server 2010: Using Monitoring Server Reports
This document describes the how to use Monitoring Server Reports in a Lync Server 2010 deployment. http://www.microsoft.com/download/en/details.aspx?id=890

Live Meeting-To-Lync Transition Resources
Resources included in this download package are designed to support your organization’s Live Meeting Service to Lync (Server or Online) transition planning. This download will be updated with additional resources as available. http://www.microsoft.com/download/en/details.aspx?id=26494

Microsoft Lync 2010 Conferencing and Collaboration Training
Learn how to schedule, join, and manage online meetings with Microsoft Lync 2010. http://www.microsoft.com/download/en/details.aspx?id=7606

IM an Expert for Microsoft Lync Server 2010
IM an Expert is an instant messaging question and answer service that you can set up within your organization. With the IM an Expert service, you can use Microsoft Lync or the IM an Expert Welcome page to submit a question to the service. The IM an Expert service will locate an expert for you within your company and initiate an IM session between you and the expert who can answer your question. http://www.microsoft.com/download/en/details.aspx?id=8475

A Microsoft Lync Server 2010 Multi-tenant Pack for Partner Hosting Reference Architecture Case Study
Describes a case study of a real world implementation of a reference architecture for the Microsoft Lync Server 2010 Multi-tenant Pack for Partner Hosting. http://www.microsoft.com/download/en/details.aspx?id=29044

Microsoft Lync 2010 Phone Edition for Polycom CX500, Polycom CX600 and Polycom CX3000
Microsoft® Lync 2010 Phone Edition for Polycom® CX500, Polycom® CX600 and Polycom® CX3000 is the first generation of software designed specifically for the phones from Polycom to interoperate with Microsoft® Lync Server 2010. Lync Phone Edition provides traditional and advanced telephony features, integrated security, manageability and much more. http://www.microsoft.com/download/en/details.aspx?id=23866

Microsoft Lync 2010 Phone Edition for Aastra 6721ip and Aastra 6725ip
Microsoft® Lync 2010 Phone Edition for Aastra 6721ip and Aastra 6725ip is the first generation of software designed specifically for the phones from Aastra to interoperate with Microsoft® Lync Server 2010. Lync Phone Edition provides traditional and advanced telephony features, integrated security, manageability and much more. http://www.microsoft.com/download/en/details.aspx?id=18390

Microsoft Lync 2010 Phone Edition for HP 4110 and HP 4120
Microsoft® Lync 2010 Phone Edition for HP 4110 and HP 4120 is the first generation of software designed specifically for the phones from HP to interoperate with Microsoft® Lyncâ„¢ Server 2010. Lync Phone Edition provides traditional and advanced telephony features, integrated security, manageability and much more. http://www.microsoft.com/download/en/details.aspx?id=28158

Microsoft Lync 2010 Phone Edition for Polycom CX700 and LG-Nortel IP Phone 8540
Microsoft® Lync 2010 Phone Edition for Polycom® CX700 and LG-Nortel IP Phone 8540 is the next generation of software designed for the phones from Polycom and LG-Nortel to interoperate with Microsoft® Lync Server 2010. Lync Phone Edition provides traditional and advanced telephony features, integrated security, manageability and much more. http://www.microsoft.com/download/en/details.aspx?id=21644

Microsoft Lync Server 2010 Multi-tenant Pack for Partner Hosting Deployment Guide
The Microsoft Lync Server 2010 Multi-tenant Pack for Partner Hosting is an extension of Microsoft Lync Server 2010 software that is designed to allow service providers and system integrators to customize a Lync Server 2010 deployment and offer it as a service to their customers. This guide describes how to deploy and configure a basic architecture. http://www.microsoft.com/download/en/details.aspx?id=28587

Reference Architecture for the Microsoft Lync Server 2010 Multitenant Pack for Partner Hosting
Describes a reference architecture for the Microsoft Lync Server 2010 Multitenant Pack for Partner Hosting. http://www.microsoft.com/download/en/details.aspx?id=29045

Downloads

  1. Lync Lync Server 2010 Hotfix KB 2493736 This download includes all available updates for Lync Server 2010. http://www.microsoft.com/download/en/details.aspx?id=11551
  2. Lync 2010 Hotfix KB 2684739 (64 bit) This download includes all available updates for Lync 2010. http://www.microsoft.com/download/en/details.aspx?id=14490
  3. Lync 2010 Hotfix KB 2684739 (32 bit) This download includes all available updates for Lync 2010. http://www.microsoft.com/download/en/details.aspx?id=25055
  4. Microsoft Lync 2010 Training Download Package This zipped folder contains all of the available training and user education resources for Microsoft Lync 2010. The included Lync Training Plans workbook helps you choose the resources that will work best for your users. http://www.microsoft.com/download/en/details.aspx?id=9642
  5. IM an Expert for Microsoft Lync Server 2010 Documentation Version 1.5 This download provides documentation for the IM an Expert for Microsoft Lync Server 2010 service http://www.microsoft.com/download/en/details.aspx?id=16104

Events/Webcasts

Core presents An Introduction to the Microsoft Cloud (Office 365 and Windows Intune)

Starts: 18 April 2012 09:30
Ends: 18 April 2012 12:45
Time zone: (GMT) GMT, London
Welcome Time: 09:00

Cloud technology – it’s all you hear about right now! But for many, it can be confusing. Core can help you make sense of it all. Join us at our Introduction to the Microsoft Cloud seminar to learn how your organization can take advantage of Microsoft’s latest cloud offerings to transform your IT infrastructure and drive your business forward! Reduce your capital expenditure and save money by paying only for the computing power you need! https://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032502492&culture=en-GB

New KBs

Antigen & Forefront Microsoft Forefront Security for Exchange Server: Some default deletion messages in Forefront Security for Exchange Server may mislead a user or an administrator to assume that an error occurred or that a virus was found http://support.microsoft.com/kb/961385

Exchange

Microsoft Exchange Server 2003 Enterprise Edition

  1. Exchange Server experiences performance issues when a PDC emulator is used for DSAccess or ADAcess http://support.microsoft.com/kb/298879

Microsoft Exchange Server 2007 Enterprise Edition

  1. An Exchange Server 2007 Transport Rule does not work as expected http://support.microsoft.com/kb/2673160

Microsoft Exchange Server 2007 Service Pack 3

  1. Exchange ActiveSync does not synchronize some Outlook contact information as expected http://support.microsoft.com/kb/2692134

Microsoft Exchange Server 2007 Standard Edition

  1. Message  when you try to open an attachment in Outlook Web Access or Outlook Web App: “Right-click the link, and then click ‘Save Target As’ to save the attachment.” http://support.microsoft.com/kb/2688092

Microsoft Exchange Server 2010 Coexistence

  1. Error message when you try to use Outlook Web App to access an Exchange Server 2010 mailbox: “There was a problem opening your mailbox” http://support.microsoft.com/kb/2606268
  2. You cannot add mailbox database copies in Exchange Server 2010 http://support.microsoft.com/kb/2627725

Microsoft Exchange Server 2010 Enterprise

  1. Event 1000, 1001, or 1002 occurs when SCOM is monitoring Exchange Server 2007 or Exchange Server 2010 http://support.microsoft.com/kb/2681932
  2. Chat feature missing in Outlook Web App for Exchange 2010 http://support.microsoft.com/kb/2688771

Microsoft Exchange Server 2010 Standard

  1. You cannot synchronize an Exchange ActiveSync device with a mailbox when external URLs are not resolved on an Exchange Server 2010 Client Access server http://support.microsoft.com/kb/2679228
  2. Users cannot use Outlook to access their mailbox after migration to Exchange 2010 http://support.microsoft.com/kb/2688982

Lync

Microsoft Lync 2010

  1. A user whose display name is in Korean cannot be found in Lync 2010 http://support.microsoft.com/kb/2661952
  2. You receive a System.UnauthorizedAccessException exception when you disconnect a call in a Lync 2010 SDK-based application http://support.microsoft.com/kb/2664812
  3. The Windows logoff process is delayed when Lync 2010 is started http://support.microsoft.com/kb/2666324
  4. A customized Lync 2010 Help URL does not work in Lync 2010 http://support.microsoft.com/kb/2666338
  5. A RTF header is displayed instead of the conversation history in the Conversation tab of Lync 2010 http://support.microsoft.com/kb/2666340
  6. The time stamp that is displayed in the IM conversation windows is truncated in Lync 2010 http://support.microsoft.com/kb/2666702
  7. You cannot use client policy to exclude a folder from contact search in Lync 2010 http://support.microsoft.com/kb/2666704
  8. Help with Lync Server 2010 configurations for very small business http://support.microsoft.com/kb/2667699
  9. Description of the cumulative update for Lync 2010: February 2012 http://support.microsoft.com/kb/2670326
  10. The typing status message is not displayed when you use an IME to type double-byte characters in Lync 2010 http://support.microsoft.com/kb/2672922
  11. A contact is displayed with an incorrect picture and incorrect presence information in Lync 2010 http://support.microsoft.com/kb/2672944
  12. Double-byte text is transparent in desktop alerts on a computer that is running Windows XP and that has Lync 2010 installed http://support.microsoft.com/kb/2672945
  13. Description of the cumulative update package for Lync 2010 for iPad: March 2012 http://support.microsoft.com/kb/2673225
  14. The conversation list is not displayed correctly in the chats window after you delete a conversation in Lync 2010 for iPad http://support.microsoft.com/kb/2673304
  15. Users have to manually input the user name every time that they sign in to the Lync 2010 client http://support.microsoft.com/kb/2681509

Microsoft Lync 2010 for iPhone

  1. A user whose SIP URI address only contains numbers is displayed as a telephone contact in Lync 2010 for iPhone http://support.microsoft.com/kb/2672940
  2. Description of the cumulative update package for Lync 2010 for iPhone: March 2012 http://support.microsoft.com/kb/2673223
  3. Meetings are not shown in the Meetings tab in Lync 2010 for iPhone http://support.microsoft.com/kb/2673298
  4. A deleted contact group is still displayed in Lync 2010 for iPhone http://support.microsoft.com/kb/2673303
  5. “Me:” and “Missed:” are translated incorrectly in the chats window in a Korean version of Lync 2010 for iPhone http://support.microsoft.com/kb/2677215
  6. Discovery address text strings are translated incorrectly on the sign-in page of the Chinese Version of Microsoft Lync 2010 for iPhone http://support.microsoft.com/kb/2677216

Microsoft Lync 2010 for Windows Phone

  1. Lync 2010 for Windows Phone displays Japanese text in the Microsoft Yahei font unexpectedly http://support.microsoft.com/kb/2666321
  2. Description of the cumulative update package for Lync 2010 for Windows Phone: March 2012 http://support.microsoft.com/kb/2673226
  3. Lync 2010 mobile clients always prompt the user for a mobile phone number http://support.microsoft.com/kb/2685372

Microsoft Lync 2010 Group Chat

  1. Description of the cumulative update for the Lync Server 2010, Group Chat Administration Tool: February 2012 http://support.microsoft.com/kb/2672318
  2. Description of the cumulative update for Lync 2010 Group Chat: February 2012 http://support.microsoft.com/kb/2672325

Microsoft Lync 2010 Phone Edition

  1. Description of a new feature that lets users set or change their presence information by using a telephone in Lync 2010 Phone Edition http://support.microsoft.com/kb/2666706
  2. Lync 2010 Phone Edition enabled phones report 10 Mbps network link speed http://support.microsoft.com/kb/2686136

Microsoft Lync 2010 Phone Edition for Aastra 6721ip and Aastra 6725ip

  1. The maximum ringer volume is too low on certain telephone products that are running Lync 2010 Phone Edition http://support.microsoft.com/kb/2666323

Microsoft Lync Server 2010 Enterprise Edition

  1. “The owner of the object passed does not match the original owner.” error message when a Lync 2010 user calls a CAA access number to join a conference http://support.microsoft.com/kb/2500431

Microsoft Lync Server 2010 Enterprise Edition

  1. Error message when you run the “Enable-CsAdDomain” command in a Lync Server 2010 environment http://support.microsoft.com/kb/2672929

Microsoft Lync Server 2010 Software Development Kit

  1. A user cannot add a custom location to their contact information by using an application that is developed by using Lync Server 2010 SDK http://support.microsoft.com/kb/2672943

Microsoft Lync Server 2010 Standard Edition

  1. “Please verify your logon credentials and try again” error message when a user signs in to Lync Server 2010 http://support.microsoft.com/kb/2637105
  2. You cannot add a DFS file share as a file store in Topology Builder of Lync Server 2010 http://support.microsoft.com/kb/2666344
  3. Delay processing incoming calls in Lync Server 2010 http://support.microsoft.com/kb/2666349
  4. Error message when you run the Set-CsRegistrar command in Lync Server Management Shell in a Lync Server 2010 environment http://support.microsoft.com/kb/2666710
  5. Error message when you run the “CsFileTransferFilterConfiguration” command in a Lync Server 2010 environment http://support.microsoft.com/kb/2666711
  6. Description of the cumulative update for Lync Server 2010, Conferencing Attendant: February 2012 http://support.microsoft.com/kb/2670540
  7. Text that is typed by using the right-to-left reading order is displayed by using the left-to-right reading order in the sent message pane in Lync 2010 http://support.microsoft.com/kb/2672924
  8. A global client policy in which the “EnableExchangeContactSync” parameter is set to False does not work in Lync Server 2010 http://support.microsoft.com/kb/2672933
  9. Federated users do not receive a meeting invitation in Lync Server 2010 http://support.microsoft.com/kb/2672935
  10. A delegate cannot perform operations on behalf of the manager in a Lync Server 2010 environment http://support.microsoft.com/kb/2673299
  11. A user cannot call a number that matches a normalization rule that begins with optional digits in a Lync Server 2010 environment http://support.microsoft.com/kb/2673302
  12. Description of the cumulative update for Lync Server 2010, Mobility Service: February 2012 http://support.microsoft.com/kb/2675053
  13. A Front End Server does not route network traffic to Lync 2010 Mobile clients if the Collocated Mediation Server option is enabled in Lync Server 2010 http://support.microsoft.com/kb/2675221
  14. The Address Book service does not synchronize user information when data in the RTC database is corrupted in a Lync Server 2010 environment http://support.microsoft.com/kb/2675222
  15. Microsoft Lync Server 2010, Group Chat
  16. A user does not receive an invitation when the user is added to a distribution list that is a member of a chat room in Lync Server 2010, Group Chat http://support.microsoft.com/kb/2666341
  17. The Channel service stops when a user signs in to a Group Chat client in Lync Server 2010, Group Chat http://support.microsoft.com/kb/2666342
  18. Description of the cumulative update for Lync Server 2010, Group Chat: February 2012 http://support.microsoft.com/kb/2670342

Outlook

Microsoft Office Outlook 2003

  1. Description of the Outlook 2003 Junk Email Filter update: March 13, 2012 http://support.microsoft.com/kb/2598246
  2. Description of the policy for how e-mail is filtered by the junk e-mail filters in Outlook or in Exchange Server http://support.microsoft.com/kb/954199

Microsoft Office Outlook 2007

  1. Description of the Outlook 2007 hotfix package (Outlook-x-none.msp): March 7, 2012 http://support.microsoft.com/kb/2597964
  2. Description of the Outlook 2007 Junk Email Filter update: March 13, 2012 http://support.microsoft.com/kb/2597970
  3. Outlook Anywhere cannot be disabled in Outlook 2007 and in Outlook 2010 http://support.microsoft.com/kb/2686042

Microsoft Outlook 2002 Standard Edition

  1. You cannot use Outlook to complete a Microsoft Word Mail Merge http://support.microsoft.com/kb/2149769

Microsoft Outlook 2010

  1. An email message body contains text that is added from previously opened email messages when you access a mailbox by using an IMAP4 client in Outlook 2010 http://support.microsoft.com/kb/2597991
  2. Description of the Outlook 2010 hotfix package (x86 Outexum-x-none.msp, x64 Outexum-x-none.msp): February 28, 2012 http://support.microsoft.com/kb/2598024
  3. Outlook 2010: Leave a copy of the message on the server is missing http://support.microsoft.com/kb/2671941
  4. How to deploy a default email signature in Outlook http://support.microsoft.com/kb/2691977

 

Function: Remove-NicGateway – Removing the Default Gateway on Selected NICs Via PowerShell

March 13th, 2012 No comments

Description

When deploying Database Availability Groups (DAGs) with Exchange 2010, multiple network are generally used. You’ll have a client or “MAPI” network and at least a replication network. I’ve seen some organizations that also deploy backup networks. Each has their own NICs or NIC teams. Only the client network should have a default gateway defined. The rest should not. Static routes are added for the others using the NETSH command.

Setting the NIC properties is sometimes  a manual task, and sometimes a scripted task via PowerShell. On a large project, I needed to run a validation script to ensure that the servers were consistent and ready for the Exchange build, and fix those that could be done via script. I noticed that servers were coming with gateways defined on all of the NIC teams, so I need to resolve this. Turns out, it was a little challenging to do it via PowerShell.

There is apparently no easy way to just remove the gateway. We can easily set it, but my assumption that setting it to $null would work was incorrect. What I ended up doing, with the assistance of Serkan Varoglu, was to change the NIC from static to DHCP, then back to static, defining only the IP address and subnet mask. Not the most direct method, but it works. And, it appears to leave other parameters intact, including DNS servers, suffixes, WINS, etc.

First we use WMI to grab the NIC by name ($NicName):

$Adapter = Get-WmiObject -Class Win32_NetworkAdapter -Filter "NetConnectionID='$NicName'"

Then we get the configuration for the NIC by calling it using the index number of the NIC we got from above:

$Nic = Get-WmiObject -Class Win32_NetworkAdapterConfiguration -Filter "Index=$($Adapter.Index)"

Next, we need to grab the NIC’s IP and subnet mask so we can assign them again later:

$NicIP = $Nic.IpAddress[0]
$NicMask = $Nic.IpSubnet[0]

The, we set the NIC to DHCP,

$Nic.EnableDhcp() | Out-Null

And then back to static, using the IP and mask we retrieved from above:

$Nic.EnableStatic($NicIp,$NicMask) | Out-Null

We can wrap this into a function and call it in our validation scripts.

function Remove-NicGateway	{
<#
.SYNOPSIS
	Removes the default gateway on a specified network interface card (NIC)

.DESCRIPTION
	Removes the default gateway on a specified network interface card (NIC) by first setting the NIC to DHCP, and then setting it back to static and not specifying the gateway - just the IP and subnet mask

.NOTES
  Version      				: 1.0
  Rights Required			: Local admin on server
  										: ExecutionPolicy of RemoteSigned or Unrestricted

	Author       				: Pat Richard, Exchange MVP
	Email/Blog/Twitter	: pat@innervation.com 	https://www.ucunleashed.com @patrichard
	Dedicated Blog			: https://www.ucunleashed.com/152

	Author       				: Serkan Varoglu
	Email/Blog/Twitter	: N/A	http://www.get-mailbox.org	@SRKNVRGL

	Disclaimer   				: You running this script means you won't blame me if this breaks your stuff.
	Info Stolen from 		: 

.EXAMPLE
	Remove-NIcGateway -NicName [name of NIC]

.INPUTS
	None. You cannot pipe objects to this script.

#Requires -Version 2.0
#&gt;
	[cmdletBinding(SupportsShouldProcess = $true)]
	param(
		[parameter(ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $true, HelpMessage = "No NIC name specified")]
		[ValidateNotNullOrEmpty()]
		[string]$NicName
	)
	$Adapter = Get-WmiObject -Class&nbsp;Win32_NetworkAdapter -Filter "NetConnectionID='$NicName'"
	$Nic = Get-WmiObject -Class Win32_NetworkAdapterConfiguration -Filter "Index=$($Adapter.Index)"
	$NicIP = $Nic.IpAddress[0]
	$NicMask = $Nic.IpSubnet[0]
	Write-Verbose "$NicIP $NicMask"
	$Nic.EnableDhcp() | Out-Null
	Start-Sleep -s 5
	Write-Verbose "Setting $NicName to $NicIP $NicMask"
	$Nic.EnableStatic($NicIp,$NicMask) | Out-Null
} # end function Remove-NicGateway

And call it via:

Remove-NicGateway -NicName [NIC/Team Name]

such as

Remove-NicGateway -NicName "Replication"

Hopefully, this will be useful to you.

Donations

I’ve never been one to really solicit donations for my work. My offerings are created because *I* need to solve a problem, and once I do, it makes sense to offer the results of my work to the public. I mean, let’s face it: I can’t be the only one with that particular issue, right? Quite often, to my surprise, I’m asked why I don’t have a “donate” button so people can donate a few bucks. I’ve never really put much thought into it. But those inquiries are coming more often now, so I’m yielding to them. If you’d like to donate, you can send a few bucks via PayPal at https://www.paypal.me/PatRichard. Money collected from that will go to the costs of my website (hosting and domain names), as well as to my home lab.

Function: Set-DriveLabel – Change the Label of a Drive Via PowerShell

March 6th, 2012 1 comment

Powershell_logo-137x137Description

Here’s a simple function to change the label of a drive.

function Set-DriveLabel	{
	<#
	.SYNOPSIS
	  Sets the label on a drive.

	.DESCRIPTION
	  Sets the label on a drive to a user specified value

	.NOTES
	    Version      			: 1.0
	    Rights Required			: Local admin on server
	    					: ExecutionPolicy of RemoteSigned or Unrestricted
	    Exchange Version			: N/A
            Author     				: Pat Richard, Exchange MVP
            Email/Blog/Twitter	                : pat@innervation.com 	https://www.ucunleashed.com @patrichard
            Dedicated Blog			: https://www.ucunleashed.com/1097
            Disclaimer   			: You running this script means you won't blame me if this breaks your stuff.

	.EXAMPLE
		Set-DriveLabel -DriveLetter "d:" -DriveLabel "Data"

	.INPUTS
		None. You cannot pipe objects to this script.

	#Requires -Version 2.0
	#>
	[cmdletBinding(SupportsShouldProcess = $true)]
	param(
		[parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $true, HelpMessage = "No drive letter specified")]
		[string]$DriveLetter,
		[parameter(Position = 1, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $true, HelpMessage = "No drive label specified")]
		[string]$DriveLabel
	)
	Write-Host "Setting drive label - drive $DriveLetter"
	$drive = Get-WmiObject -Class Win32_Volume -Filter "DriveLetter = '$DriveLetter'"
	Set-WmiInstance -input $drive -Arguments @{Label="$DriveLabel"} | Out-Null
	If ((Get-WmiObject -Class Win32_Volume -Filter "DriveLetter = '$DriveLetter'").Label -eq $DriveLabel){
		return $true
	}else{
		return $false
	}
} # end function Set-DriveLabel

You would then call it as such:

Set-DriveLabel -DriveLetter [drive] -DriveLabel [label]

such as

Set-DriveLabel -DriveLetter d: -DriveLabel "Data"

Comment based help is available via

Get-Help Set-DriveLabel

Donations

I’ve never been one to really solicit donations for my work. My offerings are created because *I* need to solve a problem, and once I do, it makes sense to offer the results of my work to the public. I mean, let’s face it: I can’t be the only one with that particular issue, right? Quite often, to my surprise, I’m asked why I don’t have a “donate” button so people can donate a few bucks. I’ve never really put much thought into it. But those inquiries are coming more often now, so I’m yielding to them. If you’d like to donate, you can send a few bucks via PayPal at https://www.paypal.me/PatRichard. Money collected from that will go to the costs of my website (hosting and domain names), as well as to my home lab.

Categories: PowerShell Tags: ,

Programatically Add Heys and Values to edgetransport.exe.config for Exchange 2010

February 22nd, 2012 No comments

Recently, some testing on some new Exchange 2010 hub transport servers yielded some less than expected performance results. Processor utilization was much higher during sustained load testing of message throughput in some dedicated message journal sites.

A colleague worked to determine a solution, and came up with adding two keys and respective values to the EdgeTransport.exe.config file in [Exchange installation folder]\bin. This caused a substantial drop in processor utilization, but caused another problem – how to deploy this solution easily, in a repeatable fashion? We certainly don’t want to have to manually edit dozens of XML files across the production environment.

Our deployment method was entirely scripted, so I set out to find a way to incorporate the fix into the server provisioning scripts. Having not had to deal with editing XML files before, I did a fair amount of searching online, but had trouble with nearly everything I found. Obscure errors, and overly complex code had me just cobbling some things together until it worked. I finally came up with the New-AppSetting function below. It’s lean and mean, but it works.

function New-AppSetting {
	<#
	.SYNOPSIS
	  Adds keys and values to the EdgeTransport.exe.config file for Exchange 2010 	

	.DESCRIPTION
	  Adds user defined keys and values to the EdgeTransport.exe.config file for Exchange 2010 and restarts MSExchangeTransport service 

	.NOTES
	Version      			: 1.0
	Rights Required			: Local admin on server
	    				: ExecutionPolicy of RemoteSigned or Unrestricted
	Exchange Version		: 2010 SP1 UR6
    	Author(s)    			: Pat Richard (pat@innervation.com)
	Dedicated Post			: https://www.ucunleashed.com/1055
	Disclaimer   			: You running this script means you won't blame me if this breaks your stuff.
	Info Stolen from 		:	

	.EXAMPLE
		New-AppSetting -key [key] -value [value]

	.INPUTS
		None. You cannot pipe objects to this script.

	#Requires -Version 2.0
	#>

	[cmdletBinding(SupportsShouldProcess = $true)]
	param(
		[parameter(Position = 0, ValueFromPipeline = $false, ValueFromPipelineByPropertyName = $true, Mandatory = $true, HelpMessage = "No key specified")]
		[string]$key,
		[parameter(Position = 0, ValueFromPipeline = $false, ValueFromPipelineByPropertyName = $true, Mandatory = $true, HelpMessage = "No value specified")]
		[string]$value
	)
	[string]$configfile = $env:ExchangeInstallPath+"bin\EdgeTransport.exe.config"
	if (Test-Path $ConfigFile){
		[xml]$xml = Get-Content $ConfigFile
		[string]$currentDate = (get-date).tostring("MM_dd_yyyy-hh_mm_s")
		[string]$backup = $configfile + "_$currentDate"
		Copy-Item $configfile $backup
		$new = $xml.CreateElement('add')
		$new.SetAttribute('key', $key)
		$new.SetAttribute('value', $value)
		$xml.configuration.appSettings.AppendChild($new) | Out-Null
		$xml.Save($ConfigFile)
	}
	Restart-Service MSExchangeTransport
} # end function New-AppSetting

You call it via:

New-AppSetting -key [key name] -value [value]

such as

 New-AppSetting -key "RecipientThreadLimit" -value "20"

And it will add the key at the bottom of the list in EdgeTransport.exe.config and restart the transport service for the change to take effect. Prior to making the change, it creates a backup copy of EdgeTransport.exe.config for safe keeping.

One caveat – I didn’t have a lot of time to add some error checking or validation. The script does not check to see if the key is already present in the list (in our case, it’s not). So if you run the function multiple times with the same key name, you’ll end up with that key appearing multiple times in EdgeTransport.exe.config. I worked around this quickly in my script by using the following:

if ((Get-Content ($env:ExchangeInstallPath+"bin\edgetransport.exe.config")) -notmatch "RecipientThreadLimit"){
	New-AppSetting -key "RecipientThreadLimit" -value "20"
}

If I get some free cycles, I’ll streamline this a little more. But it works, and we’re able to continue deploying dozens of hub transport servers.

Function: New-BalloonTip – PowerShell Function to Show Balloon Tips

February 21st, 2012 5 comments

Description

Sometimes, we run scripts that may take quite a while to process. Rather than sit idly and watch the script process, we can trigger balloon tips to let us know when it’s done. Something like:

Balloon Tip

Balloon Tip

These are the same type of balloon tips that alert us to outdated or disabled security settings, pending updates, etc.

Windows Update balloon tip

Windows Update balloon tip

This handy little function makes it very easy to use this useful feature. I took the info from PS1 at http://powershell.com/cs/blogs/tips/archive/2011/09/27/displaying-balloon-tip.aspx and put it into a function and optimized it a little. You can specify the icon (none, info, warning, error), the title text, and the tip text.

function New-BalloonTip  {
<#
.SYNOPSIS
  Displays a balloon tip in the lower right corner of the screen.

.DESCRIPTION
  Displays a balloon tip in the lower right corner of the screen. Icon, title, and text can be customized.

.NOTES
  Version                 : 1.3
  Wish List               :
  Rights Required         : Local admin on server
                          : If script is not signed, ExecutionPolicy of RemoteSigned (recommended) or Unrestricted (not recommended)
                          : If script is signed, ExecutionPolicy of AllSigned (recommended), RemoteSigned, 
                            or Unrestricted (not recommended)
  Sched Task Required     : No
  Lync/Skype4B Version    : N/A
  Author/Copyright        : © Pat Richard, Skype for Business MVP - All Rights Reserved
  Email/Blog/Twitter      : pat@innervation.com   https://www.ucunleashed.com @patrichard
  Dedicated Post          : https://www.ucunleashed.com/1038
  Disclaimer              : You running this script means you won't blame me if this breaks your stuff. This script is
                            provided AS IS without warranty of any kind. I disclaim all implied warranties including, 
                            without limitation, any implied warranties of merchantability or of fitness for a particular
                            purpose. The entire risk arising out of the use or performance of the sample scripts and 
                            documentation remains with you. In no event shall I be liable for any damages whatsoever 
                            (including, without limitation, damages for loss of business profits, business interruption,
                            loss of business information, or other pecuniary loss) arising out of the use of or inability
                            to use the script or documentation. 
  Acknowledgements        : 
  Assumptions             : ExecutionPolicy of AllSigned (recommended), RemoteSigned or Unrestricted (not recommended)
  Limitations             : 
  Known issues            : None yet, but I'm sure you'll find some!                        

.LINK
  
Function: New-BalloonTip – PowerShell Function to Show Balloon Tips
.EXAMPLE New-BalloonTip -icon [none|info|warning|error] -title [title text] -text [text] Description ----------- Creates a balloon tip in the lower right corner. .INPUTS This function does support pipeline input. #> #Requires -Version 2.0 [CmdletBinding(SupportsShouldProcess = $true)] param( # Specifies the type of icon shown in the balloon tip [parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] [ValidateSet("None", "Info", "Warning", "Error")] [ValidateNotNullOrEmpty()] [string] $Icon = "Info", # Defines the actual text shown in the balloon tip [parameter(Position = 1, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $true, HelpMessage = "No text specified!")] [ValidateNotNullOrEmpty()] [string] $Text, # Defines the title of the balloon tip [parameter(Position = 2, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $true, HelpMessage = "No title specified!")] [ValidateNotNullOrEmpty()] [string] $Title, # Specifies how long to display the balloon tip [parameter(Position = 3, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] [ValidateNotNullOrEmpty()] [ValidatePattern("[0-9]")] [int] $Timeout = 10000 ) PROCESS{ [system.Reflection.Assembly]::LoadWithPartialName('System.Windows.Forms') | Out-Null # Add-Type -AssemblyName System.Windows.Forms #if (! $script:balloon) { #$script:balloon = New-Object System.Windows.Forms.NotifyIcon $balloon = New-Object System.Windows.Forms.NotifyIcon #} $path = Get-Process -Id $pid | Select-Object -ExpandProperty Path $balloon.Icon = [System.Drawing.Icon]::ExtractAssociatedIcon($path) $balloon.BalloonTipIcon = $Icon $balloon.BalloonTipText = $Text $balloon.BalloonTipTitle = $Title $balloon.Visible = $true $balloon.ShowBalloonTip($Timeout) $balloon.Dispose() } # end PROCESS } # end function New-BalloonTip

And you can call it by either supplying the parameter names:

New-BalloonTip -icon info -text 'PowerShell script has finished processing' -title 'Completed'

or not:

New-BalloonTip info 'PowerShell script has finished processing' 'Completed'

Donations

I’ve never been one to really solicit donations for my work. My offerings are created because *I* need to solve a problem, and once I do, it makes sense to offer the results of my work to the public. I mean, let’s face it: I can’t be the only one with that particular issue, right? Quite often, to my surprise, I’m asked why I don’t have a “donate” button so people can donate a few bucks. I’ve never really put much thought into it. But those inquiries are coming more often now, so I’m yielding to them. If you’d like to donate, you can send a few bucks via PayPal at https://www.paypal.me/PatRichard. Money collected from that will go to the costs of my website (hosting and domain names), as well as to my home lab.

Categories: PowerShell Tags: ,