Add-PSSnapin SqlServerProviderSnapin100

Hi, I had a PowerShell script built some years back that creates a website in IIS and SQL database. I am not familiar with PowerShell and after migrating the scripts to a new server from Server 2012 to Server 2019 and from SQL 2008R2 to SQL 2019 Express I am now hitting some issues that I have tried Googling but I can’t seem to find a solution to the below error.

Here is line 73 from C:\inetpub\WCEDemoScripts\AutomaticDeploy.ps1 = Add-PSSnapin SqlServerProviderSnapin100

I am completely lost here if anyone could help point me in teh right direction please. Many thanks.

Error: -

Add-PSSnapin : No snap-ins have been registered for Windows PowerShell version 5.
At C:\inetpub\WCEDemoScripts\AutomaticDeploy.ps1:72 char:5
+     Add-PSSnapin SqlServerCmdletSnapin100
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (SqlServerCmdletSnapin100:String) [Add-PSSnapin], PSArgumentException
    + FullyQualifiedErrorId : AddPSSnapInRead,Microsoft.PowerShell.Commands.AddPSSnapinCommand
 
Add-PSSnapin : No snap-ins have been registered for Windows PowerShell version 5.
At C:\inetpub\WCEDemoScripts\AutomaticDeploy.ps1:73 char:5
+     Add-PSSnapin SqlServerProviderSnapin100
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (SqlServerProviderSnapin100:String) [Add-PSSnapin], PSArgumentException
    + FullyQualifiedErrorId : AddPSSnapInRead,Microsoft.PowerShell.Commands.AddPSSnapinCommand

@sleoni Welcome to PowerShell.org forums.

PS snapins are collections of cmdlets/functions. The one your script is using is not a default available one and has to be made available on the new server. Somebody would have installed it in the old server.

How to install SqlServerCmdletSnapin100 and SqlServerProviderSnapin100 – guide | Rafal Zdziech (wordpress.com)

shows how to install, I just google it and got the link ;-).

1 Like