Share via

Replication script generate via powershell

Anonymous
2024-06-09T11:16:01+00:00

Hi,

I am trying to generate replication create script for all the publications through SQL agent job calling powershell script.

Script works well in lower version of SQL server, but i am getting below error while running in SQL 2022.
Can someone help me identify what could be the possible fault.

A job step received an error at line 37 in a PowerShell script. The corresponding line is '$repsvr=New-Object "Microsoft.SqlServer.Replication.ReplicationServer" $sqlserver

'. Correct the script and reschedule the job. The error information returned by PowerShell is: 'Could not load file or assembly 'Microsoft.SqlServer.ConnectionInfo, Version=17.100.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The system cannot find the file specified.

'

Windows for business | Windows Server | Windows cloud | Other

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

1 answer

Sort by: Most helpful
  1. Anonymous
    2024-06-09T23:22:56+00:00

    Hello Prabhu ShankarM,

    Thank you for posting in Microsoft Community forum.

    From the description above, I understand your question is related to SQL and .NET.

    Since there are no engineers dedicated to SQL and .NET in this forum. in order to be able to get a quick and effective handling of your issue, I recommend that you repost your question in the Q&A forum, where there will be a dedicated engineer to give you a professional and effective reply.

    Here is the link for Q&A forum.
    Questions - Microsoft Q&A

    Click the "Ask a Question" button in the upper right corner to post your question and type "SQL" tag and ".NET" tag and "PowerShell" tag and select any tags related to your productions.

    I hope the information above is helpful.

    If you have any question or concern, please feel free to let us know.

    Best Regards,
    Daisy Zhou

    Was this answer helpful?

    0 comments No comments