Another quick script to set all database recovery models using powershell. This ignores system databases. This uses sqlpsx as well.
Import-Module SqlServer $dataBases = Get-SqlDatabase -sqlserver "ServerName" | where{$_.IsSystemObject -ne $true} foreach($db in $dataBases) { if($db.RecoveryModel -eq [Microsoft.SqlServer.Management.Smo.RecoveryModel]::BulkLogged) { $db.RecoveryModel = [Microsoft.SqlServer.Management.Smo.RecoveryModel]::Simple; $db.Alter(); } }
Hi There,
I need to run this script on multiple servers remotely.
Is there a way for the script to get a serverlist.txt or .csv with all the remote servers in it and run it on them?
Kindest Regards,,
Chris