PowerShell assembly errors

Mar 18, 2009 at 8:46 PM
I got this problem from first release, didn't work on it, then downloaded the newest 2.0.9 version and still same error

I setup the CMS, the MDW db, running under Windows Authentication on the remote desktop on the server
Server is 2008 Developer edition, 10.0.1600

I got this error from PowerShell

PS E:\Enterprise Policy Management Framework\1Down Version Evaluation PS> .\EPM_EnterpriseEvaluation_2.0.9.ps1
New-Object : Cannot find type [Microsoft.SQlServer.Management.Sdk.Sfc.SqlStoreConnection]: make sure the assembly containing this type is loaded.
At E:\Enterprise Policy Management Framework\1Down Version Evaluation PS\EPM_EnterpriseEvaluation_2.0.9.ps1:68 char:19
+ $conn = new-object  <<<< Microsoft.SQlServer.Management.Sdk.Sfc.SqlStoreConnection("server=$SourceServer;Trusted_Connection=true");
New-Object : Cannot find type [Microsoft.SqlServer.Management.DMF.PolicyStore]: make sure the assembly containing this type is loaded.
At E:\Enterprise Policy Management Framework\1Down Version Evaluation PS\EPM_EnterpriseEvaluation_2.0.9.ps1:69 char:26
+ $PolicyStore = new-object  <<<< Microsoft.SqlServer.Management.DMF.PolicyStore($conn);

Here is my .ps1 file
# Declare variables to define the central warehouse
# in which to write the output
$HistoryServer = "DBSERVER"
$HistoryDatabase = "MDW"

# Declare variable to define the server where
# the policies are stored
$SourceServer = "DBSERVER"

# Declare variable to define the server
# acting as the Central Management Server
$CMServer = "DBSERVER"

# Declare variable to define the Central Management
# Server group to evaluate
$ConfigurationGroup = "SQL Server 2005 Production"

# Declare variable to define the policy category
# and the evaluation mode
$PolicyCategoryFilter = "Microsoft Best Practices: Performance"
$EvalMode = "Check"

# Define the location to write the results of the
# policy evaluation.  Delete any files in the directory.
$ResultDir = "E:\Enterprise Policy Management Framework\"
$ResultDirDel = $ResultDir + "*.xml"

Remove-Item -Path $ResultDirDel

# End of variables
Coordinator
Mar 23, 2009 at 5:45 PM
The current build of the EPM Framework does not support nested groups in the Central Management Server. This has been resolved, and this functionality will be released in the next version of the EPM Framework (v 3.0).
Mar 23, 2009 at 6:49 PM
Lara is the best :-)
Apr 21, 2009 at 6:57 PM
I am having this same problem ...but it has nothing to do with nested groups in CMS. I've tried with and without groups in the CMS, and I get the same error both ways.

Please advise.

Thanks!
Coordinator
Apr 29, 2009 at 1:47 PM
Changes made in SQL Server 2008 SP1 have caused issues with down version policy evaluation in both Management Studio and through PowerShell.  The SQL Server Product Group is diligently working to fix the issue.  I will post an update when the hotfix is available.  In the meantime, do not install SP1 on the Central Management Server. 
May 27, 2009 at 8:39 PM

same fo rme. I'm not on SP1 nor nested and I get this as well.

Jun 8, 2009 at 10:54 AM

you need to either run the commands in the script manually from sql powershell (sqlps.exe), or initilize normal powershell with the sql server extensions (details here - http://blogs.msdn.com/mwories/archive/2008/06/14/SQL2008_5F00_Powershell.aspx) and run the script, or run the script through sql agent as a powershell command