Create SharePoint 2013 Search Service Application With PowerShell

The wraps were taken off last week on SharePoint vNext aka SharePoint 2013 and Preview bits have been made available to download and play!

This is the first post on SharePoint 2013 Preview and he objective is to provision Search Service Application and Usage Service Health with PowerShell to ensure that we have Database Names without GUID, else you will have to put up with something like this under

Search2013P01

So effectively the picture above with Database Names and GUID is courtesy of the Central Administration GUI and New Service Application method.

You could create the Search Service Application using Central Administration and then make changes to the topology, but you cannot do that through Central Administration, you will have to fall back to PowerShell for that. So why not use PowerShell to create it for you!

This script is not to modify Search Application Topology, it is to create Search Service Application  with a single server in the Search Application Topology. In this script I am also creating Usage and Health Data Collection Service Application.

Additional testing and feedback appreciated. I am not a Windows PowerShell expert and hence if you have any suggestions, please feel free to comment.

You can also see the output of the scripts in the file, which verifies that the script has run without errors and Search Service Application and Usage and Health Data Collection Service has been provisioned.

As seen in the picture we know have Search Application Topology with a single server and SharePoint Search Databases without  GUIDs 

Search2013P02

SharePoint 2013 Usage and Search Service Application Script | OutPut File

Delete SharePoint 2010 Search Service Application

This post has been in draft since last 2 years and would probably not see the light of the day if it had not been for me having to delete the SharePoint 2010 Search Service Application couple of times recently using this technique…

I have had this “consistent” experience of not being able to delete the Search Service Applicaiton from Central Administration

Remove-SPServiceApplication -id [] should do the trick… but if it doesn’t – our good old STSADM will nail it. Thanks to a forum post I had seen then… STSADM works everytime…

Here is the solution

Get -SPServiceApplication

Grab the Search Service Application id – [for example] 30b15b57-6bec-46b5-990d-541d99bab53b

then use this

Stsadm -o deleteconfigurationobject -id 30b15b57-6bec-46b5-990d-541d99bab53b (Preferred over the next method of PowerShell)

or

Remove-SPServiceApplication -id [id of Search Service Application] -confirm:$false -RemoveData

That’s it!

PowerShell Script To Change Managed Account Password

Of all days in the week, on Sunday [August 21, 2011] I decided to tease my SharePoint 2010 development environment! I decided to change all the SharePoint 2010 Service Account(s)password.

Thank you Microsoft for introducing the managed accounts, else I would be clicking away for a long time, having to go through each application pool to change the password (map this scenario to MOSS 2007 or WSSv3). With managed accounts associated with application pools, it was a matter of changing the password for the managed account and it would ‘cascade’ down…

Continue reading “PowerShell Script To Change Managed Account Password”