December 8, 2017 at 10:03 am
Hello all.
I am new to powershell and have a question. Is there a way to deploy sql scripts to all the databases that are in a registered server in the central management list on sql? I would like to avoid looping thru a list of databases and have the script run on all of them simultaneously like it would if i used the multi script tool.
Also, i have a ps script that i think should give me the servers in my Central Management group but it comes up with nothing even though i have servers registered. Any help would be greatly appreciated.
I am using a remote powershell connection to my support server when running the below.
#import SQL Server module
Import-Module SQLPS -DisableNameChecking
Set-Location "SQLSERVER:\SQLRegistration\Central Management Server Group"
Get-ChildItem
this returns nothing.
December 9, 2017 at 4:39 am
Hi
Please try the modification made in your script in RED.
#import SQL Server module
Import-Module SQLPS -DisableNameChecking
Set-Location "SQLSERVER:\SQLRegistration\Central Management Server Group\<<CentralManagementSQLServerMame>>"
Get-ChildItem
Vishnu Gupthan
PowershellAcademy
www.powershellacademy.com
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy