Lots of questions coming in this month! If you’ve sent one in, don’t worry, we’ll get back to you. (I know we’re testing some changes in our local Lync Server, before we respond to one of them.)

Last week we received this question:

“Can we set up a global policy so everyone has a 5-minute idle in Lync?”

The answer to this question is yes – and no.

Right now, you can’t use a GPO (Group Policy Object) to set a Lync 2010 client’s default idle limit – when Lync switches from Available to Away.

You could go around changing each client’s idle settings, of course. But that’s way too time-consuming (and no self-respecting sysadmin would work that slow).

Don’t worry though! There IS a way to enforce a default idle for Lync users: Use a Management Shell script.

Run a Script at Startup to Set Global Idle

That’s right. One simple script will enforce global idle limits on all clients.

In a moment I’ll show you the script. But before that, a quick reminder: the Lync Server Management Shell isn’t set to run scripts by default! You’ll have to modify the execution policy so you can run scripts.

Which is easy. Just enter this command in the Management Shell prompt:
Set-ExecutionPolicy RemoteSigned

With that done, let’s move to the script itself. Copy the following into Notepad and save it as “set-global-idle.ps1”.

$computer = "."
$registry = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey("CurrentUser", $computer)
$key = $registry.OpenSubKey("SOFTWAREMicrosoftCommunicator", $True)

Those of you who are familiar with PowerShell will see how this script works at a glance. Even if you aren’t, this script’s pretty easy to understand: It makes a small change to the client PC’s registry, relating to Lync’s registry keys.

In this case, we’re changing the “IdleThreshold” or idle timeout point.

You will have to run Set-Global-Idle.ps1 on everyone’s PCs at startup. It’ll act like a pseudo-GPO, making a background change during boot. We’ve tested it and had no errors.

Modify the script as you like! Setting idle isn’t all you can do with this method. But be careful; this causes a change to client PC registries. The wrong parameters could cause registry corruption…and nobody wants every single PC in the office to crash at once!

Bravely Standing In for Lync GPO

We’re sure Microsoft will release a Lync Server patch that lets you control global idle soon. Use our Set-Global-Idle.ps1 script as a stand-in/workaround for now. It works, but it’s an extra step imposed on your Lync setup.

Have you modified your Lync Server installation using Management Shell? How?

How to Create a Global Idle Policy with a Management Shell Script
Tagged on:         

2 thoughts on “How to Create a Global Idle Policy with a Management Shell Script

  • September 11, 2014 at 5:54 pm

    Hi, thanks for this post. I have one question that is it possible to control using MSPL script for lync users to auto log out after a period of inactivity? Is there any other way to do auto log out?

    Thanks in advance.

    • September 12, 2014 at 9:00 am

      Good question! I’m sure a method exists to enforce auto-logout. With MSPL though, I’m not sure how it would work. I’ll need to ask the rest of the team. Let me do that and get back to you.


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.