有人尝试使用PowerShell配置SQL Server构面...我试着用下面的代码..我能够找出构面的属性,但没有得到如何设置这些值的想法属性。Powershell配置SQL Server构面
[System.Reflection.Assembly]::LoadWithPartialName('Microsoft.SqlServer.Dmf') | Out-Null
[System.Reflection.Assembly]::LoadWithPartialNam('Microsoft.SQLServer.Management.Sdk.Sfc') | Out-Null
$conn = New-Object Microsoft.SQlServer.Management.Sdk.Sfc.SqlStoreConnection("server='Ramu-pc';Trusted_Connection=true")
$PolicyStore = New-Object Microsoft.SqlServer.Management.DMF.PolicyStore($conn)
$facets = [Microsoft.SqlServer.Management.Dmf.PolicyStore]::Facets | Where {$_.Name -eq 'ISurfaceAreaFacet'}
$facets | Format-Table –Auto
当我执行下面的命令,我看到不同的方法,但我没有得到如何使用这些方法的帮助。 $ Facets |克
我需要在上面刻面配置以下值:
- AdHocRemoteQueriesEnabled =真
- 的xp_cmdshell =真