All posts by moh10ly

Windows 10 powershell’s Linux sudo apt-get install like CMDlet with Chocolately app

The Story

Windows 10 has arrived finally and with it came lot of new features, and one of my favorite new features is that you can finally install applications through powershell just like Linux OS’s terminal window command (apt-get install).

Although the command is still pretty new and lack many repositories where you can find and install applications from.

There’s already some people who are working on adding sources of applications which you can test initially before Microsoft asks product companies to start making their own repositories so Powershell can trust these sites and applications.

One of the sites that are working on providing Windows 10 with repositories is https://chocolatey.org/ which provides hundreds of softwares that can be installed through PS.

To install Chocolately repository simply do the following

Open powershell as an administrator and paste the following cmdlet

@powershell -NoProfile -ExecutionPolicy Bypass -Command “iex ((new-object net.webclient).DownloadString(‘https://chocolatey.org/install.ps1’))” && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin

clip_image001

Then this

iex ((new-object net.webclient).DownloadString(‘https://chocolatey.org/install.ps1’))

clip_image002

From

https://chocolatey.org/

As soon as you have installed chocolately, you will get a new huge list of applications that can be installed with a very simple and short cmdlet as in the below screenshots.

The good things about these cmdlets is it can be used to deploy an app for a huge number of clients by simply running the script through GPO or batch file.

I am going to install VLC and Google drive on my computer using these cmdlet …

Find-Package

Find-package -Name VLC

clip_image003

clip_image004

Install-package

clip_image005

clip_image006

clip_image007

Checking if the app is really installed or not?

clip_image008

——————————————

Find and install google drive package

Downloading

clip_image009

Installing

clip_image010

clip_image011

If an application doesn’t install, how to troubleshoot it?

If for instance you were trying to install a package or app and that doesn’t work or get stuck then you can navigate to the Chocolately directory and delete any package that you tried to install but were suspended for any reason.

c:\Chocolately\lib\

clip_image012

You can simply delete the whole directory or the file that ends with extension .nupkg and try again to install…

clip_image013

Migrating DFS from 2000 Mode to 2008 step by step

The Story

Few months ago I have got a request from one of my clients regarding migrating DFS from 2012R2 to 2016.

2012R2 was migrated from 2008r2 and was based on 2000 Mode. To do this you’ve got a list of requirements as it can be migrated but certain features won’t be supported if you continue to use the 2000 Mode in DFS on Windows 2016 server.

How to Start

In this tutorial I will explain how to do this migration by doing a demo step by step and guide you through this Migration with screenshots and the required commands.

I have added a tiny comparison also to make it clear why are we going to use this particular method of migrating DFS mode and Server.

clip_image001[4]

To migrate a domain-based namespace to Windows Server 2008 mode

  1. Open a Command Prompt window and type the following command to export the namespace to a file, where \\ domain \ namespace is the name of the appropriate domain and namespace and path\filename is the path and file name of the export file:
On the source DC/DFS Server

Dfsutil root export \\domain\namespace C:\filename.xml

clip_image002[4]

clip_image003[4]

  1. Write down the path (\\ server \ share ) for each namespace server. You must manually add namespace servers to the recreated namespace because Dfsutil cannot import namespace servers.

clip_image004[4]

clip_image005[4]

  1. In DFS Management, right-click the namespace and then click Delete , or type the following command at a command prompt, where \\ domain \ namespace is the name of the appropriate domain and namespace:
    Copy
    Dfsutil root remove \\domain\namespace

clip_image006[4]

Let’s go refresh the console and see if it’s deleted there

clip_image007[4]

clip_image008[4]

Next remove

clip_image009[4]

clip_image010[4]

I will remove the rest of the name spaces

clip_image011[4]

All have been removed, Now lets remove the name spaces from the display and observe what happens to the replication groups

clip_image012[4]

NOTE:

Replication groups didn’t get affected

clip_image013[4]

  1. In DFS Management, recreate the namespace with the same name, but use the Windows Server 2008 mode, or type the following command at a command prompt, where \\ server \ namespace is the name of the appropriate server and share for the namespace root:
    Dfsutil root adddom \\server\namespace v2
I will use the UI instead of the command

clip_image014[4]

Although we raised the forest and domain function forest but still the 2008 is still greyed out. Lets try to restart the DFS services on the FSMO server

clip_image015[4]

clip_image016[4]

After restarting

clip_image017[4]

clip_image018[4]

Next, I will copy all the xml files to the new server and import them there

My new server is 2016

clip_image019[4]

  1. To import the namespace from the export file, type the following command at a command prompt, where \\ domain \ namespace is the name of the appropriate domain and namespace and path\filename is the path and file name of the file to import:
    Dfsutil root import merge path\filename.xml \\domain\namespace

clip_image020[4]

After the Import

clip_image021[4]

clip_image022[4]

I will continue to import the rest of the namespaces

First we need to create them with their matching namespaces from the GUI

clip_image023[4]

clip_image024[4]

Now I will import and merge the xml file

clip_image025[4]

clip_image026[4]

After adding the NEW folder which has replicating group existing already from the previous mode. First it didn’t show up

clip_image027[4]

but after navigating to the NewFolder and clicking on Replication tab then Navigate to the replication group showed the replication group underneath the Replication

clip_image028[4]

What has changed?

The only noticeable thing which has changed is the NameSpace Servers everything else like ( Folder targets still the same, replication is identical to previous settings)

See this screenshot

clip_image029[4]

Let’s check the access to the new namespace

clip_image030[4]

Finally, Let’s import the latest namespace and its configuration (PublicFolder)

clip_image031[4]

clip_image032[4]

Let’s check the result on GUI

clip_image033[4]

Notice the replication group for the PF didn’t come, so let’s do as we have explained before to show the replication group

Here we go

clip_image034[4]

Right after this process finishes, the command creates some kind of a report with time, importing status and other related settings such as site cost, timeout.. Etc

clip_image035[7]

Note

To minimize the time that is required to import a large namespace, run the Dfsutil root import command locally on a namespace server.

Add any remaining namespace servers to the recreated namespace by right-clicking the namespace in DFS Management and then clicking Add Namespace Server , or by typing the following command at a command prompt, where \\ server \ share is the name of the appropriate server and share for the namespace root:
Copy
Dfsutil target add \\server\share

Note

You can add namespace servers before importing the namespace, but doing so causes the namespace servers to incrementally download the metadata for the namespace instead of immediately downloading the entire namespace after being added as a namespace server.

Ref:

https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2008-R2-and-2008/cc753875(v=ws.11)

LYNC 2013 TO SKYPE FOR BUSINESS IN-PLACE UPGRADE WITH MONITORING DATABASE

This article guides you through the steps of doing an in-place upgrade from Lync 2013 to Skype for business. I am copying the article as is from my lab with all the errors that I have been through to give you a real experience feed back of what is this like.

You might get issues that you have never expected, but resolving them is not that hard and if you have any issues please don’t hesitate to leave a comment and I will get back to help you.

Prerequisites

Extensible Chat Communication Over SIP protocol (XCCOS)

From <https://technet.microsoft.com/en-us/library/dn951390.aspx>

References:

https://technet.microsoft.com/en-us/library/dn951371.aspx?f=255&MSPPError=-2147217396

https://technet.microsoft.com/en-us/library/dn933900.aspx

Lync CU 5

https://www.microsoft.com/en-us/download/details.aspx?id=36820

Kb2533623 Windows Server 2008 R2

http://support.microsoft.com/kb/2533623

Kb2858668 Windows Server 2012

http://support.microsoft.com/kb/2858668

KB2982006 Windows Server 2012 R2

https://onedrive.live.com/redir?resid=82488EABA4ACDB15!38654&authkey=!AE9IJKbMPtkge8U&ithint=file%2cexe

SQL 2012 SP2 for Express version

https://www.microsoft.com/en-us/download/details.aspx?id=43351

clip_image001

First Issue:

Upon running the setup I have got the following error:

Prerequisite not satisfied: Internet Information Services (IIS) must be installed before attempting to install this product.

Prerequisite not satisfied: The following Internet Information Services (IIS) role services must be installed before attempting to install this product: Static Content, Default Document, HTTP Errors, ASP.NET, .NET Extensibility, Internet Server API (ISAPI) Extensions, ISAPI Filters, HTTP Logging, Logging Tools, Tracing, Client Certificate Mapping Authentication, Windows Authentication, Request Filtering, Static Content Compression, Dynamic Content Compression, IIS Management Console, IIS Management Scripts and Tools

Prerequisite not satisfied: Before you install Skype for Business Server 2015, you must install an update for Windows Server 2012 R2. For details about the update, see Microsoft Knowledge Base article 2982006, “IIS crashes occasionally when a request is sent to a default document in Windows 8.1 or Windows Server 2012 R2” at http://go.microsoft.com/fwlink/?LinkId=519376

Prerequisite not satisfied: Before you install Skype for Business Server 2015, you must install Microsoft ASP.NET 4.5 by using the Add Roles and Features Wizard in Windows Server 2012 Server Manager. Install the ASP.NET 4.5 role service of the Web Server (IIS) role.

Prerequisite not satisfied: Before you install Skype for Business Server 2015, you must install Microsoft Windows Communication Foundation Activation by using the Add Roles and Features Wizard in Windows Server 2012 Server Manager. Install WCF Services and HTTP Activation, which are included with the Microsoft .NET Framework 4.5 feature.

http://go.microsoft.com/fwlink/?LinkId=519376

Powershell

$PSVersionTable

clip_image002

I will re-run prerequisites to make sure that all are satisfied before running setup again.

STEP 1 : Installing Prerequisites for this In-Place Upgrade

Add-WindowsFeature NET-Framework-Core, RSAT-ADDS, Windows-Identity-Foundation, Web-Server, Web-Static-Content, Web-Default-Doc, Web-Http-Errors, Web-Dir-Browsing, Web-Asp-Net, Web-Net-Ext, Web-ISAPI-Ext, Web-ISAPI-Filter, Web-Http-Logging, Web-Log-Libraries, Web-Request-Monitor, Web-Http-Tracing, Web-Basic-Auth, Web-Windows-Auth, Web-Client-Auth, Web-Filtering, Web-Stat-Compression, Web-Dyn-Compression, NET-WCF-HTTP-Activation45, Web-Asp-Net45, Web-Mgmt-Tools, Web-Scripting-Tools, Web-Mgmt-Compat, Server-Media-Foundation, BITS, Desktop-Experience, Telnet-Client

https://docs.microsoft.com/en-us/skypeforbusiness/plan-your-deployment/requirements-for-your-environment/server-requirements

Updated aug-2018

clip_image003

clip_image004

STEP 2: Installing CU5

Download and install CU5

https://www.microsoft.com/en-us/download/details.aspx?id=36820

clip_image005

clip_image006

After the restart we will apply the update of the databases which in my case is going to be the FQDN of the FE server since it’s standard version and not Backend server.

Install-CsDatabase -ConfiguredDatabases -SqlServerFqdn lyncfe01.adeo.local -Verbose

clip_image007

clip_image007[1]

Time to upgrade the Archiving/Monitoring databases.

To upgrade we’ll use the same command except change the FQDN of the SQL server to the SQL server where Monitoring and Archiving databases are at.

Install-CsDatabase -ConfiguredDatabases -SqlServerFqdn sql01.adeo.local -Verbose

clip_image008

clip_image009

clip_image010

Applying CMS upgrade

clip_image011

Install-CsDatabase -CentralmanagementDatabase -SqlServerFqdn Lyncfe01.adeo.local -SqlInstanceName rtc -verbose

clip_image012

clip_image013

Then run enable-cstopology

Last thing in the CU5 update is

%ProgramFiles%\Microsoft Lync Server 2013\Deployment\Bootstrapper.exe

clip_image014

clip_image015

https://support.microsoft.com/en-us/kb/2809243

Step 3 : Installing Windows OS hotfix.

KB2982006 Windows Server 2012 R2

Since the FE is on Windows Server 2012 R2 then we’ll need to download this link

https://onedrive.live.com/redir?resid=82488EABA4ACDB15!38654&authkey=!AE9IJKbMPtkge8U&ithint=file%2cexe

RESTART is Required

clip_image016

STEP 4 : Install SQL Service Pack 2 (Express) for your Lync Front end Standard Edition

First Download SQL Express SP2 setup

clip_image017

You can patch the server by opening a Lync Management Shell window and entering the following commands:

Stop-CsWindowsService

.\SQLEXPR_x64_ENU.exe /ACTION=Patch /allinstances /IAcceptSQLServerLicenseTerms

clip_image018

clip_image019

clip_image020

clip_image021

clip_image022

clip_image023

clip_image024

clip_image025

Step 5: SQL Server (Standard or Enterprise) for (Monitoring, Archiving)

https://support.microsoft.com/en-us/kb/321185

clip_image026

My SQL Server version is SP1 so I don’t need to upgrade it to SP2

clip_image027

Step 6- In-place Upgrade for Skype For Business

In order to do the in-place upgrade, we’ll need to use a machine that doesn’t have Lync 2013 to install the new Topology builder and do the upgrade process

On a different Machine that’s joined to the same domain, I will run the prerequisites script and restart the machine. then I’ll load the Skype for business ISO and install

clip_image028

D:\Setup\amd64\Setup.exe

clip_image029

clip_image030

clip_image031

clip_image032

We’ll now press on Installing Administrative tools

clip_image033

clip_image034

clip_image035

Now in order to continue we’ll have to open the topology builder in order to upgrade our Lync 2013 topology

I’ll open the topology builder and save the topology file somewhere

clip_image036

Once the topology is open, I’ll navigate to the Standard FE Servers and right click on my main server to upgrade

clip_image037

clip_image038

I’ll click on Upgrade to Skype for Business Server 2015…

clip_image039

As soon as you press Yes, the Frontend server that you selected will be moved under the Skype For Business Server 2015 tab as you can see below.

clip_image040

Since I have two FE servers (FE and SBS) I will be upgrading them both but not in the same time not not fall into any errors, so I will publish the topology and see what happens.

clip_image041

clip_image042

We’ll check what do we need to do now in order to upgrade the servers, here is what we’ll do.

Import existing normalization rules from the previous Skype for Business Server deployment. If you want to keep your existing normalization rules you will need to import them using the Import-CsCompanyPhoneNormalizationRules cmdlet. If you have separate normalization rules for each pool then you will need to run the command for each set.

To perform an in-place upgrade of your Skype for Business Server, you’ll need to do the following, in order:

(1) Stop the Skype for Business services on all of the servers that you are upgrading;

(2) Run Skype for Business Server setup (Setup.exe) on all of the servers you are upgrading;

(3) Start the Skype for Business services on all of the servers you upgraded. To start the services in a Front End pool, connect to one of the servers in the pool and run the Start-CsPool cmdlet. All the servers in the pool should be running Skype for Business Server before you use the Start-CsPool cmdlet. To start the services in all other pools (e.g. Edge pool, Mediation pool), run the Start-CsWindowsService cmdlet on every server in the pool;

Server FQDN: lyncfe01.adeo.local, Pool FQDN: lyncfe01.adeo.local

On Lync FE 01 I’ll stop all the services using Stop-cswindowsservice

clip_image043

Now on the same server I’ll load the Skype4B ISO and start the setup

D:\Setup\amd64\Setup.exe

clip_image029[1]

clip_image030[1]

clip_image031[1]

Started at 1:40pm

clip_image044

clip_image045

clip_image046

clip_image047

clip_image048

clip_image049

NOTE:

The required time for the upgrade process is estimated around 75-90 Minutes for each FE Server.

clip_image050

clip_image051

Starting ‘Verifying upgrade readiness…’

‘Verifying upgrade readiness…’ completed successfully

Starting ‘Installing missing prerequisites…’

‘Installing missing prerequisites…’ completed successfully

Starting ‘Uninstalling roles…’

‘Uninstalling roles…’ completed successfully

Starting ‘Detaching database…’

‘Detaching database…’ completed successfully

Starting ‘Uninstalling local management services…’

‘Uninstalling local management services…’ completed successfully

Starting ‘Installing and configuring core components…’

‘Installing and configuring core components…’ completed successfully

Starting ‘Installing administrative tools…’

‘Installing administrative tools…’ completed successfully

Starting ‘Installing local management services…’

‘Installing local management services…’ completed successfully

Starting ‘Attaching database…’

‘Attaching database…’ completed successfully

Starting ‘Upgrading database…’

‘Upgrading database…’ completed successfully

Starting ‘Enabling replica…’

‘Enabling replica…’ completed successfully

Starting ‘Installing roles…’

‘Installing roles…’ completed successfully

Starting ‘Verifying installation…’

‘Verifying installation…’ completed successfully

clip_image052

Upgrade the SBS (Survivable Branch Server) in the pool to Skype4B

clip_image053

clip_image054

Publish the topology

clip_image055

I’ll stop the service before I start the upgrade process.

clip_image056

I’ll load the ISO on the second server and start the upgrade.

D:\Setup\amd64\Setup.exe

clip_image029[2]

clip_image030[2]

clip_image031[2]

clip_image057

Apparently I forgot to update Lync to the latest CU

clip_image058

clip_image059

clip_image060

Web Conferencing Server connection failed to Establish on Edge server

Web Conferencing Server connection failed to Establish on Edge server

In an environment of a domain with a backup DC you might face a problem with Lync Edge deployment.

After the step where you have to add the CA authority certificate to your Trusted CA store in Edge Server you might notice

some errors with Edge server trusting the connection from Front end or vice versa.

The problem will happen if there’s two CA certificates in the Trusted CA store and you only have imported one of them.

Looking at the Front End server Certificate store which is joined to the Domain.

Errors might be generated by the same symptom are:

Web Conferencing Server connection failed to establish.

Over the past 1 minutes Lync Server has experienced incoming TLS connection failures 1 time(s). The error code of the last

failure is 0x80090325 (The certificate chain was issued by an authority that is not trusted.

) and the last connection was from the host “”.

Cause: This can occur if this box is not properly configured for TLS communications with remote Web Conferencing Server.

Resolution:

Check your topology configuration to ensure that both this host and remote Web Conferencing Server can validate each

other TLS certificates and are otherwise trusted for communications.

The XMPP Translating Gateway Proxy has no connections to any XMPP gateways.

Cause: Connectivity issue.

Resolution:

Check that a configured gateway is running.

TLS outgoing connection failures.

Over the past 1 minutes, Lync Server has experienced TLS outgoing connection failures 1 time(s). The error code of the

last failure is 0x80090325 (The certificate chain was issued by an authority that is not trusted.) while trying to connect to

the server “EGELYNCFE.domain.local” at address [192.168.16.45:5061], and the display name in the peer certificate is

“Unavailable”.

Cause: Most often a problem with the peer certificate or perhaps the host name (DNS) record used to reach the peer

server. Target principal name is incorrect means that the peer certificate does not contain the name that the local server

used to connect. Certificate root not trusted error means that the peer certificate was issued by a remote CA that is not

trusted by the local machine.

Resolution:

Check that the address and port matches the FQDN used to connect, and that the peer certificate contains this FQDN

somewhere in its subject or SAN fields. If the FQDN refers to a DNS load balanced pool then check that all addresses

returned by DNS refer to a server in the same pool. For untrusted root errors, ensure that the remote CA certificate chain

is installed locally. If you have already installed the remote CA certificate chain, then try rebooting the local machine.

Resolution:

To Resolve this problem, make sure that you export both CA from Front End and import them in to Edge’s Trusted root

CA Local store.

Lync Distribution Group

To add a certain number of Lync users to certain client list, you can create a distribution group with the following options

  1. The group scope should be universal
  2. The group type will be Distribution.
  3. You must include the e-mail address

Now when this group is created, you can add any number of users to it. I will add couple of users from Lync users

After adding the users that I wanted to add. Now I have to go to Lync server and force the Address book synchronization between GAL and Lync.

Wait about 5 mins to Clients to download latest updates and then you will be able to see the changes on the client list. If not you can force the clients to download the new updates by using GPO to force special registry value

This registry will be applied on the Clients

reg add HKLM\Software\Policies\Microsoft\Office\15.0\Lync /v GalDownloadInitialDelay /t REG_DWORD /d 0 /f

From here you can now see the changes on Lync’s contact lists.

Lync Topology Publishing issues

Enable-CsTopology : Multiple Active Directory entries were found for type “ms-RTC-SIP-EdgeProxy” with ID in a multiple Domain Environment

Enable-CsTopology : Multiple Active Directory entries were found for type “ms-RTC-SIP-EdgeProxy” with ID

“egelyncedge.domain.local”.

At line:1 char:1

+ Enable-CsTopology

+ ~~~~~~~~~~~~~~~~~

+ CategoryInfo : InvalidData: (:SourceCollection) [Enable-CsTopology], InvalidDataException

+ FullyQualifiedErrorId : DuplicateADEntry,Microsoft.Rtc.Management.Deployment.ActivateTopologyCmdlet

to enlarge please click on the screenshot

to enlarge please click on the screenshot

Open ADSIEDIT and look in the following snapshot. Open Configuration for your DC

Collapse the menu and click on Services

Click on RTC Service

Click on Global Settings and on the right pane look if there’s any duplicated entries and remove them.

As you can see on my right pane I have 2 duplicated (msRTCSIP-EdgeProxy) and I’m going to remove one of them and see

if I can publish my topology or not. But before that I will have to make sure that I export the entry that I wanna delete.

to enlarge please click on the screenshot

I right clicked on the last value and deleted it and here how it became now.

to enlarge please click on the screenshot

Now I will try to publish my topology and see what happens, my topology publishing failed with

a new error this time.

to enlarge please click on the screenshot

I will have to go and check where’s this coming from, since it mentions TrustedService. I will go look in the trusted service

This is not going to be easy, as you need to be careful where you look .. You will need to make sure that you’re looking

at the right FQDN

to enlarge please click on the screenshot

Here I could find the value MRAS for the FQDN Edge server

So I looked here and found 2 identical entries with a different (CN) if you scroll down you will see that the GruuId is the

same, FQDN is the same, port is the same.

to enlarge please click on the screenshot

to enlarge please click on the screenshot

Let’s delete one of them and see again if we can publish our topology, So I deleted the one that starts with {b344}

I will do this using the Lync Powershell, you can see below that the Topology was published successfully.

to enlarge please click on the screenshot

To resolve the warning you will have to issue the cmdlet Enable-CsAdForest after the Enable-CsTopology

to enlarge please click on the screenshot

Set Pin Authentication for Lync on DHCP Server

NOTE: I have attached the DHCPUTIL and all of the other required files with it, so you directly download them to your DHCP Server.

This is the shortest way to setup up Pin Authentication for Lync on the DHCP Server…

First Copy/Download all the DHCP Utilities content from Lync Front end server to DHCP server and run the following command line

Note: Make sure you run DHCP on Command line (CMD) as an administrator.

DHCPUtil.exe -SipServer YourFrontendFQDN.com –WebServer YourFrontendFQDN.com -RunConfigScript

On Lync Server make sure you run the following CMDLET on Lync powershell

set-CsRegistrarConfiguration -EnableDHCPServer $true

That’s it you should be all set after you ran this command line and you should be able to see the new DHCP options are showing in the DHCP server console.

To test the configuration you can run the same tool with a different parameter which will do the test for you, On a nother computer that’s not the “DHCP” open command prompt and run the following command line.

DHCPutil.exe -EmulateClient

Note: I’m attaching all the required files to this page below for download.

Troubleshooting:

If you run the command and you get the error below, then you might have a missing step

DHCPUtil.exe -SipServer YourFrontendFQDN.com –WebServer YourFrontendFQDN.com -RunConfigScript

C:\Users\admin\Desktop>DHCPUtil.exe -EmulateClient

Starting Discovery …

Result: Failure = -2147014848

Resolution:

On the Lync Server run the command

set-CsRegistrarConfiguration -EnableDHCPServer $true

Again on Lync server “Not DHCP” run the DHCPUtil.exe -EmulateClient to test the configuration.

FREEPBX (ASTERISK NOW) WITH SKYPE FOR BUSINESS INTEGRATION

In my earliest article about Lync with Asterisk Now (FreePBX) I have written step by step guide on how to integrate Lync and FreePBX but since Skype for Business came out and the new version of Free PBX 13.0.84 I thought it would be good idea to try the integration between both of them ..

In Skype for Business server I am using the latest CU version 6.0.9319.0.

image

The steps are very similar to the original article except with some UI changes..

In the following article I will be only showing the main steps which I have taken to integrate Skype for Business with FreePBX and will show the steps that have been done on the FreePBX side only not on the Skype for Business server as it is very similar to the original article.

Integration of AsteriskNow (FreePBX 13.0.84) and Skype for Business Server

clip_image001[4]

Creating Trunk for Skype for Business

First I will start by creating a new trunk for S4B and configure it. To configure the trunk (Skype for Business trunk for outgoing calls from Asterisk to S4B)

Click on Connectivity >> Trunks and follow the below screenshots.

clip_image001
clip_image002

Under the SIP settings (Outgoing) tab type the following

host=10.10.124.120

transport=tcp

port=5060

insecure=very

type=friend

context=from-internal

promiscredir=yes

qualify=yes

canreinvite=yes

In the incoming tab make sure you delete everything and then submit changes

Configure the Trunk with an outbound route

clip_image003

While creating the Outbound route, this route must be associated with the Trunk that I have created earlier in the trunk sequence as in the below screenshot..

clip_image004

In my case the pattern NXXX should be enough as it’ll route the call to my S4B’s 4 extension users (5000)

clip_image005

==========================================

Click on Connectivity >>> Inbound routes

Click add inbound route

clip_image006
clip_image007
clip_image008

==========================================

Now the most important is the SIP settings

Configuring Asterisknow to accept TCP calls from S4B

From the Settings menu ->> click on Asterisk SIP settings then choose Chan SIP settings and do the same configuration like the one below

clip_image009

Scroll further down to the “Advanced General Settings”

Enter the two “Other SIP settings” fields below and submit changes.

clip_image010
clip_image011
clip_image012

Conference with 2 Extensions on Asterisk now with s4B

clip_image013

I can call from S4B to Asterisk extensions and vice versa without any issues.

Full FreePBX 6.12.65 Integration Guide with Lync 2013

Installing AsteriskNow (FreePBX 6.12.65) and integration with Lync 2013

Download AsteriskNow from the following Link

http://www.asterisk.org/downloads/asterisknow

First the setup window will come: there I will choose No RAID on Asterisk 13 since this is a virtual machine.

clip_image001

Here I will choose IPv4 static IP (Manual configuration) and click OK

clip_image002
clip_image003
clip_image004

Choose the time zone according to the nearest location to you

clip_image005

Next, we’ll configure the root password

clip_image006

Here it’s formatting the Disk that I have assigned to the VM.

clip_image007

It should start the installation now and should download all the required packages from the internet incase they were not found on the ISO which I’ve loaded.

clip_image008

Now the installation is about to finish and once it does, the machine is supposed to restart on its own allowing you to go to the Web UI.

clip_image009

Upon setup and restart, you might get the following error! The error states that your PBX can’t access the internet so you might wanna double check your NIC configuration and that you’re able to reach to it. 

This is usually related to the DNS setup on the Centos machine where “AsteriskNow” is setup.

clip_image010

If you do a test and try to update your system from the CLI window you might get this error which is related to the DNS.

To resolve it, you’ll have to replace the localhost with any public DNS e.g. (google or comodo DNS) or any internal DNS that’s capable of reaching out to the internet to resolve this problem.

To edit the DNS you will have to type in the command  “nano /etc/resolv.conf”

The default DNS is the localhost

and you’ll have to manually change it and save the  settings

Press Ctrl + X and then Press Y to save and hit Enter

To test that we can access the internet you can nslookup google.com for instance and see if it works

Once you are able to resolve the google.com, that error will go.

Now to continue, let’s setup a FreePBX Admin (Make sure you remember both username and password) 

image
clip_image012

Click on the (FreePBX Administration) and enter the username and password you have just created in the previous step.

This will allow you to the configuration portal

clip_image013

Extensions configuration:

To start, let’s configure an extension (Since I don’t have an IP phone now) so I will use a SIP application for my test (Zoiper or Xlite would do fine)

clip_image014

Select Chan SIP device as this talks directly with Lync Trunk then Click Submit once you choose the device .

clip_image015

Now I will configure the new extension’s number, name and secret and port too.

clip_image016

Under device options, you have to set the secret (Password) which you’ll use to login to your sip phone or sip softphone..

Note:

You need to also make sure that the port configured under the device is what will be used for the device to login with this sip extension

so basically the sip port in this case is 5060 which is the default one unless you’re already using a different port then you’ll have to reconfigure it here.

image

I’ll leave the rest of the options on default value and click submit. Then apply Config

Applying Configuration

clip_image018

Now I will use a soft phone (SIP Application) on my PC to check out if calls are working properly. And for the second extension a second computer with the same software or even A software like Zoiper or Xlite can be utilized on iPhone or Android for the same purpose.

clip_image019

No other settings are required on the SIP phone after that it should register without an issue. And you’ll be able to make calls between SIP phones

clip_image020

I am going to call my computer (3700) sip phone (Xlite) from my iPhone (Zoiper) soft phone (3800)

clip_image021

So calls are working properly between SIP extensions, now we’ll have to go configure Lync and Asterisk Configuration.

Before starting, we’ll have to enable the TCP protocol on Asterisk for Lync to send calls to Asterisk since Lync talks only TCP.

Enabling Asterisk to listen on TCP

Enable TCP for Lync and SIP Phones for Asterisk

clip_image022

I’ll have to configure the local networks and the RTP port range as well.

clip_image023

Next I’ll click on Submit, and apply configuration then on top right I’ll click on Chan SIP to configure the ports and the right protocol

clip_image024

Under SIP Settings, make sure your settings matches the snapshot below, then navigate to advanced settings

clip_image025

Under Advanced General settings make sure that CHAN_SIP is bind to port 5061 or else calls from Lync will fail with “Unauthorized” error code.

clip_image026

Once you change the port scroll further down to Other SIP settings and add the following variables

Tcpenable = Yes

Transport = tcp

clip_image027

Submit the changes and apply the configuration.

Lync Configuration

Now I will go on Lync server now (Standard edition) and enable the TCP port for the mediation server (Collocated mediation service)

To do so

Right click on your Mediation server and edit properties and Enable TCP port and change it from 5068 to 5060.

clip_image028

I will publish the topology

clip_image029

Published the topology and now it’s time to run the setup as it will install the mediation server role on Front end.

clip_image030

Next I will run the second step (Setup or remove Lync Server Components):

clip_image031

I will go check if the mediation service is enabled now

clip_image032

I will run the command netstat -anb >1.txt

The command will export all the ports status on the server including each of the Lync services.

clip_image033

So Lync mediation service is listening on the default sip port 5060.

Now I will go back to the topology and add the PSTN Gateway (AsteriskNow)

Right click on PSTN Gateways –> Click add PSTN gateways

clip_image034

Next

clip_image035

Next, I will type in the AsteriskNow PBX IP address and the port that “Chan_SIP” driver is listening on since all calls are going to be routed to it.

And will select my mediation server and the Mediation server’s configured port on Lync.

clip_image036

Click Finish and Right click on your front end server and click properties

Make sure you

clip_image037

Click on Make default and then OK then publish the topology

Asterisk Configuration

Asterisk side of the Integration

In order for the configuration to work, we’ll have to configure a new trunk of the Asterisk IP PBX to identify where is the Lync server ..etc

Let’s go to our Asterisk portal, configure new trunk by going to Connectivity -> Trunks then choose “Add SIP(chan_sip) Trunk”

clip_image038

You will need to fulfill the boxes in red below each with what pertain to it.

clip_image039

The IP 172.16.24.195 is my Mediation server (Front end since Mediation server is collocated)

TCP is the protocol that Lync uses

5060 is the port which Lync listens on

I will clear all the settings below “User Details” and save this trunk

clip_image040

Now field cleared and next will click on Submit Changes.

clip_image041

Inbound Routes

I have applied the configuration and now it’s time to create routes on Asterisk to route calls to Lync.

To configure routes, click on Connectivity and then Inbound routes

clip_image042
clip_image043
clip_image044

Click Submit now and Apply Config for changes to take effect

clip_image045

Outbound Routes

It’s time to configure the outbound routes, Depending on your Lync users URI or telephone number and extension number you will have to configure

Your outbound routes according so it will be able to route it properly to Lync users.

I’m going to show my user’s uri and extension on Lync server and what does it look like now

clip_image046

So the entire number is +2163314210 but my extension is basically 4210

Now again click on Connectivity > Outbound routes and add new “Dial Pattern” as following

The +216331 will be automatically entered by AsteriskNow once you dial the number defined in the “Match Pattern” field

clip_image047

Once finished configuring the required dial patterns you can submit and apply …

clip_image048

Lync Voice Route Configuration

Now it’s time to go configure Lync Routes, Go to Lync Server and open the Control panel, Go to Voice routing there we will go under the dial plan

tab and choose New \ User Dial Plan.

If you don’t want to mess up your Global dial plan or let every new user be able to use this dial plan ,you will have to configure a user dial plan.

clip_image049

I will have to create 2 normalization rules at least in the new dial plan. The first one is going to normalize the inbound numbers

And the second one is going to normalize the outbound.

clip_image050

Since on PBX I choose to create extensions that begins with 3 and are 4 digits long, I will create a normalization rule that’s exactly 4 digits

And it starts with 3. depending on your PBX configuration for the extension and inbound routes Lync needs to either have or not have the + in the dial plan

clip_image051

Now I will create the second dial plan which is from Asterisk to Lync “To match the full URI”

The normalization rule that I am creating here is 10 digits long and it starts with 21633 and it has + digits to add

clip_image052
clip_image053

After creating the Dial plans, it’s time to test them now! I will go to the Test Voice Routing Tab and create a test

So the test for Asterisk Extensions goes well

clip_image054

Now I will test the Lync dial plan

clip_image055

Since Asterisk is going to send the full URI as it will auto complete it even if the user enters the extension only (4210) then our rule is configured properly

Now after configuring rules and testing them it’s time to go to Voice Policy tab and create a new voice policy for Asterisk

clip_image056

Click on New under “Associated PSTN Usages”

clip_image057

Click on New under Associated Routes

clip_image058

You can leave the pattern .* (Which will allow all calls) for the time being until we test everything between both systems.

Scroll down and click on Add next to “Associated Trunks”

clip_image059
clip_image060

Select the available trunk and add it then Click OK 3 times and commit all changes

clip_image061

Now after applying all the configuration, It’s time to apply some tests.

From Asterisk to Lync

Below when I initiated the call I managed to see the SIP invite coming from the IP “172.16.24.195” which is my AsteriskNOW PBX IP going to Lync and then the phone starts ringing.

When I have answered the call the RTP starts flowing.

clip_image062

Here I typed RTP in the Wireshark filter and could see the RTP media flowing between Asterisk and Lync Mediation server on the G.711 codec.

clip_image063

Note:

What I like about Asterisk is that it sends all users information along with the call and doesn’t strip them out, in extension information I have typed the extension name as “NEWPHONE” and put it all in capitals.

clip_image064

From Lync to Asterisk

Since the call is from Lync to Asterisk, then I will have to run wireshark or trace on Asterisk to see the Invite.

clip_image065

You can see Asterisk logs if you click on “Reports> Asterisk LogFiles”

clip_image066

Once the call has ended I was able to see that in detail as well in the logs.

All the media was

clip_image067

Next few days I will install and configure Brekeke to work with both (Asterisk and Lync) in the same environment… and share my deployment update with you all.

You receive an error 408 when you try to install VMMAgent on HyperV host machine that you would like to add to SCVMM 2012 for management.

You receive an error 408 when you try to install VMMAgent on HyperV host machine that you would like to add to SCVMM for management.

Error (408)

lynchyperv.lab.com has an unsupported version of the Virtual Machine Manager agent installed.

Recommended Action

Uninstall the Virtual Machine Manager agent using Add or Remove Programs on lynchyperv.lab.com, and then try the operation again.

clip_image001

Resolution:

First uninstall any agent on the HyperV host machine.

Then on the SCVMM Server, navigate to the following path

C:\Program Files\Microsoft System Center 2012 R2\Virtual Machine Manager\agents\amd64

clip_image002

Copy the folder 3.2.7895.0 to the Host machine that you want to add it to the VMM server and run to install the agent and try again to add the agent.

As in the below snapshot .. this will work for you

clip_image003
clip_image004

Done

clip_image005