Friday, October 31, 2014

PowerShell Commands to Delete the Service Applications of SharePoint 2013

A copy of this:

Delete the Service Applications of SharePoint 2013

Rate This

Delete Service Applications in SharePoint 2013
Too much candy?
Cheers all!
I have noted that it is not always that easy to get rid of a Service Application should you wish to remove it completely. It can be either during initial setup, after a service breakdown or for any other reason, you want it gone and you want it to be completely gone when you are done. The next step is often to set it up again from scratch…so any remnants will cause you problems.
So, which way is the easiest to choose? I say PowerShell, 100(or maybe 99) out of 100.
Below, I have for your convenience created oneliners that will take care of all of your Service Applications for you.
After each Command, add the flag -RemoveData to have all data and databases removed at the same time.
Use the -RemoveData with care though, be absolutely sure that all data absolutely needs to be deleted Before using the flag.

The commands available, in alphabetical order
Service Application
Access ServicesRemove-SPServiceApplication -id (Get-SPServiceApplication | Where-Object {$_.typename -like “Access Services”} | Select-Object id).id.tostring()
Access Services 2010Remove-SPServiceApplication -id (Get-SPServiceApplication | Where-Object {$_.typename -like “Access Services 2010*”} | Select-Object id).id.tostring()
Application Discovery and Load Balancer Service Application Remove-SPServiceApplication -id (Get-SPServiceApplication | Where-Object {$_.typename -like “Application Disc*”} | Select-Object id).id.tostring()
App Management ServiceRemove-SPServiceApplication -id (Get-SPServiceApplication | Where-Object {$_.typename -like “App man*”} | Select-Object id).id.tostring()
Business Data Connectivity serviceRemove-SPServiceApplication -id (Get-SPServiceApplication | Where-Object {$_.typename -like “Business*”} | Select-Object id).id.tostring()
Excel Services ApplicationRemove-SPServiceApplication -id (Get-SPServiceApplication | Where-Object {$_.typename -like “Excel*”} | Select-Object id).id.tostring()
Machine Translation ServiceRemove-SPServiceApplication -id (Get-SPServiceApplication | Where-Object {$_.typename -like “Machine Translation*”} | Select-Object id).id.tostring()
Managed metadataRemove-SPServiceApplication -id (Get-SPServiceApplication | Where-Object {$_.typename -like “Managed metadata*”} | Select-Object id).id.tostring()
PerformancePoint Service ApplicationRemove-SPServiceApplication -id (Get-SPServiceApplication | Where-Object {$_.typename -like “Performance*”} | Select-Object id).id.tostring()
PowerPoint Conversion Service ApplicationRemove-SPServiceApplication -id (Get-SPServiceApplication | Where-Object {$_.typename -like “PowerPoint Conv*”} | Select-Object id).id.tostring()
Search Administration Web Service ApplicationRemove-SPServiceApplication -id (Get-SPServiceApplication | Where-Object {$_.typename -like “Search Admin*”} | Select-Object id).id.tostring()
Search Service ApplicationRemove-SPServiceApplication -id (Get-SPServiceApplication | Where-Object {$_.typename -like “Search Service*”} | Select-Object id).id.tostring()
Secure Store Service ApplicationRemove-SPServiceApplication -id (Get-SPServiceApplication | Where-Object {$_.typename -like “Secure Store*”} | Select-Object id).id.tostring()
Security Token Service ApplicationRemove-SPServiceApplication -id (Get-SPServiceApplication | Where-Object {$_.typename -like “Security Token*”} | Select-Object id).id.tostring()
State ServiceRemove-SPServiceApplication -id (Get-SPServiceApplication | Where-Object {$_.typename -like “State Service*”} | Select-Object id).id.tostring()
Usage and Health Data Collection Service ApplicationRemove-SPServiceApplication -id (Get-SPServiceApplication | Where-Object {$_.typename -like “Usage and Health*”} | Select-Object id).id.tostring()
User Profile Service ApplicationRemove-SPServiceApplication -id (Get-SPServiceApplication | Where-Object {$_.typename -like “User Profile*”} | Select-Object id).id.tostring()
Visio Graphics ServiceRemove-SPServiceApplication -id (Get-SPServiceApplication | Where-Object {$_.typename -like “Visio*”} | Select-Object id).id.tostring()
Word Automation ServicesRemove-SPServiceApplication -id (Get-SPServiceApplication | Where-Object {$_.typename -like “Word auto*”} | Select-Object id).id.tostring()
Work Management Service ApplicationRemove-SPServiceApplication -id (Get-SPServiceApplication | Where-Object {$_.typename -like “Work Management*”} | Select-Object id).id.tostring()
Running the commands above will look something like this
Note: Beware of the signle and double quotes if you copy the code…quotesx

Thursday, October 30, 2014

Prepare NLB for SharePoint Web Front End WFE Servers

This is a copy of this Blog Post

This post demonstrate  a step by step NLB configuration , how to prepare a NLB cluster to be used later on as SharePoint WFE servers .
however through this walkthrough of NLB configuration , I tried to pause on some steps and explain the NLB configuration steps as much as possible, although this series is to configure the NLB for SharePoint WFE Servers, I tried to make this post as generic as possible to accommodate any NLB configuration for any purpose.

Before you start

 IP addresses :
  • You need to have a Virtual IP, this IP is called Cluster(Public) IP and must be the same among all Cluster nodes.
  • In the other hand each cluster node would have Dedicated (Private) IP address which must be different among other nodes.
  • How to configure these IPs to interact with NLB is differ depending on Single Network adapter or Multiple Network Adapter is used.
  • In case of using Single Adapter : The dedicated IP address is always entered first so that outgoing connections from the cluster host are sourced with this IP address instead of a virtual IP address. Otherwise, replies to the cluster host could be inadvertently load-balanced by Network Load Balancing and delivered to another cluster host.
  • Private(dedicated) IPs and Cluster IP must be on the same Subnet Mask (Network) to function properly.


General Observations

  • Multicast is slower than Unicast
  • As a general rule use Unicast for two adapters, Multicast for a single adapter
  • Best Performance is obtained from either Multiple Unicast & Multiple Multicast, although multiple multi cast needs complex configuration

1- If you are using virtual machines on hyper-v it’s important to enable the IP spoofing
2- NLB configuration , from Server manger –> add NLB feature on all WFE Servers:
3- Open NLB manager from administrative tools , Cluster –>new , or from start –> run –> NlbMgr
4- in this step we are going to add the first server node to the NLB (which is the first web front end server WFE01) ,enter the server name then connect ,
5- Select the network adapter which you wish to participate in the NLB Cluster , then Click next:

5- in this screen the dedicated IP (private IP) is displayed , with the ability to add more private IPs, leave as default and click next.
  • Priority (Unique ID)
    • each Host takes a Unique ID.
    • The host with lowest Priorities (1) is called the master host and manage all cluster traffic that is not handled by Port's Rule.
  • Dedicated IP address :
    • Must be configured in TCP/IP properties first.
    • Must be identical for the IP entered in TCP/IP properties.
  • Initial state : determine whether the node will join the cluster when operating system is started

5- in this screen you will be prompted to add the NLB cluster IP (Public IP) that will be used to communicate with the front end server, click Add
enter the Cluster IP as required , then click next
6- in this screen you will enter the NLB Cluster name, by selecting the NLB Cluster IP then entering Name (SPSFENLB) , this IP will be used as cluster NLB IP that will be accessed by external traffic , and traffic will be routed accordingly to the host node with the least network traffic
IP address: virtual IP address(Public IP) is set for cluster, must be identical on all cluster hosts, all applications are going to use this IP to communicate with cluster
Full internet nameClusterName.DomainName , must be identical for all cluster hosts, users type this name in their browsers to access web server cluster, This name must be registered and mapped in DNS with its Cluster IP.
Cluster Operation Mode
· Multicast:
  • Choose this option if you want cluster nodes to be accessed through both their Public IP and Private IP address.
  • This option is optimal if you have one Network Card installed because Private IP would be functional as well as no application using this Private IP would be affected
  • AC address is changed into multicast MAC address.
  • If clients are accessing Cluster through a Router (in another LAN) make sure that the router support ARP (mapping more than IP address to one MAC address).
  • IGMP can be enabled which eliminate switch flooding (only cluster ports can pass)
· Unicast
  • Choose this option if you want cluster nodes to be accessed only by Public IP, If you had one Network card and you chose Unicast then your server would not be accessed through its Private IP anymore. You would access it only through its public IP.
  • his option is optimal if you have two network cards, where you can configure one as public IP and the other as Private IP.
  • Using Unicast would provide more performance gain than Multicast.
  • Cluster MAC address overrides built-in MAC address (some adapters don’t allow this ,in this case you need to replace it with another one).
When you use the unicast method, all cluster hosts share an identical unicast MAC address. Network Load Balancing overwrites the original MAC address of the cluster adapter with the unicast MAC address that is assigned to all the cluster hosts.
When you use the multicast method, each cluster host retains the original MAC address of the adapter. In addition to the original MAC address of the adapter, the adapter is assigned a multicast MAC address, which is shared by all cluster hosts. The incoming client requests are sent to all cluster hosts by using the multicast MAC address.
As a rule of thumb Select the unicast method for distributing client requests, unless only one network adapter is installed in each cluster host and the cluster hosts must communicate with each other from inside
For more info refer to Multicast vs Unicast section at the end of this post.
7- Define Port Rules , this is an optional step , where in default all rules are enabled,
how ever if you wanted to limit the traffic on this NLB Cluster select the port rule –> Edit
· Filtering Modes : There are three Filtering Modes which determines the host responsible to handle network traffic for this rule (this helps to distribute network traffic among hosts):
Multiple Host : both hosts will handle network traffic over specified port range, This filtering mode provides scaled performance in addition to fault tolerance by distributing the network load among multiple hosts
  •  Affinity :
    • None:
      • allows multiple connections from the same client IP to be handled by different Cluster Hosts.
      • although disabling Affinity would improve performance since it allows connections from the same client to be handled concurrently by different Cluster hosts, Don’t choose none when UDP or Both is chosen this confuse NLB from handling IP fragments properly.
    • Single :
      • Directs multiple connection from the same client IP to the same Cluster Host
      • This option is efficient when you have clients that access NLB cluster through multiple proxies which might cause requests from single client to appear originated from different computers.
    • Class C: Similar to Single
      • Directs multiple connection from the same client IP to the same Cluster Host
      • This option is efficient when you have clients that access NLB cluster through multiple proxies located within the same Class C Address range.
  • Single Host: only single host will handle network traffic according to host's priority.
  • Disable the port range : all network traffic for the associated port rule will be blocked

  • To improve Load balancing choose set affinity to None when possible. Bearing in mind "none" can't be chosen when UDP or Both option is chosen in Protocols.
  • Single affinity obtains more performance than class C affinity.
  • When Single Host is selected , host with the highest priority(1) will handle all network traffic and load weight option is then disabled.
  • To determine one port in port rule , place the same port in both: From , To options.
  • The same ports rules must be placed in all involved hosts or error will be generated when trying to add another host to cluster.
  • You can determine Network load weight between hosts when multiple hosts option is chosen, Load weight is determined through Host Properties from add/edit port rules. After finishing configuration go to Host Name—>Host Properties—>Port Rules –>Uncheck Equal option—>choose proper load weight with in this rule.
TCP: connection between sender & Receiver persist until sending is finished then connection is closed. (sender can guarantee delivery, some how heavy on network).
UDP: Sender package the data and release it in the network to reach receiver (no guarantee for delivery, very light on network).
ApplicationApplication-layer protocolUnderlying Transport Protocol
electronic mailSMTPTCP
remote terminal accessTelnetTCP
file transferFTPTCP
remote file serverNFStypically UDP
streaming multimediaproprietarytypically UDP
Internet telephonyproprietarytypically UDP
Network ManagementSNMPtypically UDP
Routing ProtocolRIPtypically UDP
Name TranslationDNStypically UDP

6- After you finish , add the second WFE host, follow same steps
7- Two servers are now joined to the NLB cluster
9. Go to Active Directory and create a host record for the NLB cluster name

Multicast vs Unicast:

NLB adds the new virtual MAC to the network card, but also keeps the card’s original MAC addressNLB replaces the network card’s original MAC address with the New entered one. (Cluster IP)
Not all routers can support having two MAC addresses on one Network card where routers might reject replies from NLB hosts since a UniCast IP must have one MAC not Two MAC addressesWork with all routers since each network card only has one MAC address
Servers can communicate with each other in NLB administrator via the original addresses of their NLB network cardsSince all hosts in the cluster all have the same MAC and IP address, they do not have the ability to communicate with each other via their NLB network card. A second network card is required for communication between the servers
Note: be aware that some routers doesn’t support Multi Mac addresses over Unicast IP's , special configuration might be needed for routers.
The IP addresses starting from : to (class D) are reserved for multicast networks. e.g. is an address that belong to Unicast network.

Tuesday, October 28, 2014

Windows 2012 - To allow automatic reboots of server during installation

Windows 2012

To allow automatic reboots of server during installation, disable warnings on open files (for unattended installs) by going to run à gpedit.msc à User Configuration à Administrative Templates à Windows Components à Attachment Manager à Add ".exe" "Inclusion list for low file types"


Tuesday, October 21, 2014 MVC Toolbox using Stripe.Net

MSIH released to Open Source the Stripe MVC Toolbox. The source code is located at 

Stripe MVC Toolbox integrates the payment processing platform using the Stripe.Net libary into an ASP.NET MVC Web Application. Stripe MVC Toolbox allows you to manage the platform within an ASP.NET MVC web application.

List, Create, Edit, and Delete
  • Customers
  • Plans
  • Charges
  • Refunds
  • Cancelation
  • Customer Subscriptions
  • Customer Charges

Wednesday, October 15, 2014

Remote Desktop Menu Tool

This BAT files create a list of servers. Enter server list number to RDP into server. If you put "a" in front of the listing number for example a2, then will RDP using admin/console login.

Save to .bat file
echo off
REM V1 20110110 davisjs
REM V2 20110118 schneiderbi
REM V2 20110120 schneiderbi
SETLOCAL EnableDelayedExpansion

:: items in quotes appear as headings
set ServerNames="Heading Ttile",servername1, servername2

rem cls
set num=0
echo Choose Server for Remote Control:

:: loop through server names
FOR %%A in (%ServerNames%) DO (
REM %%~A strips any quotes around variable
REM if variable stripped f quotes equal variable then variable does not have quote
REM increment num and display
IF [%%~A]==[%%A] SET /A num+=1
IF [%%~A]==[%%A] echo [!num!] %%~%A
REM if variable has quote, then just display variable
IF NOT [%%~A]==[%%A] echo.
IF NOT [%%~A]==[%%A] echo %%~%A

SET consoleMode=false
SET /P M=Server?
::ECHO %M:~0,1%
:: if the first letter is lowercase a then run remotedesktop in console mode = true
IF "%M:~0,1%"=="a" SET consoleMode=true
::echo %consoleMode%
IF "%M:~0,1%"=="a" SET M=%M:~1,2%
::echo %M%"  
set num=0
FOR %%A in (%ServerNames%) DO (
IF [%%~A]==[%%A] SET /A num+=1
if "%m%"=="!num!" SET serverName=%%A
if "%m%"=="!num!" GOTO RD
if %m% ==q GOTO END
if %m% ==Q GOTO END

IF %consoleMode%==true (
start mstsc.exe /v:%serverName% /admin
) ELSE (
start mstsc.exe /v:%serverName%
rem start mstsc.exe /v:%serverName% /console