2012-03-21 12 views
0
$strComputer = "." 
$strInstanceName = "SQLSERVER2008" 
$wmi=Get-WmiObject -computerName $strComputer -namespace root\Microsoft\SqlServer\ComputerManagement10 -class FILESTREAMSettings -filter "InstanceName='SQLSERVER2008'" 
Write-Output $wmi.AccessLevel 
$wmi.EnableFILESTREAM(2, "SQLSERVER2008") 
$wmi=Get-WmiObject -computerName $strComputer -namespace root\Microsoft\SqlServer\ComputerManagement10 -class FILESTREAMSettings -filter "InstanceName='SQLSERVER2008'" 
Write-Output $wmi.AccessLevel 

このスクリプトを実行しますが、効果はありません。 PowerShellのからPowershell EnableFILESTREAMは機能しません

EXEC sp_configure filestream_access_level, 2 
RECONFIGURE 

: は$ wmi.AccessLevel前と$ wmi.EnableFILESTREAMを実行した後(1は、 "SQLSERVER2008")はまだこれを呼び出すための0

+0

はここで読むmyabeはあなたを助けることができますhttp://blogs.msdn.com/b/sqlserverstorageengine/archive/2008/06/09/enabling-filestream-post-sql2008-setup-a-known-issue- in-sql-config-manager.aspx –

答えて

1

てみています。重要な部分は「再構成」されています。

$ServerInstance = "SQLSERVER2008" 
$sqlConnection = New-Object System.Data.SqlClient.SqlConnection 
$sqlConnection.ConnectionString = "Server=$ServerInstance;Database=master;Trusted_Connection=True;" 

$Command = $sqlConnection.CreateCommand() 
$Command.CommandText = "EXEC sp_configure filestream_access_level, 2; RECONFIGURE" 

$sqlConnection.Open() 
$Command.ExecuteNonQuery() | Out-Null 
$sqlConnection.Close() 
関連する問題