brianlala / AutoSPInstaller

Automated SharePoint 2010/2013/2016/2019/SE PowerShell-based installation script.
https://autospinstaller.com
MIT License
171 stars 81 forks source link

SecureString type error attempting to install SharePoint 2010 #29

Open adlan7 opened 5 years ago

adlan7 commented 5 years ago

Just in case anyone else is unfortunate enough to still need AutoSPInstaller and AutoSPSourceBuilder to work with SharePoint 2010 (I know that SharePoint 2010 is long unsupported, but your site still says AutoSPInstaller works with SharePoint 2010. I was using the latest version – checked in on the 1st Aug 2018. When I attempted to install SharePoint 2010 on Windows 2008 R2, there was a type error related to secure string. (The syntax used works in Powershell 3, but SharePoint 2010 Management Shell requires Powershell 2) Exception : System.Management.Automation.RuntimeException: Unable to find type [SecureString]: make sure that the assembly containing this type is loaded.

It seems to relate to the argument to the $secPhrase argument to ‘CreateOfJoinFarm’ (line 1739 on AutoSPInstallerModule.psm1). I changed from

Function CreateOrJoinFarm ([xml]$xmlInput, [SecureString]$secPhrase, [System.Management.Automation.PsCredential]$farmCredential) To Function CreateOrJoinFarm ([xml]$xmlInput, [Security.SecureString]$secPhrase, [System.Management.Automation.PsCredential]$farmCredential)

and it worked fine.

ecorreale commented 5 years ago

I would love to know how in the world you found that. Been digging around in the code for an hour before I found this post. Thank you so much for sharing this.
Working on a migration project that has time-warped me back to SP 2010. The Joy!