Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Professional SharePoint 2013 Administration
This is the forum to discuss the Wrox book Professional SharePoint 2013 Administration by Shane Young, Steve Caravajal, Todd Klindt; ISBN: 978-1-1184-9581-0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional SharePoint 2013 Administration section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old May 16th, 2013, 11:27 PM
Registered User
Points: 12, Level: 1
Points: 12, Level: 1 Points: 12, Level: 1 Points: 12, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2013
Location: Pleasant Hill, CA USA
Posts: 3
Thanks: 0
Thanked 1 Time in 1 Post
Default power shell scripts errors

trying to enter script from page 83-84. getting topology error on -SearchTopology for the cloning scripts.
i suspect i am not entering these lines correctly as i have hit the enter key just before each statement that starts with a $ sign.
not sure if all the lines below each comment line get entered separately or do they from a single entry?

powershell newbie, so please be kind, thanks in advance.

great book by the way.
Reply With Quote
  #2 (permalink)  
Old May 23rd, 2013, 04:39 PM
Registered User
Points: 3, Level: 1
Points: 3, Level: 1 Points: 3, Level: 1 Points: 3, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2013
Posts: 1
Thanks: 1
Thanked 1 Time in 1 Post
Unhappy Search Service Application Scripts Failed

I originally had a problem running the scripts but they worked like a charm when you remembered to backspace the lines of code that belong on the line above them. Below is what it looked like when corrected after I copied it from the TK website. Oh, and by the way you just copy and paste the whole thing into the SPPowerShell. I usually paste this kind of stuff right into Notepad first then copy and paste it into the shell.

Code:
# Get App Pool
$saAppPoolName = "Default SharePoint Service App Pool"

# Search Specifics, we are single server farm
$searchServerName = (Get-ChildItem env:computername).value
$serviceAppName = "Search Service Application"
$searchDBName = "SearchService_DB"

# Grab the Appplication Pool for Service Application Endpoint
$saAppPool = Get-SPServiceApplicationPool $saAppPoolName

# Start Search Service Instances
Start-SPEnterpriseSearchServiceInstance $searchServerName
Start-SPEnterpriseSearchQueryAndSiteSettingsServiceInstance $searchServerName

# Create the Search Service Application and Proxy
$searchServiceApp = New-SPEnterpriseSearchServiceApplication -Name $serviceAppName -ApplicationPool $saAppPoolName -DatabaseName $searchDBName
$searchProxy = New-SPEnterpriseSearchServiceApplicationProxy -Name "$serviceAppName Proxy" -SearchApplication $searchServiceApp

# Clone the default Topology (which is empty) and create a new one and then activate it
$clone = $searchServiceApp.ActiveTopology.Clone()
$searchServiceInstance = Get-SPEnterpriseSearchServiceInstance
New-SPEnterpriseSearchAdminComponent –SearchTopology $clone -SearchServiceInstance $searchServiceInstance
New-SPEnterpriseSearchContentProcessingComponent –SearchTopology $clone -SearchServiceInstance $searchServiceInstance
New-SPEnterpriseSearchAnalyticsProcessingComponent –SearchTopology $clone -SearchServiceInstance $searchServiceInstance 
New-SPEnterpriseSearchCrawlComponent –SearchTopology $clone -SearchServiceInstance $searchServiceInstance 
New-SPEnterpriseSearchIndexComponent –SearchTopology $clone -SearchServiceInstance $searchServiceInstance
New-SPEnterpriseSearchQueryProcessingComponent –SearchTopology $clone -SearchServiceInstance $searchServiceInstance
$clone.Activate()

Last edited by ~Greg~; August 16th, 2013 at 10:34 AM. Reason: figured out the code parameters
Reply With Quote
The Following User Says Thank You to ~Greg~ For This Useful Post:
jminatel (May 29th, 2013)
  #3 (permalink)  
Old June 18th, 2013, 11:39 PM
Registered User
Points: 12, Level: 1
Points: 12, Level: 1 Points: 12, Level: 1 Points: 12, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2013
Location: Pleasant Hill, CA USA
Posts: 3
Thanks: 0
Thanked 1 Time in 1 Post
Default thank you for the info

sorry for the delay. i will give it a whirl.
on some of the other scripts i had made the mistake of being too literal in the typing from the samples. after playing some i find that a space is not always a space.
powershell may become a friend after all.

again, many thanks for the post.
Reply With Quote
  #4 (permalink)  
Old June 21st, 2013, 01:14 AM
Registered User
Points: 12, Level: 1
Points: 12, Level: 1 Points: 12, Level: 1 Points: 12, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2013
Location: Pleasant Hill, CA USA
Posts: 3
Thanks: 0
Thanked 1 Time in 1 Post
Default

got a test site up and running. the script worked perfect.
only two things:
second line under #Start search section
Start-SPEnterpriseSearchQueryAndSiteSettingsServiceInsta nce $searchServerName
removed the space in "instance"
and
at the last line i waited then realized that i needed to hit enter, my stupid.

very happy gray haired old fart now.
Reply With Quote
The Following User Says Thank You to jdmuskrat For This Useful Post:
~Greg~ (August 16th, 2013)
  #5 (permalink)  
Old August 13th, 2013, 11:12 AM
Registered User
Points: 6, Level: 1
Points: 6, Level: 1 Points: 6, Level: 1 Points: 6, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2013
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Struggling with Search Service Script

Hi,

I have tried downloading the script and typing it out, and am now using the one in this thread.

It runs perfectly clean till I get here:-

PS E:\> $clone = $searchServiceApp.ActiveToplogy.Clone()
You cannot call a method on a null-valued expression.
At line:1 char:1
+ $clone = $searchServiceApp.ActiveToplogy.Clone()
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull


Any idea what might be wrong? I've run all the preceeding lines as a whole script and am now firing this line in on it's own as it's where the code stops with this error...
Reply With Quote
  #6 (permalink)  
Old August 14th, 2013, 05:23 AM
Registered User
Points: 6, Level: 1
Points: 6, Level: 1 Points: 6, Level: 1 Points: 6, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2013
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Resolved:-

I switched to using Todd's version again from his site but got a different error, I discovered someone else had the same error and resolved it. It now works for me, here's the detail should anyone need it:-

PS C:\Users\TarasG> New-SPEnterpriseSearchAdminComponent -SearchTopology $clone
-SearchServiceInstance $searchServiceInstance
New-SPEnterpriseSearchAdminComponent : Cannot convert 'System.Object[]' to the
type 'Microsoft.Office.Server.Search.Cmdlet.SearchServi ceInstancePipeBind'
required by parameter 'SearchServiceInstance'. Specified method is not
supported........



I solve this error, by adding
"$searchServerName" variable to line 29 your script

$searchServiceInstance = Get-SPEnterpriseSearchServiceInstance $searchServerName

Found here:-

http://www.toddklindt.com/blog/Lists...8A04FE9DAF9BC9
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Syntax errors in sample scripts ayesamson BOOK: Professional Microsoft SQL Server 2012 Administration 0 April 11th, 2012 09:33 PM
Chapter 11 - Shell Scripts, minor issues, startproject.php kenj BOOK: PHP and MySQL: Create-Modify-Reuse ISBN: 978-0-470-19242-9 0 October 30th, 2010 05:50 PM
Charting in power point using C# amitabha.chakraborty Book: Wrox's Visual C# 2005 Express Edition Starter Kit 0 May 13th, 2009 02:17 AM
Power to the Programmers! James C Forum and Wrox.com Feedback 14 June 15th, 2003 10:26 PM



All times are GMT -4. The time now is 08:57 PM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.