Chat with us, powered by LiveChat

Blog

Back

Administering Lync Online for Office 365 with PowerShell

15 May 2013 by Emma Robinson

This article shows you how to connect to Office 365’s Lync Online server using PowerShell. This allows you to perform more advanced administration that is not available in the Office 365 Web Portal.

Install the Lync Server Administration Tools

Before we can begin, we need to install the Lync Online PowerShell Module. You can download it here:
http://www.microsoft.com/en-us/download/details.aspx?id=39366

Connect to Lync Online using PowerShell

Now fire up PowerShell and begin the fun. The syntax for connecting to Lync Online is very similar to connecting to Exchange Online:

$cred = Get-Credential
$CSSession = New-CsOnlineSession -Credential $cred
Import-PSSession $CSSession -AllowClobber

Lync Online PowerShell CmdLets

There are many PowerShell cmdlets available to you, some such as Get-CSOnlineUser are specific to Lync Online whilst others are the same as their Lync On Premise brothers.
An example output for this cmdlet is:

Get-CsOnlineUser alan > csonlineuser.txt
RunspaceId : 0cdfc36b-d7aa-4803-8aed-30cc9cc50b07
UserAccountControl : PasswordNotRequired, NormalAccount
Id : CN=ad48af2a-f48c-4f1e-b5f1-3bf8289b2dc1,OU=25028a26-f2ce-458d-a12f-424e8fee394a,OU=
OCS Tenants,DC=lync0e001,DC=local
CountryAbbreviation : GB
CountryOrRegionDisplayName : GB
Company :
Department :
Description : {}
Fax :
IPPhone :
City : London
Manager :
OriginatorSid :
OtherTelephone : {}
Office :
PostalCode : EC1V 2NX
PreferredLanguage : en-US
Puid : 10033FFF859D6471
StateOrProvince :
Street :
StreetAddress :
ThumbnailPhoto :
Title :
WebPage :
AdminDescription :
AssignedPlan : {


}
Alias : alan
BaseSimpleUrl : https://meet.lync.com/alantest4
DirSyncEnabled :
ObjectId : ad48af2a-f48c-4f1e-b5f1-3bf8289b2dc1
UsageLocation : GB
HideFromAddressLists : False
OnPremHideFromAddressLists : False
ProvisionedPlan : {}
ProvisioningStamp :
UpgradeRetryCounter : 0
SyncingCounter :
ProvisioningCounter : 0
PublishingStamp :
PublishingCounter : 0
OnPremHostingProvider :
OnPremOptionFlags : 0
OnPremSIPEnabled :
OnPremSipAddress :
OnPremLineURI :
MCOValidationError : {}
ShadowProxyAddresses : {}
SipProxyAddress : sip:alan@alantest4.onmicrosoft.com
ServiceInstance : microsoftcommunicationsonline/instance03-s
SoftDeletionTimestamp :
LastSyncTimeStamp : 07/05/2013 11:56:34
LastProvisionTimeStamp : 07/05/2013 11:55:09
LastPublishTimeStamp : 07/05/2013 11:55:14
ExchUserHoldPolicies : {}
OwnerUrn :
ContactOptionFlags :
SamAccountName : $
UserPrincipalName : alan@alantest4.onmicrosoft.com
FirstName : Alan
LastName : Byrne
WindowsEmailAddress : alan@alantest4.onmicrosoft.com
Sid : S-1-5-21-494127253-872172832-4134311428-45693982
LineServerURI :
AudioVideoDisabled : False
IPPBXSoftPhoneRoutingEnabled : False
RemoteCallControlTelephonyEnabled : False
PrivateLine :
AcpInfo : {}
HostedVoiceMail : False
DisplayName : Alan Byrne
ProxyAddresses : {sip:alan@alantest4.onmicrosoft.com, SMTP:alan@alantest4.onmicrosoft.com}
HomeServer :
TargetServerIfMoving :
EnterpriseVoiceEnabled : False
EnabledForRichPresence : True
ExchangeArchivingPolicy : Uninitialized
LineURI :
SipAddress : sip:alan@alantest4.onmicrosoft.com
Enabled : True
TenantId : 25028a26-f2ce-458d-a12f-424e8fee394a
UserRoutingGroupId : 86170cb1-c779-5849-8358-e524b5bfe847
TargetRegistrarPool :
VoicePolicy :
MobilityPolicy : MobilityEnableOutsideVoice
ConferencingPolicy : BposSAllModality
PresencePolicy :
VoiceRoutingPolicy :
RegistrarPool : sippoolams0e06.infra.lync.com
DialPlan :
LocationPolicy :
ClientPolicy :
ClientVersionPolicy :
ArchivingPolicy :
LegalInterceptPolicy :
PinPolicy :
ExternalAccessPolicy : FederationAndPICDefault
HostedVoicemailPolicy :
PersistentChatPolicy :
UserServicesPolicy :
ExperiencePolicy : W15DefaultUX
HostingProvider : SRV:
ExUmEnabled : False
Name : ad48af2a-f48c-4f1e-b5f1-3bf8289b2dc1
DistinguishedName : CN=ad48af2a-f48c-4f1e-b5f1-3bf8289b2dc1,OU=25028a26-f2ce-458d-a12f-424e8fee394a,OU=
OCS Tenants,DC=lync0e001,DC=local
Identity : CN=ad48af2a-f48c-4f1e-b5f1-3bf8289b2dc1,OU=25028a26-f2ce-458d-a12f-424e8fee394a,OU=
OCS Tenants,DC=lync0e001,DC=local
Guid : a16b3558-c161-481e-bcc0-c5f3d83292da
ObjectCategory : CN=Person,CN=Schema,CN=Configuration,DC=lync0e001,DC=local
ObjectClass : {top, person, organizationalPerson, user}
WhenChanged : 07/05/2013 11:57:40
WhenCreated : 07/05/2013 11:54:43
OriginatingServer : DB30E00ADS01.lync0e001.local
IsByPassValidation : True
IsValid : True
ObjectState : Unchanged

Related Posts

These other blog posts may be of interest to you: