Automatically start Lync when I log on to Windows

 

 

Registry locations

HKCU\Software\Microsoft\Communicator\

 AutoRunWhenLogonToWindows

Allowed registry values

· 0 – Lync will not automatically start when you logon to Windows

· 1 – Lync will automatically start when you log on to Windows

Registry value type

REG_DWORD

Default setting

1: Lync starts when you log on to Windows

 

It’s one thing to install Microsoft Lync on all your computers; it’s another thing to make sure that people actually use the program. One way to encourage people to use Microsoft Lync is to have the application automatically start each time users log on to Windows; that way no one will "forget" to start the program, or forget how to start the program.

 

You can configure Lync to automatically start each time a user logs on to Windows by checking the aptly-named Automatically start Lync when I log on to Windows check box:

 

 

Alternatively, you can achieve the same result by modifying the HKCU\SOFTWARE\Microsoft\Communicator\AutoRunWhenLogonToWindows registry value. Set this value to 1 to effectively select the check box, and to have Lync start each time you log on to Windows. Set this value to 0 to cancel auto logon. In the latter case, you’ll then need to manually start Lync each time you start Windows.

 

So how can you modify this registry value? One way is to use Windows PowerShell. For example, the following script retrieves the current value of AutoRunWhenLogonToWindows on the local computer. If you'd rather pull this value off a remote computer, simply set the value of the variable $computer to the name of that remote computer. For example:

 

$computer = "atl-ws-001.litwareinc.com"

 

Here's the script we were just talking about:

 

$computer = "."

 

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

$key = $registry.OpenSubKey("SOFTWARE\Microsoft\Communicator", $True)

 

$value =$key.GetValue("AutoRunWhenLogonToWindows",$null)

if ($value -eq 1) {$value = "Yes"}

if ($value -eq 0) {$value = "No"}

Write-Host "Automatically start Lync when I log on to Windows: $value"

 

And what if you want to change that value? That's fine; what follows is a script that causes Lync to start each time you log on to Windows; that's done by setting AutoRunWhenLogonToWindows to 1. To not have Lync auto-start each time you log on to Windows, set AutoRunWhenLogonToWindows to 0:

 

$key.SetValue("AutoRunWhenLogonToWindows",0,"DWORD")

 

Here's what we've been talking about:

 

$computer = "."

 

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

$key = $registry.OpenSubKey("SOFTWARE\Microsoft\Communicator", $True)

 

$key.SetValue("AutoRunWhenLogonToWindows",1,"DWORD")