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

OR

(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

Get-CsUserServicesConfiguration

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 /user:user@domain.com> 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 (http://technet.microsoft.com/en-us/sysinternals/bb664922.aspx) 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 sip.yourdomain.com
———————————————————————-
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.
Ref:http://support.microsoft.com/kb/968100

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