First Configure your system for the Lync online follow the below link for configure you system for Lync online.
Configuring Your Computer for Lync Online Management
Remote management of Lync Online by using Windows PowerShell is supported only on 64-bit computers running one of the following operating systems:
- Windows 7
- Windows Server 2008 R2
- Windows Server 2012
- Windows Server 2012 R2
- Windows 8
- Windows 8.1
- Windows PowerShell 3.0
- Microsoft Online Services Sign-In Assistant for IT Professionals RTW
- Lync Online Connector Module
Downloading and Installing the Lync Online Connector Module Downloading and Installing the Microsoft Online Services Sign-In Assistant Downloading and Installing Windows PowerShell 3.0
Connect to Lync online PowerShell using the below script
POWERSHELL
$credential = Get-Credential
POWERSHELL
$session = New-CsOnlineSession -Credential $credential
POWERSHELL
Import-PSSession $session
POWERSHELL
Ref # http://technet.microsoft.com/en-us/library/dn362795.aspx