Quantcast
Channel: SQLServerCentral » Programming » Powershell » Latest topics
Viewing all articles
Browse latest Browse all 467

Need a way to script out LinkedServers on a SQL 2005\2008 boxes but place the script in seperate files.

$
0
0
If I run this it scripts them out all into one file. Can this be adjusted to put them in to individual files or is there a better way to do this?Add-PSSnapin SqlServerCmdletSnapin100Add-PSSnapin SqlServerProviderSnapin100[system.Reflection.Assembly]::LoadWithPartialName(‘Microsoft.sqlserver.smo’) |out-nullCLSCD SQLSERVER:\SQL\OM37345\DEFAULT\LinkedServersGCI | %{$_.script()} | out-file "C:\LinkedServers.sql"

Viewing all articles
Browse latest Browse all 467

Trending Articles