SQL Server, Troubleshooting

SQL Connection Error – (provider: Named Pipes Provider, error: 40)

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 – Could not open a connection to SQL Server.


This is trying to tell you that some of the services are not running and it is not communicating with the database.

Basically go to SQL Server Configuration Manager either searching or going to All apps…

Under “SQL Server services“, check your services if they are started and running…


If necessary just start the services and try logging in..




Adding Licensing on your Citrix Environment

We have got a Lab environment in here, by default you get 30-day trials which is really not enough to go through everything and practice what you need. So you need to login to mycitrix.com (you might need to register or you can use your company’s account). Under you details on the left hand side go to > Previews/Betas – License Retrieval


On the right you will see any available licenses, if not you can scroll right down to request more which will give you additional licenses.


Click on the Serial Number and you will get  a warning about your license server name which is case sensitive. Yes you need to right exactly the same letters appear in the name.


Click on Continue,


Under Host ID you need to write your License server name and then you will be able to download and save your .lic file.

On your Citrix Studio > click on Licensing on the left …


and on the right Click on Add Licenses


Browse where you saved your license file. That should give you 90-day Evaluation or if you have got proper license you can use this as well.


One more thing to check is the “Production Edition”, make sure it is right version you want to use and you can do this by going in to “Edit Production Edition” under Actions on the right hand side.




Citrix XenApp / Xendesktop 7.6 Technical overview -1

This is from Citrix website and I think it is awesome article which explains the new architecture with a plain English. Very easy to read and understand.

XenApp and XenDesktop are virtualization solutions that give IT control of virtual machines, applications, licensing, and security while providing anywhere access for any device.

XenApp and XenDesktop allow:

  • End users to run applications and desktops independently of the device’s operating system and interface.
  • Administrators to manage the network and provide or restrict access from selected devices or from all devices.
  • Administrators to manage an entire network from a single data center.

XenApp and XenDesktop share a unified architecture called FlexCast Management Architecture (FMA). FMA’s key features are the ability to run multiple versions of XenApp or XenDesktop from a single Site and integrated provisioning.

FMA key components

A typical XenApp or XenDesktop environment consists of a few key technology components, which interact when users connect to applications and desktops, and log data about Site activity.

Citrix Receiver
A software client that is installed on the user device, supplies the connection to the virtual machine via TCP port 80 or 443, and communicates with StoreFront using the StoreFront Service API.

The interface that authenticates users, manages applications and desktops, and hosts the application store. StoreFront communicates with the Delivery Controller using XML.

Delivery Controller
The central management component of a XenApp or XenDesktop Site that consists of services that manage resources, applications, and desktops; and optimize and balance the loads of user connections.
Virtual Delivery Agent (VDA)
An agent that is installed on machines running Windows Server or Windows desktop operating systems that allows these machines and the resources they host to be made available to users. The VDA-installed machines running Windows Server OS allow the machine to host multiple connections for multiple users and are connected to users on one of the following ports:

  • TCP port 80 or port 443 if SSL is enabled
  • TCP port 2598, if Citrix Gateway Protocol (CGP) is enabled, which enables session reliability
  • TCP port 1494 if CGP is disabled or if the user is connecting with a legacy client
Broker Service
A Delivery Controller service that tracks which users are logged in and where, what session resources the users have, and if users need to reconnect to existing applications. The Broker Service executes PowerShell and communicates with the Broker agent over TCP port 80. It does not have the option to use TCP port 443.
Broker agent
An agent that hosts multiple plugins and collects real-time data. The Broker agent is located on the VDA and is connected to the Controller by TCP port 80. It does not have the option to use TCP port 443.
Monitor Service
A Delivery Controller component that collects historical data and puts it in the Site database by default. The Monitor Service communicates on TCP port 80 or 443.
ICA File/Stack
Bundled user information that is required to connect to the VDA.
Site Database
A Microsoft SQL database that stores data for the Delivery Controller, such as site policies, machine catalogs, and delivery groups.
NetScaler Gateway
A data-access solution that provides secure access inside or outside the LAN’s firewall with additional credentials.
A web-based tool that allows administers access to real-time data from the Broker agent, historical data from the Site database, and HDX data from NetScaler for troubleshooting and support. Director communicates with the Controller on TCP port 80 or 443.

A management console that allows administers to configure and manage Sites, and gives access to real-time data from the Broker agent. Studio communicates with the Controller on TCP port 80.


Powershell special characters

When you are using Powershell, it really helps if you use special characters to write your own scripts or interpret someone else’s scripts. Some of them are really common and get used very often….

# Hash – Single line comment


#This script is for ....
#This variable is to ...


$ Dollar sign – is used to declare a variable

$ComputerName = "Server1"
$password = "p@sw0rd"


| Pipeline- Executes the left side and with  the output feeds to the right


Get-Process | Select -first 10


% Percentage – Short for “FOREACH”


% ($Server in $Servers) { Write-Host $_}


? Question Mark – Short for “Where”


Get-process | ? {$_.name -like 'win*' -and $_.status -eq 'Running'}


@ () – Declares an array


$Servers = @ ("server1", "server2", "server3")


@ {} – Declares an hash table


$servers = @{"server1" = "Dell";
             "server2" = "HP";
             "server3" = "Nutanix"}


------------------------------------ OR

$params = @{};
$params['class'] = 'Win32_DiskDrive';
$params['filter'] = 'size=256052966400'; #find a drive which is 256GB in size
Get-WmiObject @params
Get-WmiObject -Class 'Win32_DiskDrive' -Filter 'size=256052966400'


& Ampersand – Executes strings as commandlets


& "Get-Scheduledjob"


! Exclamation – Short for “not”

$serverName = $null;
if(!$serverName) { Write-Host '$a is null' }


:: Double colon – Reference static member of a class. The class name must be enclosed in square brackets.

[string]::Equals = ("Computers", "COMPUTERS")
False # this will compare these two strings and returns false




Server 2016, Virtualization

Server 2016 Licensing

Windows Server 2016 licensing model

The business model for Standard and Datacenter editions transitioned from processor-based to core-based licensing in October 2016 with the general availability of Windows Server 2016 (all other editions of Windows Server 2016 continue to be on the processor-based licensing model). Core-based licensing provides a more consistent licensing metric across environments, enabling multicloud environments, improving workload portability for Windows Server through benefits like Azure Hybrid Use Benefit (AHUB), and helping remove friction across different licensing models.


Customers with Software Assurance will transition to core-based licensing at their first renewal after the general availability of Windows Server 2016, although they can deploy Windows Server 2016 at any time.

The Windows Server 2016 licensing model includes both Cores + Client Access Licenses (CALs). Each user and/or device accessing a licensed Windows Server Standard, Datacenter, or Multipoint edition requires a Windows Server CAL or Windows Server and Remote Desktop Services CAL. A Windows Server CAL gives a user or device the right to access any edition of Windows Server of the same or earlier version. Each Window Server CAL allows access to multiple licenses of Windows Server.

Edition                  Licensing model       CAL requirements

Datacenter               Core-based*          Windows Server CAL**

Standard                   Core-based*           Windows Server CAL**

Essentials                 Specialty server      No CAL required 

** All physical cores on the server must be licensed, subject to a minimum of 8 core licenses per physical processor and a minimum of 16 core licenses per server.

** CALs are required for every user or device accessing a server.

Windows Server 2016 Standard and Datacenter: Core-based licensing

Core-based licensing requires all physical cores in the server to be licensed. Servers are licensed based on the number of processor cores in the physical server.

• A minimum of 8 core licenses is required for each physical processor and a minimum of 16 core licenses is required for each server.

• Core licenses are sold in packs of two.*

• Standard Edition provides rights for up to 2 Operating System Environments or Hyper-V containers when all physical cores in the server are licensed. For each additional 1 or 2 VMs, all the physical cores in the server must be licensed again.

• The price of a set of 16 core licenses (for a 2-processor server) for Windows Server 2016 Datacenter and Standard editions is the same price** as the 2-processor license of the corresponding edition of Windows Server 2012 R2. Windows Server 2016 Licensing Azure Hybrid Use Benefit With the Azure Hybrid Use Benefit, customers with Software Assurance can benefit from special pricing for new Windows Server virtual machines in Azure. Customers pay only for the base compute rate, which is currently the same as the Linux rate for virtual machines.

** 8 two-core packs will be the minimum required to license each physical server. The two-core pack for each edition is 1/8th the price of a license for a 2-processor server for corresponding Windows Server 2012 R2 editions.

** Rounding may result in slight variations in the final price of eight 2-pack core SKUs relative to the price of one Windows Server 2012 R2 processor SKU.


Moving to core-based licensing

Customers purchasing net new licenses, for example, through MPSA or from an OEM, will purchase licenses under the core-based model. Existing customers with Software Assurance will transition from processor-based to core-based licensing at the first renewal after the general availability of Windows Server 2016.

• Renewal before the general availability of Windows Server 2016: Customers with Software Assurance will be on processor-based licensing and true-ups will also be processor-based.

• Renewal after the general availability of Windows Server 2016: Customers with Software Assurance will transition to core-based licensing and true-ups will also be core-based.

Core license grants overview

Customers with servers under Software Assurance will receive core license grants at the expiration of Software Assurance coverage. Depending on the core density of existing servers, there are two categories of core license grants: Full core licenses and additional core licenses.

1. Full core license grants: Customers with a server density of 8 or fewer cores per processor and 16 or fewer cores per server are eligible to receive full core license grants. Customers will receive a minimum of 8 cores per processor and 16 cores per server at the expiration of Software Assurance coverage after the general availability of Windows Server 2016. To receive full core license grants, customers do not need to document their environments.

2. Additional core license grants: Customers with a server density of more than 8 cores per processor and 16 cores per server are eligible to receive additional core license grants and pay only Software Assurance on the incremental cores. To receive additional core license grants, customers must maintain a record of the physical hardware and the configuration of the licensed server by using the Microsoft Software Inventory Logging tool (SIL) or any equivalent software. Inventory must be maintained at the first expiration of the Software Assurance coverage after the general availability of Windows Server 2016 or before September 30, 2019.

Note: Customers are not required to share inventory with Microsoft, but may be asked to share inventory if required.


Announcing servicing guidelines for Windows Server 2016

With prior releases, Windows Server has been serviced and supported through a 5+5 model, with 5 years of mainstream support and 5 years of extended support. This model—renamed Long Term Servicing Branch (LTSB)—will continue with Windows Server 2016 for customers who choose to install full Windows Server 2016 with Desktop Experience or Server Core.

Customers choosing the Nano Server installation will opt into a more active servicing model—known as Current Branch for Business (CBB)—similar to the experience with Windows 10. This approach supports customers who are moving at a cloud cadence of rapid development lifecycles and wish to innovate more quickly. Since this servicing model continues to provide new features and functionality, Software Assurance is also required to install and use Nano Server.