Sunday, 9 December 2012

Get-LyncAutoLogonStatus.ps1

  1. <# 
  2. .SYNOPSIS 
  3.     This script reports on whether Lync should 
  4.     automatically start on a machine when a user 
  5.     logs in
  6. .DESCRIPTION 
  7.     This script looks in the registry at a chosen machine 
  8.     to determine if the Lync client should automatically 
  9.     attempt to login when a user logs onto that system. 
  10. .NOTES 
  11.     File Name  : Get-LyncAutoLogonStatus 
  12.     Author     : Thomas Lee - tfl@psp.co.uk 
  13.     Requires   : PowerShell Version 2.0 
  14.                  Lync 2010 or later 
  15. .LINK 
  16.     This script posted to: 
  17.         http://www.pshscripts.blogspot.com 
  18. .EXAMPLE 
  19.     Psh> .\Get-LyncAutoLogonStatus     
  20.     Automatically start Lync when I log on to Windows: True 
  21. #> 
  22.  
  23.  
  24. [Cmdletbinding()] 
  25. Param ( 
  26. [string] $computer = "Cookham8.Cookham.net"
  27.  
  28.  
  29. # Get the relevant registry key 
  30. $registry = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey("CurrentUser", $computer
  31. $key = $registry.OpenSubKey("SOFTWARE\Microsoft\Communicator", $True
  32.   
  33. # now write to host the details 
  34. Write-Host "Automatically start Lync when I log on to Windows:",` 
  35.     ([boolean] $key.GetValue("AutoRunWhenLogonToWindows",$null)) 
Technorati Tags: ,

2 comments:

RD18 said...

Nice & simple.

RD18 said...

nice & simple.