PowerShell Script to Copy the contents to remote machine and trigger the installation

 # Define variables

$computers = "Machine1","Machine2","Machine3"

$sourcePath = "C:\temp\Client"  # source path

# Copy the file to each remote computer

foreach ($computer in $computers) {

    Copy-Item -Path $sourcePath -Destination "\\$computer\C$\temp" -Recurse

}

# Install the software on each remote computer

foreach ($computer in $computers) {

    $process = [WMICLASS]"\\$computer\ROOT\CIMV2:Win32_Process"

    $process.Create("C:\Temp\Client\Client_upgrade.bat") # cmd line here with path where it has been copied 

}



Powershell Script to export SSRS subscriptions from One SSRS to Another

Here is a PowerShell script that can be used to export subscriptions from one Microsoft SQL Server Reporting Services (SSRS) server and import them to another SSRS server:

# Load the ReportingServices libraries [void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.Management.ReportingServices") # Connect to the source SSRS server $sourceServer = "SourceServerName" $sourceSsrs = New-WebServiceProxy -Uri "http://$sourceServer/ReportServer/ReportService2010.asmx?WSDL" -Namespace SSRS.ReportingService2010 -UseDefaultCredential # Get a list of all subscriptions on the source SSRS server $subscriptions = $sourceSsrs.ListSubscriptions("/") # Export the subscriptions to a CSV file $subscriptions | Select-Object Path, Report, EventType, @{Name="DeliveryExtension";Expression={$_.Extension}}, @{Name="Description";Expression={$_.Description}} | Export-Csv "Subscriptions.csv" -NoTypeInformation # Disconnect from the source SSRS server $sourceSsrs = $null # Connect to the destination SSRS server $destinationServer = "DestinationServerName" $destinationSsrs = New-WebServiceProxy -Uri "http://$destinationServer/ReportServer/ReportService2010.asmx?WSDL" -Namespace SSRS.ReportingService2010 -UseDefaultCredential # Load the subscriptions from the CSV file $subscriptions = Import-Csv "Subscriptions.csv" # Loop through each subscription in the CSV file foreach ($subscription in $subscriptions) { # Create a new subscription for each entry in the CSV file $newSubscription = New-Object Microsoft.SqlServer.Management.ReportingServices.Execution.ReportExecutionService.Subscription $newSubscription.Path = $subscription.Path $newSubscription.Extension = $subscription.DeliveryExtension $newSubscription.EventType = [Microsoft.SqlServer.Management.ReportingServices.Execution.ReportExecutionService.EventType]::$($subscription.EventType) $newSubscription.Description = $subscription.Description # Create the new subscription $destinationSsrs.CreateSubscription($newSubscription) } # Disconnect from the destination SSRS server $destinationSsrs = $null


This script starts by loading the ReportingServices libraries and connecting to the source SSRS server using the New-WebServiceProxy cmdlet. It then retrieves a list of all subscriptions on the source SSRS server using the ListSubscriptions method of the $sourceSsrs object.

The list of subscriptions is then exported to a CSV file using the Export-Csv cmdlet. The properties that are exported include the path of the report, the name of the report, the type of event that triggers the subscription, the delivery extension used to send the report, and the description of the subscription.

The script then disconnects from the source SSRS server and connects to the destination SSRS server using the New-WebServiceProxy cmdlet. The subscriptions from the CSV file are then imported and used to create new subscriptions on the destination SSRS server using

Powershell Script to Import Subscriptions from CSV file to SSRS

Here is a PowerShell script that can be used to import subscriptions in Microsoft SQL Server Reporting Services (SSRS):


# Load the ReportingServices libraries [void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.Management.ReportingServices") # Connect to the SSRS server $ssrsServer = "ServerName" $ssrs = New-WebServiceProxy -Uri "http://$ssrsServer/ReportServer/ReportService2010.asmx?WSDL" -Namespace SSRS.ReportingService2010 -UseDefaultCredential # Load the subscriptions from the CSV file $subscriptions = Import-Csv "Subscriptions.csv" # Loop through each subscription in the CSV file foreach ($subscription in $subscriptions) { # Create a new subscription for each entry in the CSV file $newSubscription = New-Object Microsoft.SqlServer.Management.ReportingServices.Execution.ReportExecutionService.Subscription $newSubscription.Path = $subscription.Path $newSubscription.Extension = $subscription.DeliveryExtension $newSubscription.EventType = [Microsoft.SqlServer.Management.ReportingServices.Execution.ReportExecutionService.EventType]::$($subscription.EventType) $newSubscription.Description = $subscription.Description # Create the new subscription $ssrs.CreateSubscription($newSubscription) } # Disconnect from the SSRS server $ssrs = $null

This script starts by loading the ReportingServices libraries and connecting to the SSRS server using the New-WebServiceProxy cmdlet. It then loads the subscriptions from the CSV file using the Import-Csv cmdlet.

The script then loops through each subscription in the CSV file and creates a new subscription using the properties from the CSV file. The properties used to create the subscription include the path of the report, the delivery extension used to send the report, the type of event that triggers the subscription, and the description of the subscription.

The new subscription is created using the CreateSubscription method of the $ssrs object. After creating all the subscriptions, the script disconnects from the SSRS server.

Powershell Script to export Subscriptions in SSRS - 3

Here is a PowerShell script that can be used to export subscriptions in Microsoft SQL Server Reporting Services (SSRS):


# Load the ReportingServices libraries [void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.Management.ReportingServices") # Connect to the SSRS server $ssrsServer = "ServerName" $ssrs = New-WebServiceProxy -Uri "http://$ssrsServer/ReportServer/ReportService2010.asmx?WSDL" -Namespace SSRS.ReportingService2010 -UseDefaultCredential # Get a list of all subscriptions on the SSRS server $subscriptions = $ssrs.ListSubscriptions("/") # Export the subscriptions to a CSV file $subscriptions | Select-Object Path, Report, EventType, @{Name="DeliveryExtension";Expression={$_.Extension}}, @{Name="Description";Expression={$_.Description}} | Export-Csv "Subscriptions.csv" -NoTypeInformation # Disconnect from the SSRS server $ssrs = $null


This script starts by loading the ReportingServices libraries and connecting to the SSRS server using the New-WebServiceProxy cmdlet. It then retrieves a list of all subscriptions on the SSRS server using the ListSubscriptions method of the $ssrs object.

The list of subscriptions is then exported to a CSV file using the Export-Csv cmdlet. The properties that are exported include the path of the report, the name of the report, the type of event that triggers the subscription, the delivery extension used to send the report, and the description of the subscription.

After exporting the subscriptions, the script disconnects from the SSRS server.