mirror of
https://github.com/Microsoft/sql-server-samples.git
synced 2025-12-08 14:58:54 +00:00
Modified CMS example to use SQLRegistration.
This commit is contained in:
@@ -370,11 +370,10 @@
|
||||
"source": [
|
||||
"<# This approach leverages the Central Management Server feature to obtain a list of SQL Servers #>\r\n",
|
||||
"Get-ChildItem 'SQLSERVER:\\SQLRegistration\\Central Management Server Group' -Recurse | \r\n",
|
||||
"foreach {\r\n",
|
||||
" Get-SqlInstance -ServerInstance $_.Name | \r\n",
|
||||
" Invoke-SqlAssessment -FlattenOutput |\r\n",
|
||||
" Write-SqlTableData -ServerInstance localhost -DatabaseName SQLAssessmentDemo -SchemaName Assessment -TableName Results -Force\r\n",
|
||||
" }"
|
||||
"Where-Object { $_.mode -ne 'd'} | \r\n",
|
||||
"Invoke-SqlAssessment -FlattenOutput |\r\n",
|
||||
"Write-SqlTableData -ServerInstance localhost -DatabaseName SQLAssessmentDemo -SchemaName Assessment -TableName Results -Force\r\n",
|
||||
""
|
||||
],
|
||||
"metadata": {
|
||||
"azdata_cell_guid": "c6ca3196-b661-46b4-9818-502c779742ab"
|
||||
|
||||
Reference in New Issue
Block a user