Wednesday, March 28, 2012

Lync 2010 Power Shell Commands

Approve-CsDeviceUpdateRuleApproves a device update rule that has been imported to the system. After a device update rule has been approved, the corresponding update will automatically be downloaded and installed by client devices affected by the update.Link
Clear-CsDeviceUpdateFileDeletes any rejected device update files that are no longer associated with a device.Link
Clear-CsDeviceUpdateLogDeletes all the Device Update Web service log and audit files that are older than the specified number of days.Link
Debug-CsLisConfigurationDisplays the Enhanced 9-1-1 (E9-1-1) Location Information service (LIS) configuration in XML format.Link
Disable-CsAdDomainUndoes the domain preparation tasks carried out by the Enable-CsAdDomain cmdlet. This cmdlet is typically used only if you are uninstalling Microsoft Lync Server 2010 from a domain.Link
Disable-CsAdForestUndoes the forest preparation tasks carried out by the Enable-CsAdForest cmdlet. This cmdlet is typically used only if you are uninstalling Microsoft Lync Server 2010.Link
Disable-CsComputerDisables a service or server role that has been removed from a computer running Microsoft Lync Server 2010.Link
Disable-CsHostingProviderDisables a hosting provider currently in use in your organization. A hosting provider is a third-party organization that provides instant messaging, presence, and related services for a domain that you would like to federate with. Hosting providers, such as Microsoft Lync Online 2010, differ from public providers (such as Yahoo!, MSN, and AOL) in that their services are not offered to the general public.Link
Disable-CsPublicProviderDisables a public provider configured for use in your organization. A public provider is an organization that provides instant messaging, presence, and related services to the general public. Microsoft Lync Server 2010 ships with three public providers configured but not enabled: Yahoo!; AOL; and MSN.

Force to use Lync Web App for conferences

If you have lync 2010 instaled on your system ,when you click on join conference URL it will launch your Lync 2010 client.What will happen some other organisation send you the link to join conference?you will not be able to join the meeting.
If you dont have Lync 2010 in your system you wil get below screen

So this will give you the option to join the meeting.But for such above case it is difficult because Lync default behaviour is like that.So if you want to force the use of Lync web app follow the below steps
simply add ?sl= to the meeting URL
The Lync Client will not launch and you can choose to run Lync Web App

Thursday, March 22, 2012

User count in Lync using Powershell

To get the number of users enable for lync run the below command

Get-CsUser -OnLyncServer | Measeure


(Get-CsUser -OnLyncServer).count

To get the list of enterprise voice enabled users run below commands

get-csuser -Filter {EnterpriseVoiceEnabled -eq $true}

For count

get-csuser -Filter {EnterpriseVoiceEnabled -eq $true} | Measure

Wednesday, March 21, 2012

Limit number of Contacts user can have in Lync

If you want to set the number of contacts a user can have please go though below steps.

To check the current configuration run below commands.It will display the current limit


Result will be like

MaxContacts: 250

Set contacts limit in global lvele follow the below comands

Set-CsUserServicesConfiguration –Identity global –MaxContacts 750

To create new policy follow the below steps

New-CsUserServicesConfiguration –Identity site:Redmond –MaxContacts 400

To create pool level find below commands

New-CsUserServicesConfiguration –Identity service:UserServer:Servername –MaxContacts 100

 To find out number of contacts for a user use the Lync resource kit tool.There is no powershell script available.

Run below command from the command prompt wher the resource kit directory

DBAnalyze.exe /> c:\output.txt

Sunday, March 11, 2012

SQL Server 2008 Installation Giving Access Denied Error

When I tried to Install SQL 2008 server in windows 2008 server i was continously getting Access denied error perticularly Database engine.I tried with multiple instances and added the service account in local administrator group,but still failing.After long trial and error last came with solution below.

The AccessChk tool will print all privleges for an account ( by running:
accesschk.exe -a <Domain>\<Account> *
Alternatively, we can check this through your group policy editor as mentioned below:
Open Group Policy...
Start | Run | Type: gpedit.msc | OK |
Navigate to
Computer Configuration\Windows Settings\Security Settings\Local Policies\User Rights Assignment\Debug programs

The account through which we are trying to run the setup should be here ( besides the local admin on that machine). I included that here, restarted the server ( this is mandatory, gpupdate /force will not work) and ran the setup and it was successful this time.
SQL Server 2008 setup needs this privilege to start up the SQL Server process and listen to an event that signals back to setup that SQL Server successfully started

Wednesday, March 7, 2012

Lync Push Notification not working in Mobile Clients

Most Of the time Lync URL Filter setting causing the issue.Blow option woked for me.Lets have a Try!
Option 1
  1. Open the Lync Server Control Panel (LSCP)
  2. Choose the IM and Presence feature from the LSCP menu
  3. Select the URL Filter page button
  4. On the Edit URL Filter - Global page, choose the Do not filter option as the Hyperlink prefix
  5. Click on the Commit button
 Option  2
  1. Open the Lync Server Control Panel (LSCP)
  2. Choose the IM and Presence feature from the LSCP menu
  3. Select the URL Filter page
  4. Leave the Send warning message option chosen as the Hyperlink prefix
  5. Click on the Select... button for the Filter these hyperlinks prefixes: feature
  6. On the Select Hyperlink Prefix page, expand the HTTP Hyperlink prefixes
  7. Remove the check mark from the http: and https: hyperlink prefixes
  8. Click on the OK button
  9. On the Edit URL Filter - Global page, click on the Commit button

Note the following Lync Server 2010 PowerShell cmdlets can be used to remove hyperlink prefixes using the Lync Server Management Shell:
  • Set-CsImFilterConfiguration -Identity -Prefixes @{remove="http:"}
  • Set-CsImFilterConfiguration -Identity -Prefixes @{remove="https:"}

Tuesday, March 6, 2012

Configure UAG Direct Access for Lync 2010

An NRPT exception consists of a fully-qualified DNS name that has no associated DirectAccess DNS Server address. This tells the DNS client to resolve the excepted name using its normal interface-configured DNS server instead of following the more general rule and sending the query to the internal DNS server.
The example below, output from the netsh namespace show policy command on a DirectAccess-enabled client, shows an exception followed by a more general rule:
Settings for
Certification authority :
DNSSEC (Validation) : disabled
DNSSEC (IPsec) : disabled
DirectAccess (DNS Servers) :
DirectAccess (IPsec) : disabled
DirectAccess (Proxy Settings) : Bypass proxy

Monday, March 5, 2012

Lync Server Front End Service Failed to Start

After installing Lync Front End server some times it wont start.Some time it will start and stop.
Some time it will give error like failed to start.Service code 1008193023
To resolve this problem, follow these steps to enable cross-database ownership chaining for the RTC database and for the RTCdyn database:
  1. On a computer that is running Microsoft SQL Server, connect to the RTC database, and then run the following SQL command from SQL Server Management Studio:
    "sp_dboption rtc, 'db chaining', TRUE"
  2. Connect to the RTCdyn database, and then run the following SQL command from SQL Server Management Studio:
    "sp_dboption rtcdyn,  'db chaining', TRUE"
  3. Start the Front End services.

Sunday, March 4, 2012

Export user details in Lync 2010 using Powershell

List of users

Get-CsUser | select-object SipAddress,LineUri,EnterpriseVoiceEnabled  ..etc

List all users who are Enterprise Voice Enabled, and have a Dial Plan of Calgary

Get-CsUser -Filter {EnterpriseVoiceEnabled -eq $True} | where {$_.DialPlan -match "Calgary"}

List all users with phone number where their AD telephone number contains xxx

Get-CsAduser -Filter {Phone -like "*xxxx"} | select-object DisplayName,Phone

Count Enterprise Voice Users with a Phone Number

(get-csuser -OnLyncServer -Filter {EnterpriseVoiceEnabled -eq $true} | Where-Object {$_.LineURI –match "tel:+"} ).count

Export a List of Enterprise Voice Users

get-csuser -Filter {EnterpriseVoiceEnabled -eq $true} | export-csv evenabled.csv