Pages

Friday, April 10, 2015

Lync 2013 DNS Records


Lync 2013 DNS Records

This Blog we will see what are all the DNS Records needs to create for Lync Deployment.

I could see so many quarries on TechNet article about Creating Dns entries.

Overview
DNS A Record
DNS SRV Record

What is A Record?
The record A specifies IP address (IPv4) for given host. A records are used for conversion of domain names to corresponding IP addresses.

What is DNS SRV Record?
A Service record (SRV record) is a specification of data in the Domain Name System defining the location, i.e. the hostname and port number, of servers for specified services.

Here is the List of DNS Records which you need to create

Internal DNS Records

Record Type                                                                                      
Value
Points to
A
lyncdiscoverinternal.contoso.com
Lync front end server/Front End Pool
A
lync.contoso.com
Lync front end server/Front End Pool
A
sip.contoso.com
Lync front end server(multiple A records if enterprise pool)
A
dialin.contoso.com
Lync front end server/Front End Pool
A
meet.contoso.com
Lync front end server/Front End Pool
A
Admin.contoso.com
Lync front end server/Front End Pool


SRV Records

Record Type
Value
Port
Points to
SRV
_ntp._udp.Contoso.com
123
Domain Controller/Time Server
SRV
_sip._tls.contoso.com
5061
Sip.contoso.com
SRV
_sipfederationtls.contoso.com
5061
Sip.contoso.com
SRV
_sipinternaltls.contoso.com
5061
Sip.contoso.com
SRV
_xmpp-server._tcp.contoso.com
5061
Sip.contoso.com

External DNS Records

Record Type                                                                                      
Value
Points to
A
lyncdiscover.contoso.com
Reverse proxy
A
Lyncwebext.contoso.com
Reverse proxy
A
sip.contoso.com
Edge server IP Address
A
dialin.contoso.com
Reverse Proxy
A
meet.contoso.com
Reverse Proxy
A
AV.contoso.com
Edge serve IP Address as per topology

Record Type
Value
Port
Points to
SRV
_sip._tls.contoso.com
5061
Sip.contoso.com
SRV
_sipfederationtls.contoso.com
5061
Sip.contoso.com
SRV
_xmpp-server._tcp.contoso.com
5269
Sip.contoso.com

Here are steps to create the DNS A records

Go to DNS server.

Select the Domain Name. Right click on domain.
Under that Select New Host (A or AAAA)

Fil the Fields
Ex:
Name: SIP
IP Address : 192.168.0.35



Creating SRV Records

Here are steps to create the DNS A records

Go to DNS server.
Select the Domain Name. Right click on domain.
Under that select Other New Records


In the below window select SRV
























Sunday, March 22, 2015

More Lync PowerShell Scripts


In this Blog we will see more Power Shell Scripts.

This Script will give you an output who all the users are enabled for SIP Address

$FilePath = "C:\temp\users.csv"
$Stuff = Import-CSV $FilePath

ForEach ($_.SAMid in $Stuff)
{
$SipAddress = "sip:"+$_.SipAddress

$User= Get-CsUser –Identity $SipAddress

If($User.Enabled -eq $null)
{
Write $sipaddress "not found"
}
elseif($User.Enabled -eq $false)
{
Write "Do Enable"
}
else
{
Write $sipaddress "User Is Enabled!"
}
}

Here is the OutPut

sip:raju.raju@Contoso.com
User Is Enabled!

Monday, March 9, 2015

Lync Call Report using SQL Query

In this blog we will see how to pull out the Lync (Enterprise Voice) outgoing call Report using SQL Query

To get the Outgoing call report

Use LcsCDR
SELECT  VoipDetails.SessionIdTime [Date],
        CONVERT(varchar(10),SessionDetails.SessionEndTime - VoipDetails.SessionIdTime,108) [Time],
        Phones.PhoneUri [From Number],
        Users1.UserUri [From Sip],
        Phones1.PhoneUri [Number Dialed]


FROM         VoipDetails LEFT OUTER JOIN SessionDetails
             ON VoipDetails.SessionIdTime = SessionDetails.SessionIdTime AND VoipDetails.SessionIdSeq = SessionDetails.SessionIdSeq
             LEFT OUTER JOIN  Phones
             ON VoipDetails.FromNumberId = Phones.PhoneId
             LEFT OUTER JOIN  Phones Phones1
             ON VoipDetails.ConnectedNumberId = Phones1.PhoneId
             LEFT OUTER JOIN  Users Users1
             ON SessionDetails.User1Id = Users1.UserId

where SessionDetails.ResponseCode = 200
      and VoipDetails.SessionIdTime between '2013-10-01 00:00:00' and '2013-10-01 23:59:59'     
order by VoipDetails.SessionIdTime

Here is the Output of above query


Date Time From Number From SIP                                Number Dialed







10/1/2014 6:50 0:04:46 1234567890 user01@contoso.com             1234567893

10/1/2014 6:52 0:01:54 1234567891 user02@contoso.com             1234567895

10/1/2014 6:54 0:02:32 1234567892 user03@contoso.com             1234567896

10/1/2014 6:57 0:00:37 1234567893 user04@contoso.com             1234567897












To get the Outgoing call report for the Particular Users


Use LcsCDR
SELECT VoipDetails.SessionIdTime [Date],
       CONVERT(varchar(10),SessionDetails.SessionEndTime - VoipDetails.SessionIdTime,108) [Time],
       Phones.PhoneUri [From Number],
       Users1.UserUri [From Sip],
       Phones1.PhoneUri [Number Dialed]

FROM         VoipDetails LEFT OUTER JOIN SessionDetails
                        ON VoipDetails.SessionIdTime = SessionDetails.SessionIdTime AND VoipDetails.SessionIdSeq = SessionDetails.SessionIdSeq
                        LEFT OUTER JOIN  Phones
                        ON VoipDetails.FromNumberId = Phones.PhoneId
                        LEFT OUTER JOIN  Phones Phones1
                        ON VoipDetails.ConnectedNumberId = Phones1.PhoneId
                        LEFT OUTER JOIN  Users Users1
                        ON SessionDetails.User1Id = Users1.UserId

where SessionDetails.ResponseCode = 200
         and VoipDetails.SessionIdTime between '2014-10-01 00:00:00' and '2013-10-01 23:59:59'        
         and Phones1.PhoneUri is not null
     and Phones.PhoneUri  is not null
     AND Users1.UserUri IN ('User01@contoso.com','User02@contoso.com')
order by VoipDetails.SessionIdTime


Any Comments are Welcome :)

Sunday, March 8, 2015

Lync User Last Login Time using SQL

Lync User Last Login Time using SQL

In this Blog we will see Lync users last login time using Sql Query

SELECT  u.UserUri
      ,us.[LastLogInTime]

  FROM [LcsCDR].[dbo].[UserStatistics] us left join
  [LcsCDR].[dbo].Users u on us.UserId = u.UserId
  order by us.LastLogInTime desc

Saturday, February 21, 2015

Powershell Scripts for Lync 2103


In this Blog we see few Power shell scripts/ Lync Management scripts for day to day Jobs

To get the Lync Enabled users.

Get-CsUser -OnLyncServer -Filter {Enabled -eq $true} | Select-Object SipAddress, SamAccountName, DisplayName, LineURI, Enabled, EnterpriseVoiceEnabled, ConferencingPolicy | Export-CSV -Path C:\Output\Lynceabled users.txt


To Add an Federated Domain using Command.

New-CsAllowedDomain -Identity "Contoso.com" -ProxyFqdn "sip.contoso.com" -MarkForMonitoring $True -Comment "you can put comments here how requested"

To get Disabled AD accounts for Lync users

Get-CsAdUser | ?{$_.UserAccountControl -match "AccountDisabled" -and $_.Enabled -eq $true} | ft Name,Enabled,SipAddress -auto | Tee-Object -FilePath C:\Output\DisabledADaccounts.txt


Any Comments are Welcome :) 

Lync BackUP Powershell Script

This Script is to take the Back up of Lync using Power Shell Script .

$BackupPath = "C:\BackupLync" ( Change the Backup path according to your's)
$FileStore = "\\Lync01.Contoso.com\Lyncshare" ( Change File store according to Your's)
$Pool = "lyncpool01.Contoso.Com"        ( Change the pool name)    
$SQLinstance = "lyncrtc.Contoso.com\rtc" ( Change te Sql instance )
$RemoteLocation = "\\lync02\C$\BackupLync" ( Change the Back Up Location)

md $BackupPath\"backup_$((get-date).toString('ddMMyyyy'))"

Export-CsConfiguration -FileName $BackupPath\"backup_$((get-date).toString('ddMMyyyy'))"\Config.zip

Export-CslisConfiguration -FileName $BackupPath\"backup_$((get-date).toString('ddMMyyyy'))"\CsLISconfig.zip

CD "C:\Program Files\Common Files\Microsoft Lync Server 2010\Support\"
./DBImpExp.exe /hrxmlfile:"$BackupPath\"backup_$((get-date).toString('ddMMyyyy'))"\UserData.xml" /sqlserver:$SQLinstance

CD "C:\Program Files\Microsoft Lync Server 2010\ResKit\"
Import-Module .\RgsImportExport.ps1
Export-CsRgsConfiguration -Source applicationserver:$Pool –FileName $BackupPath\"backup_$((get-date).toString('ddMMyyyy'))"\RGSconfig.zip

md $BackupPath\"backup_$((get-date).toString('ddMMyyyy'))"\FileStore
xcopy /E /C /H /K /O $FileStore $BackupPath\"backup_$((get-date).toString('ddMMyyyy'))"\FileStore > $BackupPath\"backup_$((get-date).toString('ddMMyyyy'))"\FileStore\FileStoreFileCopyList.txt

Get-CsTopology -AsXML | Out-File $BackupPath\"backup_$((get-date).toString('ddMMyyyy'))"\CSTopology.xml

md \\lync01\C$\BackupLync\"backup_$((get-date).toString('ddMMyyyy'))"
xcopy /E /C /H /K /O $BackupPath\"backup_$((get-date).toString('ddMMyyyy'))" $RemoteLocation\"backup_$((get-date).toString('ddMMyyyy'))"


Any Comments are Welcome :) 


Monday, January 5, 2015

Lync 2013 + Exchange Owa 2013 Integration

 

In this Bolg we will see how to integrate Lync 2013 with Exchange OWA 2013.

Before proceeding to the integration first we have to check if auto discover URL and the Service is Published at the Exchange end.

Open Exchange Management shell

And type

Get-ClientAccessServer | Select-Object Name, AutoDiscoverServiceInternalUri | Format-List or with the following command Get-ClientAccessServer | fl fqdn, AutodiscoverServiceInternalURI

Under Auto Discover URL you should see https://autodiscover.contoso.com/autodiscover/autodiscover.xml.

clip_image002

If the URL is Blank you can set the URL by this command

Get-ClientAccessServer | Set-ClientAccessServer -AutoDiscoverServiceInternalUri https://autodiscover.contoso.com/autodiscover/autodiscover.xml

Now we have to set the Autodiscover Service

The Autodiscover service does the following:

Automatically configures user profile settings for clients running Microsoft Office Outlook 2007, Outlook 2010, or Outlook 2013, as well as supported mobile phones. Phones running Windows Mobile 6.1 or a later version are supported. If your phone isn't a Windows Mobile phone, check your mobile phone documentation to see if it's supported.

Provides access to Exchange features for Outlook 2007, Outlook 2010, or Outlook 2013 clients that are connected to your Exchange messaging environment.

Uses a user's email address and password to provide profile settings to Outlook 2007, Outlook 2010, or Outlook 2013 clients and supported mobile phones. If the Outlook client is joined to a domain, the user's domain account is used.

Set-CsOAuthConfiguration -Identity global -ExchangeAutodiscoverUrl https://autodiscover.contoso.com/autodiscover/autodiscover.svc

Now we have to identify the certificate that has been assigned in IIS

Here is the command to get the certificate Thumprint Information

Get-ExchangeCertificate|fl Services,Thumbprint

clip_image004

Copy the certificate Thumbprint in the later stage we will be using this certificate Thumprint. 5EA8831E757FBB86808B95B69F81D01A2FC2F55A

To get the owa virtual directory . to make sure you have only single owa virtual directory configured in your environment

Get-OWAVirtualDirectory

clip_image006

Use the below command to assign the pool name of lync server and the certificate thumbprint to OWA virtual directory. Now this enables IM capabilities for you exchange environment.

Get-OwaVirtualDirectory | Set-OwaVirtualDirectory -InstantMessagingType OCS -InstantMessagingEnabled:$true –InstantMessagingCertificateThumbprint 5EA8831E757FBB86808B95B69F81D01A2FC2F55A -InstantMessagingServerName pool.contoso.com

Next we must add the following two lines to Outlook Web App Web.config which will be available in this path C:\Program Files\Microsoft\Exchange Server\V15\ClientAccess\Owa

In this path you see an file web.config file open the file in notepad. under <AppSettings> add the below two lines

<add key="IMCertificateThumbprint" value="5EA8831E757FBB86808B95B69F81D01A2FC2F55A "/>

<add key="IMServerName" value="pool.contoso.com"/>

clip_image008

Now try to perform IIS reset in the Command prompt

Iisreset

clip_image010

At the Lync server End Configuration

Now login to your lync front end and open the Lync Management shell

To get he SITE ID of lync enter the Below Command we will be using Lync Site id while configuring the Exchange trusted Application.

Get-CsSite

We have to create the Trusted Application pool for Excahnge OWA to create the one use the following command

New-CsTrustedApplicationPool -Identity <Certificate Subject name of client access server> -Registrar <Pool FQDN of Lync server> -Site <Lync Site Name> -RequiresReplication $False

After creating the trusted application pool, use the following command to configure an application Identity and a port for Outlook Web App

Before executing the below command check if the port is not using any other application. You can use any port but make sure to check the port is available

netstat -a | findstr 5199

New-CsTrustedApplication -ApplicationId OutlookWebAccess -TrustedApplicationPoolFqdn < Certificate Subject name of client access server> -Port 5199

Now use this command to apply the configuration changes Enable-CsTopology. This command but publishing the Lync Topology.

Enable-CsTopology.

Now it’s testing time. Try logging to OWA and click on sing to IM in OWA web page

clip_image012

Successfully logged in to IM using OWA

clip_image014

Now we will be able to IM with Lync users form OWA itself.

Trouble shooting Lync OWA Integration.

1) Make sure that our OWA Virtual Directory enabled for Instant Messaging

Get-OwaVirtualDirectory -Server <Excahnge server> | Set-OwaVirtualDirectory -InstantMessagingEnable $True -InstantMessagingType OCS

2) Make sure that in the OWA Web config file you have added these lines

<add key="IMCertificateThumbprint" value="5EA8831E757FBB86808B95B69F81D01A2FC2F55A <Your Certificate Thumbprint> "/>

<add key="IMServerName" value="pool.contosot.com"/>

3) To start the trace and to get the Log file

On the exchange server you can use OcsTracer.exe in the following path C:\Program Files\Microsoft UCMA 4.0\Runtime\Tracing

To start the trace use the command prompt and go the path enter below command

OCSTracer.exe Start /Component:Collaboration,TL_noise,tf_component,tf_diag,tf_protocol,tf_connection /Component:S4,TL_VERBOSE,tf_component,tf_protocol /LogFileMode:NewFile,20

To Stop Logging

OCSTracer Stop /Component:Collaboration /component:s4 /OutputFile:traces.txt /View

It will open the Notepad file so that you check the logs.