I was deploying a SharePoint installation without search. The installation failed during the Search Service Application creation with the following error:
Exception : System.Management.Automation.ParameterBindingValidationException: Cannot bind argument to
parameter 'String' because it is null.
at System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext
funcContext, Exception exception)
at System.Management.Automation.Interpreter.ActionCallInstruction`2.Run(InterpretedFrame
frame)
at
System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame
frame)
at
System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame
frame)
TargetObject :
CategoryInfo : InvalidData: (:) [ConvertTo-SecureString], ParameterBindingValidationException
FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.ConvertToSecureStr
ingCommand
ErrorDetails :
InvocationInfo : System.Management.Automation.InvocationInfo
ScriptStackTrace : at CreateEnterpriseSearchServiceApp,
D:\Install\ProjectServer\AutoSPInstaller\AutoSPInstallerFunctions.ps1: line 3967
at Setup-Services, D:\Install\ProjectServer\AutoSPInstaller\AutoSPInstallerMain.ps1: line 209
at <ScriptBlock>, D:\Install\ProjectServer\AutoSPInstaller\AutoSPInstallerMain.ps1: line 364
at <ScriptBlock>, <No file>: line 1
PipelineIterationInfo : {}
PSMessageDetails :
The error was found to be related to the following code:
$searchServiceAccount = Get-SPManagedAccountXML $xmlinput -CommonName "SearchService"
$secSearchServicePassword = ConvertTo-SecureString -String $searchServiceAccount.Password -AsPlainText -Force
I added a managed account with CommonName of SearchService and the script worked as expected, however this should not be required if provision is set to false:
<EnterpriseSearchService Provision="false" ContactEmail="" ConnectionTimeout="60" AcknowledgementTimeout="60" ProxyType="Default" IgnoreSSLWarnings="false" InternetIdentity="Mozilla/4.0 (compatible; MSIE 4.01; Windows NT; MS Search 6.0 Robot)" CustomIndexLocation="" PerformanceLevel="PartlyReduced" ShareName="SearchIndex">
Comments: Resolved with changeset 106186: Changes in this release:
- Workaround for issue 19491 (BSOD when log file auto-opens in Wordpad)
- Better detection of SharePoint 2010 with Service Pack 2 integrated, to allow installation on Windows Server 2012
- Check for SP2013 before attempting to install Project Server 2013; give warning instead of erroring out if Project Server was requested but no bits were found
- Improvements to InstallUpdates function for SP2010 SP2 etc., handle language packs and Project 2013 updates better
- Slight rewrite of AssignCert function for improved handling of different domain name scenarios
- CreateWebApp now checks for AccessServices provisioning to see if it should grants rights
- Fixed issue 20474 (always running AddToHosts regardless of true or false)
- CreateUserProfileServiceApplication now correctly detects all content access accounts (in case of multiple search service apps); also enhanced the granting of rights to the UPSA
- Fixed hashtable parsing in CreateUPSAsAdmin by changing it to an empty string
- Added checks for dependent service apps in CreateStateServiceApp and CreateSecureStoreServiceApp functions to make sure they gets provisioned if any service apps that requires them are also being provisioned
- Improved check for search service account credentials in CreateEnterpriseSearchServiceApp
- Fixed single quote in CheckForSP1 function
- AddToHOSTS now adds comment with each entry added for tracking purposes
- Fixed Add-LocalIntranetURL function per issue 20486
- Pretty minor syntax updates throughout
Exception : System.Management.Automation.ParameterBindingValidationException: Cannot bind argument to
parameter 'String' because it is null.
at System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext
funcContext, Exception exception)
at System.Management.Automation.Interpreter.ActionCallInstruction`2.Run(InterpretedFrame
frame)
at
System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame
frame)
at
System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame
frame)
TargetObject :
CategoryInfo : InvalidData: (:) [ConvertTo-SecureString], ParameterBindingValidationException
FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.ConvertToSecureStr
ingCommand
ErrorDetails :
InvocationInfo : System.Management.Automation.InvocationInfo
ScriptStackTrace : at CreateEnterpriseSearchServiceApp,
D:\Install\ProjectServer\AutoSPInstaller\AutoSPInstallerFunctions.ps1: line 3967
at Setup-Services, D:\Install\ProjectServer\AutoSPInstaller\AutoSPInstallerMain.ps1: line 209
at <ScriptBlock>, D:\Install\ProjectServer\AutoSPInstaller\AutoSPInstallerMain.ps1: line 364
at <ScriptBlock>, <No file>: line 1
PipelineIterationInfo : {}
PSMessageDetails :
The error was found to be related to the following code:
$searchServiceAccount = Get-SPManagedAccountXML $xmlinput -CommonName "SearchService"
$secSearchServicePassword = ConvertTo-SecureString -String $searchServiceAccount.Password -AsPlainText -Force
I added a managed account with CommonName of SearchService and the script worked as expected, however this should not be required if provision is set to false:
<EnterpriseSearchService Provision="false" ContactEmail="" ConnectionTimeout="60" AcknowledgementTimeout="60" ProxyType="Default" IgnoreSSLWarnings="false" InternetIdentity="Mozilla/4.0 (compatible; MSIE 4.01; Windows NT; MS Search 6.0 Robot)" CustomIndexLocation="" PerformanceLevel="PartlyReduced" ShareName="SearchIndex">
Comments: Resolved with changeset 106186: Changes in this release:
- Workaround for issue 19491 (BSOD when log file auto-opens in Wordpad)
- Better detection of SharePoint 2010 with Service Pack 2 integrated, to allow installation on Windows Server 2012
- Check for SP2013 before attempting to install Project Server 2013; give warning instead of erroring out if Project Server was requested but no bits were found
- Improvements to InstallUpdates function for SP2010 SP2 etc., handle language packs and Project 2013 updates better
- Slight rewrite of AssignCert function for improved handling of different domain name scenarios
- CreateWebApp now checks for AccessServices provisioning to see if it should grants rights
- Fixed issue 20474 (always running AddToHosts regardless of true or false)
- CreateUserProfileServiceApplication now correctly detects all content access accounts (in case of multiple search service apps); also enhanced the granting of rights to the UPSA
- Fixed hashtable parsing in CreateUPSAsAdmin by changing it to an empty string
- Added checks for dependent service apps in CreateStateServiceApp and CreateSecureStoreServiceApp functions to make sure they gets provisioned if any service apps that requires them are also being provisioned
- Improved check for search service account credentials in CreateEnterpriseSearchServiceApp
- Fixed single quote in CheckForSP1 function
- AddToHOSTS now adds comment with each entry added for tracking purposes
- Fixed Add-LocalIntranetURL function per issue 20486
- Pretty minor syntax updates throughout