+ )
+ }
+}
diff --git a/samples/demos/azure-sql-edge-demos/Wind Turbine Demo/webappsrc/SqlDbEdgeDemoWeb/SqlDbEdgeDemo.Web/ClientApp/src/pages/README.md b/samples/demos/azure-sql-edge-demos/Wind Turbine Demo/webappsrc/SqlDbEdgeDemoWeb/SqlDbEdgeDemo.Web/ClientApp/src/pages/README.md
new file mode 100644
index 00000000..88791be2
--- /dev/null
+++ b/samples/demos/azure-sql-edge-demos/Wind Turbine Demo/webappsrc/SqlDbEdgeDemoWeb/SqlDbEdgeDemo.Web/ClientApp/src/pages/README.md
@@ -0,0 +1 @@
+# Pages Folder
\ No newline at end of file
diff --git a/samples/demos/azure-sql-edge-demos/Wind Turbine Demo/webappsrc/SqlDbEdgeDemoWeb/SqlDbEdgeDemo.Web/ClientApp/src/styles/global.scss b/samples/demos/azure-sql-edge-demos/Wind Turbine Demo/webappsrc/SqlDbEdgeDemoWeb/SqlDbEdgeDemo.Web/ClientApp/src/styles/global.scss
new file mode 100644
index 00000000..680fc1e0
--- /dev/null
+++ b/samples/demos/azure-sql-edge-demos/Wind Turbine Demo/webappsrc/SqlDbEdgeDemoWeb/SqlDbEdgeDemo.Web/ClientApp/src/styles/global.scss
@@ -0,0 +1,84 @@
+/*
+ Global Styles
+
+ This file should only be used for site wide styles. If the style is specific to a component then it
+ should be in a file next to the component
+*/
+@font-face {
+ font-family: SegoeUI;
+ src: local('Segoe UI'),
+ url(//c.s-microsoft.com/static/fonts/segoe-ui/west-european/normal/latest.woff2)
+ format('woff2'),
+ url(//c.s-microsoft.com/static/fonts/segoe-ui/west-european/normal/latest.woff)
+ format('woff'),
+ url(//c.s-microsoft.com/static/fonts/segoe-ui/west-european/normal/latest.ttf)
+ format('truetype'),
+ url(//c.s-microsoft.com/static/fonts/segoe-ui/west-european/normal/latest.svg#web)
+ format('svg');
+ font-weight: 400;
+}
+
+@font-face {
+ font-family: SegoeUILight;
+ src: local('Segoe UI Light'),
+ url(//c.s-microsoft.com/static/fonts/segoe-ui/west-european/light/latest.woff2)
+ format('woff2'),
+ url(//c.s-microsoft.com/static/fonts/segoe-ui/west-european/light/latest.woff)
+ format('woff'),
+ url(//c.s-microsoft.com/static/fonts/segoe-ui/west-european/light/latest.ttf)
+ format('truetype'),
+ url(//c.s-microsoft.com/static/fonts/segoe-ui/west-european/light/latest.svg#web)
+ format('svg');
+ font-weight: 100;
+}
+
+@font-face {
+ font-family: SegoeUISemilight;
+ src: local('Segoe UI Semilight'), local('Segoe UI'),
+ url(//c.s-microsoft.com/static/fonts/segoe-ui/west-european/semilight/latest.woff2)
+ format('woff2'),
+ url(//c.s-microsoft.com/static/fonts/segoe-ui/west-european/semilight/latest.woff)
+ format('woff'),
+ url(//c.s-microsoft.com/static/fonts/segoe-ui/west-european/semilight/latest.ttf)
+ format('truetype'),
+ url(//c.s-microsoft.com/static/fonts/segoe-ui/west-european/semilight/latest.svg#web)
+ format('svg');
+ font-weight: 200;
+}
+
+@font-face {
+ font-family: SegoeUISemibold;
+ src: local('Segoe UI Semibold'),
+ url(//c.s-microsoft.com/static/fonts/segoe-ui/west-european/semibold/latest.woff2)
+ format('woff2'),
+ url(//c.s-microsoft.com/static/fonts/segoe-ui/west-european/semibold/latest.woff)
+ format('woff'),
+ url(//c.s-microsoft.com/static/fonts/segoe-ui/west-european/semibold/latest.ttf)
+ format('truetype'),
+ url(//c.s-microsoft.com/static/fonts/segoe-ui/west-european/semibold/latest.svg#web)
+ format('svg');
+ font-weight: 600;
+}
+
+@font-face {
+ font-family: SegoeUIBold;
+ src: local('Segoe UI Bold'), local('Segoe UI'),
+ url(//c.s-microsoft.com/static/fonts/segoe-ui/west-european/bold/latest.woff2)
+ format('woff2'),
+ url(//c.s-microsoft.com/static/fonts/segoe-ui/west-european/bold/latest.woff)
+ format('woff'),
+ url(//c.s-microsoft.com/static/fonts/segoe-ui/west-european/bold/latest.ttf)
+ format('truetype'),
+ url(//c.s-microsoft.com/static/fonts/segoe-ui/west-european/bold/latest.svg#web)
+ format('svg');
+ font-weight: 700;
+}
+
+@import url('https://fonts.googleapis.com/css2?family=Audiowide&display=swap');
+
+@import url('https://fonts.googleapis.com/css2?family=Cousine&display=swap');
+
+
+body {
+ font-family: SegoeUI;
+}
\ No newline at end of file
diff --git a/samples/demos/azure-sql-edge-demos/Wind Turbine Demo/webappsrc/SqlDbEdgeDemoWeb/SqlDbEdgeDemo.Web/Controllers/DeviceController.cs b/samples/demos/azure-sql-edge-demos/Wind Turbine Demo/webappsrc/SqlDbEdgeDemoWeb/SqlDbEdgeDemo.Web/Controllers/DeviceController.cs
new file mode 100644
index 00000000..f2c121b0
--- /dev/null
+++ b/samples/demos/azure-sql-edge-demos/Wind Turbine Demo/webappsrc/SqlDbEdgeDemoWeb/SqlDbEdgeDemo.Web/Controllers/DeviceController.cs
@@ -0,0 +1,27 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+using Microsoft.AspNetCore.Mvc;
+using SqlDbEdgeDemo.Web.Models;
+using SqlDbEdgeDemo.Web.Services.Interfaces;
+
+namespace SqlDbEdgeDemo.Web.Controllers
+{
+ [Route("api/[controller]")]
+ public class DeviceController : Controller
+ {
+ private static IIoTHubModuleTwinService _ioTHubModuleTwinService;
+
+ public DeviceController(IIoTHubModuleTwinService ioTHubModuleTwinService)
+ {
+ _ioTHubModuleTwinService = ioTHubModuleTwinService;
+ }
+
+ [HttpGet]
+ public ActionResult GetStatus()
+ {
+ return Ok(_ioTHubModuleTwinService.GetTwinDeviceStatus());
+ }
+ }
+}
diff --git a/samples/demos/azure-sql-edge-demos/Wind Turbine Demo/webappsrc/SqlDbEdgeDemoWeb/SqlDbEdgeDemo.Web/Models/DeviceModel.cs b/samples/demos/azure-sql-edge-demos/Wind Turbine Demo/webappsrc/SqlDbEdgeDemoWeb/SqlDbEdgeDemo.Web/Models/DeviceModel.cs
new file mode 100644
index 00000000..fda35f32
--- /dev/null
+++ b/samples/demos/azure-sql-edge-demos/Wind Turbine Demo/webappsrc/SqlDbEdgeDemoWeb/SqlDbEdgeDemo.Web/Models/DeviceModel.cs
@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+
+namespace SqlDbEdgeDemo.Web.Models
+{
+ public class DeviceModel
+ {
+ public bool Alert { get; set; }
+ }
+}
diff --git a/samples/demos/azure-sql-edge-demos/Wind Turbine Demo/webappsrc/SqlDbEdgeDemoWeb/SqlDbEdgeDemo.Web/Models/IoTHubModuleTwinProperties.cs b/samples/demos/azure-sql-edge-demos/Wind Turbine Demo/webappsrc/SqlDbEdgeDemoWeb/SqlDbEdgeDemo.Web/Models/IoTHubModuleTwinProperties.cs
new file mode 100644
index 00000000..4f0061f3
--- /dev/null
+++ b/samples/demos/azure-sql-edge-demos/Wind Turbine Demo/webappsrc/SqlDbEdgeDemoWeb/SqlDbEdgeDemo.Web/Models/IoTHubModuleTwinProperties.cs
@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+
+namespace SqlDbEdgeDemo.Web.Models
+{
+ public class IoTHubModuleTwinReportedProperty
+ {
+ public string Alert { get; set; }
+ }
+}
diff --git a/samples/demos/azure-sql-edge-demos/Wind Turbine Demo/webappsrc/SqlDbEdgeDemoWeb/SqlDbEdgeDemo.Web/Options/IoTHubOptions.cs b/samples/demos/azure-sql-edge-demos/Wind Turbine Demo/webappsrc/SqlDbEdgeDemoWeb/SqlDbEdgeDemo.Web/Options/IoTHubOptions.cs
new file mode 100644
index 00000000..ba8cd99e
--- /dev/null
+++ b/samples/demos/azure-sql-edge-demos/Wind Turbine Demo/webappsrc/SqlDbEdgeDemoWeb/SqlDbEdgeDemo.Web/Options/IoTHubOptions.cs
@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+
+namespace SqlDbEdgeDemo.Web.Options
+{
+ public class IoTHubOptions
+ {
+ public string ModuleConnectionString { get; set; }
+ }
+}
diff --git a/samples/demos/azure-sql-edge-demos/Wind Turbine Demo/webappsrc/SqlDbEdgeDemoWeb/SqlDbEdgeDemo.Web/Pages/Error.cshtml b/samples/demos/azure-sql-edge-demos/Wind Turbine Demo/webappsrc/SqlDbEdgeDemoWeb/SqlDbEdgeDemo.Web/Pages/Error.cshtml
new file mode 100644
index 00000000..6f92b956
--- /dev/null
+++ b/samples/demos/azure-sql-edge-demos/Wind Turbine Demo/webappsrc/SqlDbEdgeDemoWeb/SqlDbEdgeDemo.Web/Pages/Error.cshtml
@@ -0,0 +1,26 @@
+@page
+@model ErrorModel
+@{
+ ViewData["Title"] = "Error";
+}
+
+
Error.
+
An error occurred while processing your request.
+
+@if (Model.ShowRequestId)
+{
+
+ Request ID:@Model.RequestId
+
+}
+
+
Development Mode
+
+ Swapping to the Development environment displays detailed information about the error that occurred.
+
+
+ The Development environment shouldn't be enabled for deployed applications.
+ It can result in displaying sensitive information from exceptions to end users.
+ For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development
+ and restarting the app.
+
diff --git a/samples/demos/azure-sql-edge-demos/Wind Turbine Demo/webappsrc/SqlDbEdgeDemoWeb/SqlDbEdgeDemo.Web/Pages/Error.cshtml.cs b/samples/demos/azure-sql-edge-demos/Wind Turbine Demo/webappsrc/SqlDbEdgeDemoWeb/SqlDbEdgeDemo.Web/Pages/Error.cshtml.cs
new file mode 100644
index 00000000..1c0ad38a
--- /dev/null
+++ b/samples/demos/azure-sql-edge-demos/Wind Turbine Demo/webappsrc/SqlDbEdgeDemoWeb/SqlDbEdgeDemo.Web/Pages/Error.cshtml.cs
@@ -0,0 +1,23 @@
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Linq;
+using System.Threading.Tasks;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.AspNetCore.Mvc.RazorPages;
+
+namespace SqlDbEdgeDemo.Web.Pages
+{
+ [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
+ public class ErrorModel : PageModel
+ {
+ public string RequestId { get; set; }
+
+ public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
+
+ public void OnGet()
+ {
+ RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier;
+ }
+ }
+}
diff --git a/samples/demos/azure-sql-edge-demos/Wind Turbine Demo/webappsrc/SqlDbEdgeDemoWeb/SqlDbEdgeDemo.Web/Pages/_ViewImports.cshtml b/samples/demos/azure-sql-edge-demos/Wind Turbine Demo/webappsrc/SqlDbEdgeDemoWeb/SqlDbEdgeDemo.Web/Pages/_ViewImports.cshtml
new file mode 100644
index 00000000..dd20a6d1
--- /dev/null
+++ b/samples/demos/azure-sql-edge-demos/Wind Turbine Demo/webappsrc/SqlDbEdgeDemoWeb/SqlDbEdgeDemo.Web/Pages/_ViewImports.cshtml
@@ -0,0 +1,3 @@
+@using SqlDbEdgeDemo.Web
+@namespace SqlDbEdgeDemo.Web.Pages
+@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
diff --git a/samples/demos/azure-sql-edge-demos/Wind Turbine Demo/webappsrc/SqlDbEdgeDemoWeb/SqlDbEdgeDemo.Web/Program.cs b/samples/demos/azure-sql-edge-demos/Wind Turbine Demo/webappsrc/SqlDbEdgeDemoWeb/SqlDbEdgeDemo.Web/Program.cs
new file mode 100644
index 00000000..f53152c3
--- /dev/null
+++ b/samples/demos/azure-sql-edge-demos/Wind Turbine Demo/webappsrc/SqlDbEdgeDemoWeb/SqlDbEdgeDemo.Web/Program.cs
@@ -0,0 +1,24 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Threading.Tasks;
+using Microsoft.AspNetCore;
+using Microsoft.AspNetCore.Hosting;
+using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.Logging;
+
+namespace SqlDbEdgeDemo.Web
+{
+ public class Program
+ {
+ public static void Main(string[] args)
+ {
+ CreateWebHostBuilder(args).Build().Run();
+ }
+
+ public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
+ WebHost.CreateDefaultBuilder(args)
+ .UseStartup();
+ }
+}
diff --git a/samples/demos/azure-sql-edge-demos/Wind Turbine Demo/webappsrc/SqlDbEdgeDemoWeb/SqlDbEdgeDemo.Web/Services/Interfaces/IIoTHubModuleTwinService.cs b/samples/demos/azure-sql-edge-demos/Wind Turbine Demo/webappsrc/SqlDbEdgeDemoWeb/SqlDbEdgeDemo.Web/Services/Interfaces/IIoTHubModuleTwinService.cs
new file mode 100644
index 00000000..69126973
--- /dev/null
+++ b/samples/demos/azure-sql-edge-demos/Wind Turbine Demo/webappsrc/SqlDbEdgeDemoWeb/SqlDbEdgeDemo.Web/Services/Interfaces/IIoTHubModuleTwinService.cs
@@ -0,0 +1,13 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+using SqlDbEdgeDemo.Web.Models;
+
+namespace SqlDbEdgeDemo.Web.Services.Interfaces
+{
+ public interface IIoTHubModuleTwinService
+ {
+ DeviceModel GetTwinDeviceStatus();
+ }
+}
diff --git a/samples/demos/azure-sql-edge-demos/Wind Turbine Demo/webappsrc/SqlDbEdgeDemoWeb/SqlDbEdgeDemo.Web/Services/IoTHubModuleTwinService.cs b/samples/demos/azure-sql-edge-demos/Wind Turbine Demo/webappsrc/SqlDbEdgeDemoWeb/SqlDbEdgeDemo.Web/Services/IoTHubModuleTwinService.cs
new file mode 100644
index 00000000..ca87e2e3
--- /dev/null
+++ b/samples/demos/azure-sql-edge-demos/Wind Turbine Demo/webappsrc/SqlDbEdgeDemoWeb/SqlDbEdgeDemo.Web/Services/IoTHubModuleTwinService.cs
@@ -0,0 +1,49 @@
+using System;
+using Microsoft.Azure.Devices.Client;
+using Newtonsoft.Json;
+using SqlDbEdgeDemo.Web.Models;
+using SqlDbEdgeDemo.Web.Options;
+using SqlDbEdgeDemo.Web.Services.Interfaces;
+
+namespace SqlDbEdgeDemo.Web.Services
+{
+ public class IoTHubModuleTwinService : IIoTHubModuleTwinService
+ {
+ private static IoTHubOptions _options;
+ private static ModuleClient Client = null;
+
+ public IoTHubModuleTwinService(IoTHubOptions options)
+ {
+ _options = options;
+ }
+
+ public DeviceModel GetTwinDeviceStatus()
+ {
+ Connect();
+ var twinTask = Client.GetTwinAsync();
+ twinTask.Wait();
+ var twin = twinTask.Result;
+ var properties = JsonConvert.DeserializeObject(twin.Properties.Reported.ToJson());
+ return new DeviceModel
+ {
+ Alert = string.Equals(properties.Alert, "start", StringComparison.OrdinalIgnoreCase)
+ };
+ }
+
+ private void Connect()
+ {
+ if (Client == null)
+ {
+ try
+ {
+ Client = ModuleClient.CreateFromConnectionString(_options.ModuleConnectionString, TransportType.Amqp);
+ }
+ catch (Exception e)
+ {
+ Client = null; // Set to null for reconection
+ throw e;
+ }
+ }
+ }
+ }
+}
diff --git a/samples/demos/azure-sql-edge-demos/Wind Turbine Demo/webappsrc/SqlDbEdgeDemoWeb/SqlDbEdgeDemo.Web/SqlDbEdgeDemo.Web.csproj b/samples/demos/azure-sql-edge-demos/Wind Turbine Demo/webappsrc/SqlDbEdgeDemoWeb/SqlDbEdgeDemo.Web/SqlDbEdgeDemo.Web.csproj
new file mode 100644
index 00000000..4ea9913b
--- /dev/null
+++ b/samples/demos/azure-sql-edge-demos/Wind Turbine Demo/webappsrc/SqlDbEdgeDemoWeb/SqlDbEdgeDemo.Web/SqlDbEdgeDemo.Web.csproj
@@ -0,0 +1,50 @@
+
+
+
+ netcoreapp2.2
+ true
+ Latest
+ false
+ ClientApp\
+ $(DefaultItemExcludes);$(SpaRoot)node_modules\**
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ %(DistFiles.Identity)
+ PreserveNewest
+
+
+
+
+
diff --git a/samples/demos/azure-sql-edge-demos/Wind Turbine Demo/webappsrc/SqlDbEdgeDemoWeb/SqlDbEdgeDemo.Web/Startup.cs b/samples/demos/azure-sql-edge-demos/Wind Turbine Demo/webappsrc/SqlDbEdgeDemoWeb/SqlDbEdgeDemo.Web/Startup.cs
new file mode 100644
index 00000000..97e9c078
--- /dev/null
+++ b/samples/demos/azure-sql-edge-demos/Wind Turbine Demo/webappsrc/SqlDbEdgeDemoWeb/SqlDbEdgeDemo.Web/Startup.cs
@@ -0,0 +1,75 @@
+using Microsoft.AspNetCore.Builder;
+using Microsoft.AspNetCore.Hosting;
+using Microsoft.AspNetCore.HttpsPolicy;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.AspNetCore.SpaServices.ReactDevelopmentServer;
+using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.DependencyInjection;
+using SqlDbEdgeDemo.Web.Options;
+using SqlDbEdgeDemo.Web.Services;
+using SqlDbEdgeDemo.Web.Services.Interfaces;
+
+namespace SqlDbEdgeDemo.Web
+{
+ public class Startup
+ {
+ public Startup(IConfiguration configuration)
+ {
+ Configuration = configuration;
+ }
+
+ public IConfiguration Configuration { get; }
+
+ // This method gets called by the runtime. Use this method to add services to the container.
+ public void ConfigureServices(IServiceCollection services)
+ {
+ var ioTHubOptions = Configuration.GetSection("IoTHub").Get();
+ services.AddSingleton(sp => ioTHubOptions);
+ services.AddSingleton(sp => new IoTHubModuleTwinService(ioTHubOptions));
+
+ services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2);
+
+ // In production, the React files will be served from this directory
+ services.AddSpaStaticFiles(configuration =>
+ {
+ configuration.RootPath = "ClientApp/build";
+ });
+ }
+
+ // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
+ public void Configure(IApplicationBuilder app, IHostingEnvironment env)
+ {
+ if (env.IsDevelopment())
+ {
+ app.UseDeveloperExceptionPage();
+ }
+ else
+ {
+ app.UseExceptionHandler("/Error");
+ // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
+ app.UseHsts();
+ }
+
+ app.UseHttpsRedirection();
+ app.UseStaticFiles();
+ app.UseSpaStaticFiles();
+
+ app.UseMvc(routes =>
+ {
+ routes.MapRoute(
+ name: "default",
+ template: "{controller}/{action=Index}/{id?}");
+ });
+
+ app.UseSpa(spa =>
+ {
+ spa.Options.SourcePath = "ClientApp";
+
+ if (env.IsDevelopment())
+ {
+ spa.UseReactDevelopmentServer(npmScript: "start");
+ }
+ });
+ }
+ }
+}
diff --git a/samples/demos/azure-sql-edge-demos/Wind Turbine Demo/webappsrc/SqlDbEdgeDemoWeb/SqlDbEdgeDemo.Web/appsettings.Development.json b/samples/demos/azure-sql-edge-demos/Wind Turbine Demo/webappsrc/SqlDbEdgeDemoWeb/SqlDbEdgeDemo.Web/appsettings.Development.json
new file mode 100644
index 00000000..e203e940
--- /dev/null
+++ b/samples/demos/azure-sql-edge-demos/Wind Turbine Demo/webappsrc/SqlDbEdgeDemoWeb/SqlDbEdgeDemo.Web/appsettings.Development.json
@@ -0,0 +1,9 @@
+{
+ "Logging": {
+ "LogLevel": {
+ "Default": "Debug",
+ "System": "Information",
+ "Microsoft": "Information"
+ }
+ }
+}
diff --git a/samples/demos/azure-sql-edge-demos/Wind Turbine Demo/webappsrc/SqlDbEdgeDemoWeb/SqlDbEdgeDemo.Web/appsettings.json b/samples/demos/azure-sql-edge-demos/Wind Turbine Demo/webappsrc/SqlDbEdgeDemoWeb/SqlDbEdgeDemo.Web/appsettings.json
new file mode 100644
index 00000000..1c5b6ef9
--- /dev/null
+++ b/samples/demos/azure-sql-edge-demos/Wind Turbine Demo/webappsrc/SqlDbEdgeDemoWeb/SqlDbEdgeDemo.Web/appsettings.json
@@ -0,0 +1,11 @@
+{
+ "Logging": {
+ "LogLevel": {
+ "Default": "Warning"
+ }
+ },
+ "IoTHub": {
+ "ModuleConnectionString": ""
+ },
+ "AllowedHosts": "*"
+}
diff --git a/samples/demos/azure-sql-edge-demos/Wind Turbine Demo/webappsrc/SqlDbEdgeDemoWeb/SqlDbEdgeDemo.sln b/samples/demos/azure-sql-edge-demos/Wind Turbine Demo/webappsrc/SqlDbEdgeDemoWeb/SqlDbEdgeDemo.sln
new file mode 100644
index 00000000..56161789
--- /dev/null
+++ b/samples/demos/azure-sql-edge-demos/Wind Turbine Demo/webappsrc/SqlDbEdgeDemoWeb/SqlDbEdgeDemo.sln
@@ -0,0 +1,34 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 15
+VisualStudioVersion = 15.0.26124.0
+MinimumVisualStudioVersion = 15.0.26124.0
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SqlDbEdgeDemo.Web", "SqlDbEdgeDemo.Web\SqlDbEdgeDemo.Web.csproj", "{CAC06327-8684-4D14-A31F-AF4D995FBB38}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Debug|x64 = Debug|x64
+ Debug|x86 = Debug|x86
+ Release|Any CPU = Release|Any CPU
+ Release|x64 = Release|x64
+ Release|x86 = Release|x86
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {CAC06327-8684-4D14-A31F-AF4D995FBB38}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {CAC06327-8684-4D14-A31F-AF4D995FBB38}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {CAC06327-8684-4D14-A31F-AF4D995FBB38}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {CAC06327-8684-4D14-A31F-AF4D995FBB38}.Debug|x64.Build.0 = Debug|Any CPU
+ {CAC06327-8684-4D14-A31F-AF4D995FBB38}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {CAC06327-8684-4D14-A31F-AF4D995FBB38}.Debug|x86.Build.0 = Debug|Any CPU
+ {CAC06327-8684-4D14-A31F-AF4D995FBB38}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {CAC06327-8684-4D14-A31F-AF4D995FBB38}.Release|Any CPU.Build.0 = Release|Any CPU
+ {CAC06327-8684-4D14-A31F-AF4D995FBB38}.Release|x64.ActiveCfg = Release|Any CPU
+ {CAC06327-8684-4D14-A31F-AF4D995FBB38}.Release|x64.Build.0 = Release|Any CPU
+ {CAC06327-8684-4D14-A31F-AF4D995FBB38}.Release|x86.ActiveCfg = Release|Any CPU
+ {CAC06327-8684-4D14-A31F-AF4D995FBB38}.Release|x86.Build.0 = Release|Any CPU
+ EndGlobalSection
+EndGlobal
diff --git a/samples/demos/azure-sql-edge-demos/readme.md b/samples/demos/azure-sql-edge-demos/readme.md
new file mode 100644
index 00000000..c6e6cb06
--- /dev/null
+++ b/samples/demos/azure-sql-edge-demos/readme.md
@@ -0,0 +1,2 @@
+# Azure SQL Demos
+
diff --git a/samples/features/azure-arc/deployment/kubeadm/ubuntu-single-node-vm/setup-controller-new.sh b/samples/features/azure-arc/deployment/kubeadm/ubuntu-single-node-vm/setup-controller-new.sh
index 5ec006a4..896e6ddb 100644
--- a/samples/features/azure-arc/deployment/kubeadm/ubuntu-single-node-vm/setup-controller-new.sh
+++ b/samples/features/azure-arc/deployment/kubeadm/ubuntu-single-node-vm/setup-controller-new.sh
@@ -41,7 +41,7 @@ fi
if [ -z "$ARC_DC_REGION" ]
then
- read -p "Enter a region for the new Azure Arc Data Controller (eastus, eastus2, centralus, westus2, westeurope or southeastasia): " dc_region
+ read -p "Enter a region for the new Azure Arc Data Controller (eastus, eastus2, centralus, westus2, westeurope, southeastasia, japaneast, australiaeast, koreacentral, northeurope, uksouth, or francecentral): " dc_region
echo
export ARC_DC_REGION=$dc_region
fi
@@ -80,7 +80,7 @@ export DEBIAN_FRONTEND=noninteractive
# Requirements file.
export OSCODENAME=$(lsb_release -cs)
-export AZDATA_PRIVATE_PREVIEW_DEB_PACKAGE="https://aka.ms/jul-2020-arc-azdata-$OSCODENAME"
+export AZDATA_PRIVATE_PREVIEW_DEB_PACKAGE="https://aka.ms/aug-2020-arc-azdata-$OSCODENAME"
# Kube version.
#
diff --git a/samples/features/epm-framework/sample-policies/Asymmetric Key Encryption Algorithm.xml b/samples/features/epm-framework/sample-policies/Asymmetric Key Encryption Algorithm.xml
new file mode 100644
index 00000000..6d5429f9
--- /dev/null
+++ b/samples/features/epm-framework/sample-policies/Asymmetric Key Encryption Algorithm.xml
@@ -0,0 +1,352 @@
+
+
+
+
+<_locDefinition xmlns="urn:locstudio">
+ <_locDefault _loc="locNone" />
+ <_locTag _loc="locData">DMF:Name
+ <_locTag _loc="locData">DMF:Description
+ <_locTag _loc="locData">DMF:Condition
+ <_locTag _loc="locData">DMF:ObjectSet
+ <_locTag _loc="locData">DMF:RootCondition
+ <_locTag _loc="locData">DMF:PolicyCategory
+ <_locTag _loc="locData">DMF:HelpText
+
+
+ urn:uuid:96fe1236-abf6-4a57-b54d-e9baab394fd1
+ http://documentcollection/
+
+
+
+
+
+
+ /system/schema/DMF
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ /PolicyStore/Policy/Asymmetric Key Encryption Algorithm
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+
+
+ /PolicyStore/Condition/RSA 1024 or RSA 2048 Encrypted
+
+
+
+
+ /PolicyStore/ObjectSet/Asymmetric Key Encryption Algorithm__ObjectSet
+
+
+
+
+ /PolicyStore/Condition/SQL Server 2005 or a Later Version
+
+
+
+
+ /PolicyStore/PolicyCategory/Microsoft Best Practices_b Security
+
+
+ Asymmetric Key Encryption Algorithm
+ Checks whether asymmetric keys were created with 1024-bit or better.
+ RSA 1024 or RSA 2048 Encrypted
+ Asymmetric Key Encryption Algorithm_ObjectSet
+ SQL Server 2005 or a Later Version
+ Microsoft Best Practices: Security
+ false
+ None
+
+ http://go.microsoft.com/fwlink/?LinkId=116370
+ 0001-01-01T00:00:00
+ 0001-01-01T00:00:00
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Asymmetric Key Encryption Algorithm__ObjectSet
+
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Asymmetric Key Encryption Algorithm__ObjectSet/TargetSet/Server_/Database_/AsymmetricKey
+
+
+
+
+
+ /PolicyStore
+
+
+ Asymmetric Key Encryption Algorithm_ObjectSet
+ AsymmetricKey
+
+
+
+
+
+
+ /PolicyStore/Condition/RSA 1024 or RSA 2048 Encrypted
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>OR</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>EQ</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Attribute><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <Name>KeyEncryptionAlgorithm</Name><?char 13?>
+ </Attribute><?char 13?>
+ <Function><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <FunctionType>Enum</FunctionType><?char 13?>
+ <ReturnType>Numeric</ReturnType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>String</TypeClass><?char 13?>
+ <ObjType>System.String</ObjType><?char 13?>
+ <Value>Microsoft.SqlServer.Management.Smo.AsymmetricKeyEncryptionAlgorithm</Value><?char 13?>
+ </Constant><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>String</TypeClass><?char 13?>
+ <ObjType>System.String</ObjType><?char 13?>
+ <Value>Rsa1024</Value><?char 13?>
+ </Constant><?char 13?>
+ </Function><?char 13?>
+ </Operator><?char 13?>
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>EQ</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Attribute><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <Name>KeyEncryptionAlgorithm</Name><?char 13?>
+ </Attribute><?char 13?>
+ <Function><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <FunctionType>Enum</FunctionType><?char 13?>
+ <ReturnType>Numeric</ReturnType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>String</TypeClass><?char 13?>
+ <ObjType>System.String</ObjType><?char 13?>
+ <Value>Microsoft.SqlServer.Management.Smo.AsymmetricKeyEncryptionAlgorithm</Value><?char 13?>
+ </Constant><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>String</TypeClass><?char 13?>
+ <ObjType>System.String</ObjType><?char 13?>
+ <Value>Rsa2048</Value><?char 13?>
+ </Constant><?char 13?>
+ </Function><?char 13?>
+ </Operator><?char 13?>
+</Operator>
+ RSA 1024 or RSA 2048 Encrypted
+ Confirms that asymmetric keys were created with 1024-bit encryption or better.
+ AsymmetricKey
+
+
+
+
+
+
+ /PolicyStore/Condition/SQL Server 2005 or a Later Version
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>GE</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Attribute><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <Name>VersionMajor</Name><?char 13?>
+ </Attribute><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <ObjType>System.Int32</ObjType><?char 13?>
+ <Value>9</Value><?char 13?>
+ </Constant><?char 13?>
+</Operator>
+ SQL Server 2005 or a Later Version
+ Confirms that the version of SQL Server is 2005 or a later version.
+ Server
+
+
+
+
+
+
+ /PolicyStore/PolicyCategory/Microsoft Best Practices_b Security
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+ Microsoft Best Practices: Security
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Asymmetric Key Encryption Algorithm__ObjectSet/TargetSet/Server_/Database_/AsymmetricKey
+
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Asymmetric Key Encryption Algorithm__ObjectSet/TargetSet/Server_/Database_/AsymmetricKey/TargetSetLevel/Server_/Database_/AsymmetricKey
+
+
+ /PolicyStore/ObjectSet/Asymmetric Key Encryption Algorithm__ObjectSet/TargetSet/Server_/Database_/AsymmetricKey/TargetSetLevel/Server_/Database
+
+
+
+
+
+ /PolicyStore/ObjectSet/Asymmetric Key Encryption Algorithm__ObjectSet
+
+
+ Server/Database/AsymmetricKey
+ true
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Asymmetric Key Encryption Algorithm__ObjectSet/TargetSet/Server_/Database_/AsymmetricKey/TargetSetLevel/Server_/Database_/AsymmetricKey
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Asymmetric Key Encryption Algorithm__ObjectSet/TargetSet/Server_/Database_/AsymmetricKey
+
+
+ Server/Database/AsymmetricKey
+ AsymmetricKey
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Asymmetric Key Encryption Algorithm__ObjectSet/TargetSet/Server_/Database_/AsymmetricKey/TargetSetLevel/Server_/Database
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Asymmetric Key Encryption Algorithm__ObjectSet/TargetSet/Server_/Database_/AsymmetricKey
+
+
+ Server/Database
+ Database
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/samples/features/epm-framework/sample-policies/Backup and Data File Location.xml b/samples/features/epm-framework/sample-policies/Backup and Data File Location.xml
new file mode 100644
index 00000000..5a5257f0
--- /dev/null
+++ b/samples/features/epm-framework/sample-policies/Backup and Data File Location.xml
@@ -0,0 +1,251 @@
+
+
+
+
+<_locDefinition xmlns="urn:locstudio">
+ <_locDefault _loc="locNone" />
+ <_locTag _loc="locData">DMF:Name
+ <_locTag _loc="locData">DMF:Description
+ <_locTag _loc="locData">DMF:Condition
+ <_locTag _loc="locData">DMF:ObjectSet
+ <_locTag _loc="locData">DMF:RootCondition
+ <_locTag _loc="locData">DMF:PolicyCategory
+ <_locTag _loc="locData">DMF:HelpText
+
+
+ urn:uuid:96fe1236-abf6-4a57-b54d-e9baab394fd1
+ http://documentcollection/
+
+
+
+
+
+
+ /system/schema/DMF
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ /PolicyStore/Policy/Backup and Data File Location
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+
+
+ /PolicyStore/Condition/Data and Backup on Separate Drive
+
+
+
+
+ /PolicyStore/ObjectSet/Backup and Data File Location__ObjectSet
+
+
+
+
+ /PolicyStore/PolicyCategory/Microsoft Best Practices_b Maintenance
+
+
+ Backup and Data File Location
+ Checks if database and the backups are on separate backup devices. If they are on the same backup device, and the device that contains the database fails, your backups will be unavailable. Also, putting the data and backups on separate devices optimizes the I/O performance for both the production use of the database and writing the backups.<?char 13?>
+<?char 13?>
+Note: This policy cannot detect separate physical devices through mount points.
+ Data and Backup on Separate Drive
+ Backup and Data File Location_ObjectSet
+ Microsoft Best Practices: Maintenance
+ false
+ None
+
+ http://go.microsoft.com/fwlink/?LinkId=116373
+ 0001-01-01T00:00:00
+ 0001-01-01T00:00:00
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Backup and Data File Location__ObjectSet
+
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Backup and Data File Location__ObjectSet/TargetSet/Server_/Database
+
+
+
+
+
+ /PolicyStore
+
+
+ Backup and Data File Location_ObjectSet
+ IDatabaseMaintenanceFacet
+
+
+
+
+
+
+ /PolicyStore/Condition/Data and Backup on Separate Drive
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>EQ</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Attribute><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <Name>DataAndBackupOnSeparateLogicalVolumes</Name><?char 13?>
+ </Attribute><?char 13?>
+ <Function><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <FunctionType>True</FunctionType><?char 13?>
+ <ReturnType>Bool</ReturnType><?char 13?>
+ <Count>0</Count><?char 13?>
+ </Function><?char 13?>
+</Operator>
+ Data and Backup on Separate Drive
+ Confirms that the database and the database backups are on separate drives.
+ IDatabaseMaintenanceFacet
+
+
+
+
+
+
+ /PolicyStore/PolicyCategory/Microsoft Best Practices_b Maintenance
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+ Microsoft Best Practices: Maintenance
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Backup and Data File Location__ObjectSet/TargetSet/Server_/Database
+
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Backup and Data File Location__ObjectSet/TargetSet/Server_/Database/TargetSetLevel/Server_/Database
+
+
+
+
+
+ /PolicyStore/ObjectSet/Backup and Data File Location__ObjectSet
+
+
+ Server/Database
+ true
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Backup and Data File Location__ObjectSet/TargetSet/Server_/Database/TargetSetLevel/Server_/Database
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Backup and Data File Location__ObjectSet/TargetSet/Server_/Database
+
+
+ Server/Database
+ Database
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/samples/features/epm-framework/sample-policies/Data and Log File Location.xml b/samples/features/epm-framework/sample-policies/Data and Log File Location.xml
new file mode 100644
index 00000000..8bcc7fba
--- /dev/null
+++ b/samples/features/epm-framework/sample-policies/Data and Log File Location.xml
@@ -0,0 +1,405 @@
+
+
+
+
+<_locDefinition xmlns="urn:locstudio">
+ <_locDefault _loc="locNone" />
+ <_locTag _loc="locData">DMF:Name
+ <_locTag _loc="locData">DMF:Description
+ <_locTag _loc="locData">DMF:Condition
+ <_locTag _loc="locData">DMF:ObjectSet
+ <_locTag _loc="locData">DMF:RootCondition
+ <_locTag _loc="locData">DMF:PolicyCategory
+ <_locTag _loc="locData">DMF:HelpText
+
+
+ urn:uuid:96fe1236-abf6-4a57-b54d-e9baab394fd1
+ http://documentcollection/
+
+
+
+
+
+
+ /system/schema/DMF
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ /PolicyStore/Policy/Data and Log File Location
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+
+
+ /PolicyStore/Condition/Data and Log Files on Separate Drives
+
+
+
+
+ /PolicyStore/ObjectSet/Data and Log File Location__ObjectSet
+
+
+
+
+ /PolicyStore/Condition/Enterprise or Standard Edition
+
+
+
+
+ /PolicyStore/PolicyCategory/Microsoft Best Practices_b Performance
+
+
+ Data and Log File Location
+ Checks whether data and log files are placed on separate logical drives. Placing both data and log files on the same drive can cause contention for that drive and result in poor performance. Placing the files on separate drives allows the I/O activity to occur at the same time for both the data and log files. The best practice is to specify separate drives for the data and log when you create a new database. To move files after the database is created, the database must be taken offline. Move the files by using one of the following methods:<?char 13?>
+<?char 13?>
+* Restore the database from backup by using the RESTORE DATABASE statement with the WITH MOVE option. <?char 13?>
+* Detach and then re-attach the database specifying separate locations for the data and log devices. <?char 13?>
+* Specify a new location by running the ALTER DATABASE statement with the MODIFY FILE option, and then restarting the instance of SQL Server. <?char 13?>
+<?char 13?>
+Note: This policy cannot detect separate physical devices through mount points.
+ Data and Log Files on Separate Drives
+ Data and Log File Location_ObjectSet
+ Enterprise or Standard Edition
+ Microsoft Best Practices: Performance
+ false
+ None
+
+ http://go.microsoft.com/fwlink/?LinkId=116362
+ 0001-01-01T00:00:00
+ 0001-01-01T00:00:00
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Data and Log File Location__ObjectSet
+
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Data and Log File Location__ObjectSet/TargetSet/Server_/Database
+
+
+
+
+
+ /PolicyStore
+
+
+ Data and Log File Location_ObjectSet
+ IDatabasePerformanceFacet
+
+
+
+
+
+
+ /PolicyStore/Condition/Data and Log Files on Separate Drives
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>OR</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>OR</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>OR</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>EQ</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Attribute><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <Name>DataAndLogFilesOnSeparateLogicalVolumes</Name><?char 13?>
+ </Attribute><?char 13?>
+ <Function><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <FunctionType>True</FunctionType><?char 13?>
+ <ReturnType>Bool</ReturnType><?char 13?>
+ <Count>0</Count><?char 13?>
+ </Function><?char 13?>
+ </Operator><?char 13?>
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>LT</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Attribute><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <Name>Size</Name><?char 13?>
+ </Attribute><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <ObjType>System.Int32</ObjType><?char 13?>
+ <Value>5120</Value><?char 13?>
+ </Constant><?char 13?>
+ </Operator><?char 13?>
+ </Operator><?char 13?>
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>NE</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Attribute><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <Name>Status</Name><?char 13?>
+ </Attribute><?char 13?>
+ <Function><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <FunctionType>Enum</FunctionType><?char 13?>
+ <ReturnType>Numeric</ReturnType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>String</TypeClass><?char 13?>
+ <ObjType>System.String</ObjType><?char 13?>
+ <Value>Microsoft.SqlServer.Management.Smo.DatabaseStatus</Value><?char 13?>
+ </Constant><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>String</TypeClass><?char 13?>
+ <ObjType>System.String</ObjType><?char 13?>
+ <Value>Normal</Value><?char 13?>
+ </Constant><?char 13?>
+ </Function><?char 13?>
+ </Operator><?char 13?>
+ </Operator><?char 13?>
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>EQ</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Attribute><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <Name>IsSystemObject</Name><?char 13?>
+ </Attribute><?char 13?>
+ <Function><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <FunctionType>True</FunctionType><?char 13?>
+ <ReturnType>Bool</ReturnType><?char 13?>
+ <Count>0</Count><?char 13?>
+ </Function><?char 13?>
+ </Operator><?char 13?>
+</Operator>
+ Data and Log Files on Separate Drives
+ Confirms that data and log files are placed on separate drives.
+ IDatabasePerformanceFacet
+
+
+
+
+
+
+ /PolicyStore/Condition/Enterprise or Standard Edition
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>OR</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>EQ</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Attribute><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <Name>EngineEdition</Name><?char 13?>
+ </Attribute><?char 13?>
+ <Function><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <FunctionType>Enum</FunctionType><?char 13?>
+ <ReturnType>Numeric</ReturnType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>String</TypeClass><?char 13?>
+ <ObjType>System.String</ObjType><?char 13?>
+ <Value>Microsoft.SqlServer.Management.Smo.Edition</Value><?char 13?>
+ </Constant><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>String</TypeClass><?char 13?>
+ <ObjType>System.String</ObjType><?char 13?>
+ <Value>Standard</Value><?char 13?>
+ </Constant><?char 13?>
+ </Function><?char 13?>
+ </Operator><?char 13?>
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>EQ</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Attribute><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <Name>EngineEdition</Name><?char 13?>
+ </Attribute><?char 13?>
+ <Function><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <FunctionType>Enum</FunctionType><?char 13?>
+ <ReturnType>Numeric</ReturnType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>String</TypeClass><?char 13?>
+ <ObjType>System.String</ObjType><?char 13?>
+ <Value>Microsoft.SqlServer.Management.Smo.Edition</Value><?char 13?>
+ </Constant><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>String</TypeClass><?char 13?>
+ <ObjType>System.String</ObjType><?char 13?>
+ <Value>EnterpriseOrDeveloper</Value><?char 13?>
+ </Constant><?char 13?>
+ </Function><?char 13?>
+ </Operator><?char 13?>
+</Operator>
+ Enterprise or Standard Edition
+ Confirms that the instance of SQL Server is either Enterprise or Standard Edition.
+ Server
+
+
+
+
+
+
+ /PolicyStore/PolicyCategory/Microsoft Best Practices_b Performance
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+ Microsoft Best Practices: Performance
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Data and Log File Location__ObjectSet/TargetSet/Server_/Database
+
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Data and Log File Location__ObjectSet/TargetSet/Server_/Database/TargetSetLevel/Server_/Database
+
+
+
+
+
+ /PolicyStore/ObjectSet/Data and Log File Location__ObjectSet
+
+
+ Server/Database
+ true
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Data and Log File Location__ObjectSet/TargetSet/Server_/Database/TargetSetLevel/Server_/Database
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Data and Log File Location__ObjectSet/TargetSet/Server_/Database
+
+
+ Server/Database
+ Database
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/samples/features/epm-framework/sample-policies/Database Auto Close.xml b/samples/features/epm-framework/sample-policies/Database Auto Close.xml
new file mode 100644
index 00000000..a1999799
--- /dev/null
+++ b/samples/features/epm-framework/sample-policies/Database Auto Close.xml
@@ -0,0 +1,330 @@
+
+
+
+
+<_locDefinition xmlns="urn:locstudio">
+ <_locDefault _loc="locNone" />
+ <_locTag _loc="locData">DMF:Name
+ <_locTag _loc="locData">DMF:Description
+ <_locTag _loc="locData">DMF:Condition
+ <_locTag _loc="locData">DMF:ObjectSet
+ <_locTag _loc="locData">DMF:RootCondition
+ <_locTag _loc="locData">DMF:PolicyCategory
+ <_locTag _loc="locData">DMF:HelpText
+
+
+ urn:uuid:96fe1236-abf6-4a57-b54d-e9baab394fd1
+ http://documentcollection/
+
+
+
+
+
+
+ /system/schema/DMF
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ /PolicyStore/Policy/Database Auto Close
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+
+
+ /PolicyStore/Condition/Auto Close Disabled
+
+
+
+
+ /PolicyStore/ObjectSet/Database Auto Close__ObjectSet
+
+
+
+
+ /PolicyStore/Condition/Enterprise or Standard Edition
+
+
+
+
+ /PolicyStore/PolicyCategory/Microsoft Best Practices_b Performance
+
+
+ Database Auto Close
+ Checks that the AUTO_ CLOSE option is off for SQL Server Standard and Enterprise Editions. When set to on, this option can cause performance degradation on frequently accessed databases because of the increased overhead of opening and closing the database after each connection. AUTO_CLOSE also flushes the procedure cache after each connection.
+ Auto Close Disabled
+ Database Auto Close_ObjectSet
+ Enterprise or Standard Edition
+ Microsoft Best Practices: Performance
+ false
+ None
+
+ http://go.microsoft.com/fwlink/?LinkId=116338
+ 0001-01-01T00:00:00
+ 0001-01-01T00:00:00
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Database Auto Close__ObjectSet
+
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Database Auto Close__ObjectSet/TargetSet/Server_/Database
+
+
+
+
+
+ /PolicyStore
+
+
+ Database Auto Close_ObjectSet
+ IDatabasePerformanceFacet
+
+
+
+
+
+
+ /PolicyStore/Condition/Auto Close Disabled
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>EQ</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Attribute><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <Name>AutoClose</Name><?char 13?>
+ </Attribute><?char 13?>
+ <Function><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <FunctionType>False</FunctionType><?char 13?>
+ <ReturnType>Bool</ReturnType><?char 13?>
+ <Count>0</Count><?char 13?>
+ </Function><?char 13?>
+</Operator>
+ Auto Close Disabled
+ Confirms that the AUTO_CLOSE database option is set to off.
+ IDatabasePerformanceFacet
+
+
+
+
+
+
+ /PolicyStore/Condition/Enterprise or Standard Edition
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>OR</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>EQ</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Attribute><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <Name>EngineEdition</Name><?char 13?>
+ </Attribute><?char 13?>
+ <Function><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <FunctionType>Enum</FunctionType><?char 13?>
+ <ReturnType>Numeric</ReturnType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>String</TypeClass><?char 13?>
+ <ObjType>System.String</ObjType><?char 13?>
+ <Value>Microsoft.SqlServer.Management.Smo.Edition</Value><?char 13?>
+ </Constant><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>String</TypeClass><?char 13?>
+ <ObjType>System.String</ObjType><?char 13?>
+ <Value>Standard</Value><?char 13?>
+ </Constant><?char 13?>
+ </Function><?char 13?>
+ </Operator><?char 13?>
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>EQ</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Attribute><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <Name>EngineEdition</Name><?char 13?>
+ </Attribute><?char 13?>
+ <Function><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <FunctionType>Enum</FunctionType><?char 13?>
+ <ReturnType>Numeric</ReturnType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>String</TypeClass><?char 13?>
+ <ObjType>System.String</ObjType><?char 13?>
+ <Value>Microsoft.SqlServer.Management.Smo.Edition</Value><?char 13?>
+ </Constant><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>String</TypeClass><?char 13?>
+ <ObjType>System.String</ObjType><?char 13?>
+ <Value>EnterpriseOrDeveloper</Value><?char 13?>
+ </Constant><?char 13?>
+ </Function><?char 13?>
+ </Operator><?char 13?>
+</Operator>
+ Enterprise or Standard Edition
+ Confirms that the instance of SQL Server is either Enterprise or Standard Edition.
+ Server
+
+
+
+
+
+
+ /PolicyStore/PolicyCategory/Microsoft Best Practices_b Performance
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+ Microsoft Best Practices: Performance
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Database Auto Close__ObjectSet/TargetSet/Server_/Database
+
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Database Auto Close__ObjectSet/TargetSet/Server_/Database/TargetSetLevel/Server_/Database
+
+
+
+
+
+ /PolicyStore/ObjectSet/Database Auto Close__ObjectSet
+
+
+ Server/Database
+ true
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Database Auto Close__ObjectSet/TargetSet/Server_/Database/TargetSetLevel/Server_/Database
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Database Auto Close__ObjectSet/TargetSet/Server_/Database
+
+
+ Server/Database
+ Database
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/samples/features/epm-framework/sample-policies/Database Auto Shrink.xml b/samples/features/epm-framework/sample-policies/Database Auto Shrink.xml
new file mode 100644
index 00000000..00272a06
--- /dev/null
+++ b/samples/features/epm-framework/sample-policies/Database Auto Shrink.xml
@@ -0,0 +1,400 @@
+
+
+
+
+<_locDefinition xmlns="urn:locstudio">
+ <_locDefault _loc="locNone" />
+ <_locTag _loc="locData">DMF:Name
+ <_locTag _loc="locData">DMF:Description
+ <_locTag _loc="locData">DMF:Condition
+ <_locTag _loc="locData">DMF:ObjectSet
+ <_locTag _loc="locData">DMF:RootCondition
+ <_locTag _loc="locData">DMF:PolicyCategory
+ <_locTag _loc="locData">DMF:HelpText
+
+
+ urn:uuid:96fe1236-abf6-4a57-b54d-e9baab394fd1
+ http://documentcollection/
+
+
+
+
+
+
+ /system/schema/DMF
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ /PolicyStore/Policy/Database Auto Shrink
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+
+
+ /PolicyStore/Condition/Auto Shrink Disabled
+
+
+
+
+ /PolicyStore/ObjectSet/Database Auto Shrink__ObjectSet
+
+
+
+
+ /PolicyStore/Condition/Enterprise or Standard Edition
+
+
+
+
+ /PolicyStore/PolicyCategory/Microsoft Best Practices_b Performance
+
+
+ Database Auto Shrink
+ Checks that the AUTO_SHRINK option is off for user databases on SQL Server Standard and Enterprise Editions. Frequently shrinking and expanding a database can lead to poor performance because of physical fragmentation. Set the AUTO_SHRINK database option to OFF. If you know that the space that you are reclaiming will not be needed in the future, you can manually shrink the database.
+ Auto Shrink Disabled
+ Database Auto Shrink_ObjectSet
+ Enterprise or Standard Edition
+ Microsoft Best Practices: Performance
+ false
+ None
+
+ http://go.microsoft.com/fwlink/?LinkId=116337
+ 0001-01-01T00:00:00
+ 0001-01-01T00:00:00
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Database Auto Shrink__ObjectSet
+
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Database Auto Shrink__ObjectSet/TargetSet/Server_/Database
+
+
+
+
+
+ /PolicyStore
+
+
+ Database Auto Shrink_ObjectSet
+ IDatabasePerformanceFacet
+
+
+
+
+
+
+ /PolicyStore/Condition/Auto Shrink Disabled
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>EQ</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Attribute><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <Name>AutoShrink</Name><?char 13?>
+ </Attribute><?char 13?>
+ <Function><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <FunctionType>False</FunctionType><?char 13?>
+ <ReturnType>Bool</ReturnType><?char 13?>
+ <Count>0</Count><?char 13?>
+ </Function><?char 13?>
+</Operator>
+ Auto Shrink Disabled
+ Confirms that the AUTO_SHRINK database option is set to off.
+ IDatabasePerformanceFacet
+
+
+
+
+
+
+ /PolicyStore/Condition/Enterprise or Standard Edition
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>OR</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>EQ</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Attribute><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <Name>EngineEdition</Name><?char 13?>
+ </Attribute><?char 13?>
+ <Function><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <FunctionType>Enum</FunctionType><?char 13?>
+ <ReturnType>Numeric</ReturnType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>String</TypeClass><?char 13?>
+ <ObjType>System.String</ObjType><?char 13?>
+ <Value>Microsoft.SqlServer.Management.Smo.Edition</Value><?char 13?>
+ </Constant><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>String</TypeClass><?char 13?>
+ <ObjType>System.String</ObjType><?char 13?>
+ <Value>Standard</Value><?char 13?>
+ </Constant><?char 13?>
+ </Function><?char 13?>
+ </Operator><?char 13?>
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>EQ</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Attribute><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <Name>EngineEdition</Name><?char 13?>
+ </Attribute><?char 13?>
+ <Function><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <FunctionType>Enum</FunctionType><?char 13?>
+ <ReturnType>Numeric</ReturnType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>String</TypeClass><?char 13?>
+ <ObjType>System.String</ObjType><?char 13?>
+ <Value>Microsoft.SqlServer.Management.Smo.Edition</Value><?char 13?>
+ </Constant><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>String</TypeClass><?char 13?>
+ <ObjType>System.String</ObjType><?char 13?>
+ <Value>EnterpriseOrDeveloper</Value><?char 13?>
+ </Constant><?char 13?>
+ </Function><?char 13?>
+ </Operator><?char 13?>
+</Operator>
+ Enterprise or Standard Edition
+ Confirms that the instance of SQL Server is either Enterprise or Standard Edition.
+ Server
+
+
+
+
+
+
+ /PolicyStore/PolicyCategory/Microsoft Best Practices_b Performance
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+ Microsoft Best Practices: Performance
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Database Auto Shrink__ObjectSet/TargetSet/Server_/Database
+
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Database Auto Shrink__ObjectSet/TargetSet/Server_/Database/TargetSetLevel/Server_/Database
+
+
+
+
+
+ /PolicyStore/ObjectSet/Database Auto Shrink__ObjectSet
+
+
+ Server/Database
+ true
+
+
+
+
+
+
+ /PolicyStore/Condition/Online User Database
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>AND</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>EQ</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Attribute><?char 13?>
+ <TypeClass>Unsupported</TypeClass><?char 13?>
+ <Name>IsSystemObject</Name><?char 13?>
+ </Attribute><?char 13?>
+ <Function><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <FunctionType>False</FunctionType><?char 13?>
+ <ReturnType>Bool</ReturnType><?char 13?>
+ <Count>0</Count><?char 13?>
+ </Function><?char 13?>
+ </Operator><?char 13?>
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>EQ</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Attribute><?char 13?>
+ <TypeClass>Unsupported</TypeClass><?char 13?>
+ <Name>Status</Name><?char 13?>
+ </Attribute><?char 13?>
+ <Function><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <FunctionType>Enum</FunctionType><?char 13?>
+ <ReturnType>Numeric</ReturnType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>String</TypeClass><?char 13?>
+ <ObjType>System.String</ObjType><?char 13?>
+ <Value>Microsoft.SqlServer.Management.Smo.DatabaseStatus</Value><?char 13?>
+ </Constant><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>String</TypeClass><?char 13?>
+ <ObjType>System.String</ObjType><?char 13?>
+ <Value>Normal</Value><?char 13?>
+ </Constant><?char 13?>
+ </Function><?char 13?>
+ </Operator><?char 13?>
+</Operator>
+ Online User Database
+ Confirms that the database is not a system database and that it is online.
+ Database
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Database Auto Shrink__ObjectSet/TargetSet/Server_/Database/TargetSetLevel/Server_/Database
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Database Auto Shrink__ObjectSet/TargetSet/Server_/Database
+
+
+
+
+ /PolicyStore/Condition/Online User Database
+
+
+ Server/Database
+ Database
+ Online User Database
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/samples/features/epm-framework/sample-policies/Database Collation.xml b/samples/features/epm-framework/sample-policies/Database Collation.xml
new file mode 100644
index 00000000..0e75cb3d
--- /dev/null
+++ b/samples/features/epm-framework/sample-policies/Database Collation.xml
@@ -0,0 +1,252 @@
+
+
+
+
+<_locDefinition xmlns="urn:locstudio">
+ <_locDefault _loc="locNone" />
+ <_locTag _loc="locData">DMF:Name
+ <_locTag _loc="locData">DMF:Description
+ <_locTag _loc="locData">DMF:Condition
+ <_locTag _loc="locData">DMF:ObjectSet
+ <_locTag _loc="locData">DMF:RootCondition
+ <_locTag _loc="locData">DMF:PolicyCategory
+ <_locTag _loc="locData">DMF:HelpText
+
+
+ urn:uuid:96fe1236-abf6-4a57-b54d-e9baab394fd1
+ http://documentcollection/
+
+
+
+
+
+
+ /system/schema/DMF
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ /PolicyStore/Policy/Database Collation
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+
+
+ /PolicyStore/Condition/Collation Matches master or model
+
+
+
+
+ /PolicyStore/ObjectSet/Database Collation__ObjectSet
+
+
+
+
+ /PolicyStore/PolicyCategory/Microsoft Best Practices_b Performance
+
+
+ Database Collation
+ Looks for user-defined databases that have a collation different from the master or model databases. It is recommended that you not use this configuration because collation conflicts can occur that might prevent code from executing. For example, when a stored procedure joins one table to a temporary table, SQL Server might end the batch and return a collation conflict error if the collations of the user-defined database and the model database are different. This happens because temporary tables are created in tempdb, which obtains its collation based on that of the model database. If you experience collation conflict errors, consider one of the following solutions:<?char 13?>
+ * Export the data from the user database and import it into new tables that have the same collation as the master and model databases.<?char 13?>
+ * Rebuild the system databases to use a collation that matches the user database collation.<?char 13?>
+ * Modify any stored procedures that join user tables to tables in tempdb to create the tables in tempdb by using the collation of the user database. To do this, add the COLLATE database_default clause to the column definitions of the temporary table. For example: CREATE TABLE #temp1 ( c1 int, c2 varchar(30) COLLATE database_default )
+ Collation Matches master or model
+ Database Collation_ObjectSet
+ Microsoft Best Practices: Performance
+ false
+ None
+
+ http://go.microsoft.com/fwlink/?LinkId=116336
+ 0001-01-01T00:00:00
+ 0001-01-01T00:00:00
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Database Collation__ObjectSet
+
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Database Collation__ObjectSet/TargetSet/Server_/Database
+
+
+
+
+
+ /PolicyStore
+
+
+ Database Collation_ObjectSet
+ IDatabasePerformanceFacet
+
+
+
+
+
+
+ /PolicyStore/Condition/Collation Matches master or model
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>EQ</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Attribute><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <Name>CollationMatchesModelOrMaster</Name><?char 13?>
+ </Attribute><?char 13?>
+ <Function><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <FunctionType>True</FunctionType><?char 13?>
+ <ReturnType>Bool</ReturnType><?char 13?>
+ <Count>0</Count><?char 13?>
+ </Function><?char 13?>
+</Operator>
+ Collation Matches master or model
+ Confirms that the collation of the database matches the master or model databases.
+ IDatabasePerformanceFacet
+
+
+
+
+
+
+ /PolicyStore/PolicyCategory/Microsoft Best Practices_b Performance
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+ Microsoft Best Practices: Performance
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Database Collation__ObjectSet/TargetSet/Server_/Database
+
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Database Collation__ObjectSet/TargetSet/Server_/Database/TargetSetLevel/Server_/Database
+
+
+
+
+
+ /PolicyStore/ObjectSet/Database Collation__ObjectSet
+
+
+ Server/Database
+ true
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Database Collation__ObjectSet/TargetSet/Server_/Database/TargetSetLevel/Server_/Database
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Database Collation__ObjectSet/TargetSet/Server_/Database
+
+
+ Server/Database
+ Database
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/samples/features/epm-framework/sample-policies/Database Page Status.xml b/samples/features/epm-framework/sample-policies/Database Page Status.xml
new file mode 100644
index 00000000..00668955
--- /dev/null
+++ b/samples/features/epm-framework/sample-policies/Database Page Status.xml
@@ -0,0 +1,306 @@
+
+
+
+
+<_locDefinition xmlns="urn:locstudio">
+ <_locDefault _loc="locNone" />
+ <_locTag _loc="locData">DMF:Name
+ <_locTag _loc="locData">DMF:Description
+ <_locTag _loc="locData">DMF:Condition
+ <_locTag _loc="locData">DMF:ObjectSet
+ <_locTag _loc="locData">DMF:RootCondition
+ <_locTag _loc="locData">DMF:PolicyCategory
+ <_locTag _loc="locData">DMF:HelpText
+
+
+ urn:uuid:96fe1236-abf6-4a57-b54d-e9baab394fd1
+ http://documentcollection/
+
+
+
+
+
+
+ /system/schema/DMF
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ /PolicyStore/Policy/Database Page Status
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+
+
+ /PolicyStore/Condition/No Suspect Database Pages
+
+
+
+
+ /PolicyStore/ObjectSet/Database Page Status__ObjectSet
+
+
+
+
+ /PolicyStore/Condition/SQL Server 2005 or a Later Version
+
+
+
+
+ /PolicyStore/PolicyCategory/Microsoft Best Practices_b Maintenance
+
+
+ Database Page Status
+ Checks whether the database has suspect database pages. A database page is set suspect by error 824. This error occurs when a logical consistency error is detected during a read operation, which frequently indicates data corruption caused by a faulty I/O subsystem component. When the SQL Server Database Engine detects a suspect page, the page ID is recorded in the msdbo.dbo.suspect_pages table. This is a severe error condition that threatens database integrity and must be corrected immediately.<?char 13?>
+<?char 13?>
+Best Practices Recommendations:<?char 13?>
+* Review the SQL Server error log for the details of the 824 error for this database.<?char 13?>
+* Complete a full database consistency check (DBCC CHECKDB).<?char 13?>
+* Implement the user actions defined in MSSQLSERVER_824.<?char 13?>
+
+ No Suspect Database Pages
+ Database Page Status_ObjectSet
+ SQL Server 2005 or a Later Version
+ Microsoft Best Practices: Maintenance
+ false
+ None
+
+ http://go.microsoft.com/fwlink/?LinkId=116379
+ 0001-01-01T00:00:00
+ 0001-01-01T00:00:00
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Database Page Status__ObjectSet
+
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Database Page Status__ObjectSet/TargetSet/Server_/Database
+
+
+
+
+
+ /PolicyStore
+
+
+ Database Page Status_ObjectSet
+ IDatabaseMaintenanceFacet
+
+
+
+
+
+
+ /PolicyStore/Condition/No Suspect Database Pages
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>EQ</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Function><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <FunctionType>ExecuteSql</FunctionType><?char 13?>
+ <ReturnType>Numeric</ReturnType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>String</TypeClass><?char 13?>
+ <ObjType>System.String</ObjType><?char 13?>
+ <Value>Numeric</Value><?char 13?>
+ </Constant><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>String</TypeClass><?char 13?>
+ <ObjType>System.String</ObjType><?char 13?>
+ <Value>SELECT COUNT(*) AS [Total_Suspect_Pages] FROM msdb.dbo.suspect_pages WHERE event_type IN (1,2,3) AND database_id = DB_ID(DB_NAME()) </Value><?char 13?>
+ </Constant><?char 13?>
+ </Function><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <ObjType>System.Int32</ObjType><?char 13?>
+ <Value>0</Value><?char 13?>
+ </Constant><?char 13?>
+</Operator>
+ No Suspect Database Pages
+ Confirms that the current database has no suspect database pages. A database page is set as suspect by error 824, which indicates that a logical consistency error was detected during a read operation.
+ IDatabaseMaintenanceFacet
+
+
+
+
+
+
+ /PolicyStore/Condition/SQL Server 2005 or a Later Version
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>GE</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Attribute><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <Name>VersionMajor</Name><?char 13?>
+ </Attribute><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <ObjType>System.Int32</ObjType><?char 13?>
+ <Value>9</Value><?char 13?>
+ </Constant><?char 13?>
+</Operator>
+ SQL Server 2005 or a Later Version
+ Confirms that the version of SQL Server is 2005 or a later version.
+ Server
+
+
+
+
+
+
+ /PolicyStore/PolicyCategory/Microsoft Best Practices_b Maintenance
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+ Microsoft Best Practices: Maintenance
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Database Page Status__ObjectSet/TargetSet/Server_/Database
+
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Database Page Status__ObjectSet/TargetSet/Server_/Database/TargetSetLevel/Server_/Database
+
+
+
+
+
+ /PolicyStore/ObjectSet/Database Page Status__ObjectSet
+
+
+ Server/Database
+ true
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Database Page Status__ObjectSet/TargetSet/Server_/Database/TargetSetLevel/Server_/Database
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Database Page Status__ObjectSet/TargetSet/Server_/Database
+
+
+ Server/Database
+ Database
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/samples/features/epm-framework/sample-policies/Database Page Verification.xml b/samples/features/epm-framework/sample-policies/Database Page Verification.xml
new file mode 100644
index 00000000..c7f0cdae
--- /dev/null
+++ b/samples/features/epm-framework/sample-policies/Database Page Verification.xml
@@ -0,0 +1,250 @@
+
+
+
+
+ <_locDefinition xmlns="urn:locstudio">
+ <_locDefault _loc="locNone" />
+ <_locTag _loc="locData">DMF:Name
+ <_locTag _loc="locData">DMF:Description
+ <_locTag _loc="locData">DMF:Condition
+ <_locTag _loc="locData">DMF:ObjectSet
+ <_locTag _loc="locData">DMF:RootCondition
+ <_locTag _loc="locData">DMF:PolicyCategory
+ <_locTag _loc="locData">DMF:HelpText
+
+
+ urn:uuid:96fe1236-abf6-4a57-b54d-e9baab394fd1
+ http://documentcollection/
+
+
+
+
+
+
+ /system/schema/DMF
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ /PolicyStore/Policy/Database Page Verification
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+
+
+ /PolicyStore/Condition/Page Verify Checksum
+
+
+
+
+ /PolicyStore/ObjectSet/Database Page Verification__ObjectSet
+
+
+
+
+ /PolicyStore/PolicyCategory/Microsoft Best Practices_b Maintenance
+
+
+ Database Page Verification
+ Checks if the PAGE_VERIFY database option is not set to CHECKSUM to provide a high level of data-file integrity. When CHECKSUM is enabled for the PAGE_VERIFY database option, the SQL Server Database Engine calculates a checksum over the contents of the whole page, and stores the value in the page header when a page is written to disk. When the page is read from disk, the checksum is recomputed and compared to the checksum value that is stored in the page header. This helps provide a high level of data-file integrity.
+ Page Verify Checksum
+ Database Page Verification_ObjectSet
+ Microsoft Best Practices: Maintenance
+ false
+ None
+
+ http://go.microsoft.com/fwlink/?LinkId=116333
+ 0001-01-01T00:00:00
+ 0001-01-01T00:00:00
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Database Page Verification__ObjectSet
+
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Database Page Verification__ObjectSet/TargetSet/Server_/Database
+
+
+
+
+
+ /PolicyStore
+
+
+ Database Page Verification_ObjectSet
+ IDatabaseMaintenanceFacet
+
+
+
+
+
+
+ /PolicyStore/Condition/Page Verify Checksum
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>EQ</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Attribute><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <Name>PageVerify</Name><?char 13?>
+ </Attribute><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <ObjType>Microsoft.SqlServer.Management.Smo.PageVerify</ObjType><?char 13?>
+ <Value>Checksum</Value><?char 13?>
+ </Constant><?char 13?>
+ </Operator>
+
+ Page Verify Checksum
+ Confirms that the PAGE_VERIFY database option set to CHECKSUM.
+ IDatabaseMaintenanceFacet
+
+
+
+
+
+
+ /PolicyStore/PolicyCategory/Microsoft Best Practices_b Maintenance
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+ Microsoft Best Practices: Maintenance
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Database Page Verification__ObjectSet/TargetSet/Server_/Database
+
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Database Page Verification__ObjectSet/TargetSet/Server_/Database/TargetSetLevel/Server_/Database
+
+
+
+
+
+ /PolicyStore/ObjectSet/Database Page Verification__ObjectSet
+
+
+ Server/Database
+ true
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Database Page Verification__ObjectSet/TargetSet/Server_/Database/TargetSetLevel/Server_/Database
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Database Page Verification__ObjectSet/TargetSet/Server_/Database
+
+
+ Server/Database
+ Database
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/samples/features/epm-framework/sample-policies/Guest Permissions.xml b/samples/features/epm-framework/sample-policies/Guest Permissions.xml
new file mode 100644
index 00000000..b9785f37
--- /dev/null
+++ b/samples/features/epm-framework/sample-policies/Guest Permissions.xml
@@ -0,0 +1,404 @@
+
+
+
+
+<_locDefinition xmlns="urn:locstudio">
+ <_locDefault _loc="locNone" />
+ <_locTag _loc="locData">DMF:Name
+ <_locTag _loc="locData">DMF:Description
+ <_locTag _loc="locData">DMF:Condition
+ <_locTag _loc="locData">DMF:ObjectSet
+ <_locTag _loc="locData">DMF:RootCondition
+ <_locTag _loc="locData">DMF:PolicyCategory
+ <_locTag _loc="locData">DMF:HelpText
+
+
+ urn:uuid:96fe1236-abf6-4a57-b54d-e9baab394fd1
+ http://documentcollection/
+
+
+
+
+
+
+ /system/schema/DMF
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ /PolicyStore/Policy/Guest Permissions
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+
+
+ /PolicyStore/Condition/Has No Database Access
+
+
+
+
+ /PolicyStore/ObjectSet/Guest Permissions__ObjectSet
+
+
+
+
+ /PolicyStore/PolicyCategory/Microsoft Best Practices_b Security
+
+
+ Guest Permissions
+ Checks if permission to access the database is enabled for guest user. Remove access to the guest user if it is not required. The guest user cannot be dropped, but a guest user account can be disabled by revoking its CONNECT permission. You do this by executing REVOKE CONNECT FROM GUEST from within any database other than master, msdb, or tempdb.
+ Has No Database Access
+ Guest Permissions_ObjectSet
+ Microsoft Best Practices: Security
+ false
+ None
+
+ http://go.microsoft.com/fwlink/?LinkId=116354
+ 0001-01-01T00:00:00
+ 0001-01-01T00:00:00
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Guest Permissions__ObjectSet
+
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Guest Permissions__ObjectSet/TargetSet/Server_/Database_/User
+
+
+
+
+
+ /PolicyStore
+
+
+ Guest Permissions_ObjectSet
+ User
+
+
+
+
+
+
+ /PolicyStore/Condition/Has No Database Access
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>EQ</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Attribute><?char 13?>
+ <TypeClass>Unsupported</TypeClass><?char 13?>
+ <Name>HasDBAccess</Name><?char 13?>
+ </Attribute><?char 13?>
+ <Function><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <FunctionType>False</FunctionType><?char 13?>
+ <ReturnType>Bool</ReturnType><?char 13?>
+ <Count>0</Count><?char 13?>
+ </Function><?char 13?>
+</Operator>
+ Has No Database Access
+ Confirms that the database user does not have access to the database.
+ User
+
+
+
+
+
+
+ /PolicyStore/PolicyCategory/Microsoft Best Practices_b Security
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+ Microsoft Best Practices: Security
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Guest Permissions__ObjectSet/TargetSet/Server_/Database_/User
+
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Guest Permissions__ObjectSet/TargetSet/Server_/Database_/User/TargetSetLevel/Server_/Database_/User
+
+
+ /PolicyStore/ObjectSet/Guest Permissions__ObjectSet/TargetSet/Server_/Database_/User/TargetSetLevel/Server_/Database
+
+
+
+
+
+ /PolicyStore/ObjectSet/Guest Permissions__ObjectSet
+
+
+ Server/Database/User
+ true
+
+
+
+
+
+
+ /PolicyStore/Condition/Guest
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>EQ</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Attribute><?char 13?>
+ <TypeClass>Unsupported</TypeClass><?char 13?>
+ <Name>Name</Name><?char 13?>
+ </Attribute><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>String</TypeClass><?char 13?>
+ <ObjType>System.String</ObjType><?char 13?>
+ <Value>guest</Value><?char 13?>
+ </Constant><?char 13?>
+</Operator>
+ Guest
+ The user is the Guest account.
+ User
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Guest Permissions__ObjectSet/TargetSet/Server_/Database_/User/TargetSetLevel/Server_/Database_/User
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Guest Permissions__ObjectSet/TargetSet/Server_/Database_/User
+
+
+
+
+ /PolicyStore/Condition/Guest
+
+
+ Server/Database/User
+ User
+ Guest
+
+
+
+
+
+
+ /PolicyStore/Condition/User or Model
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>AND</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Group><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <Count>1</Count><?char 13?>
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>OR</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>EQ</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Attribute><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <Name>IsSystemObject</Name><?char 13?>
+ </Attribute><?char 13?>
+ <Function><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <FunctionType>False</FunctionType><?char 13?>
+ <ReturnType>Bool</ReturnType><?char 13?>
+ <Count>0</Count><?char 13?>
+ </Function><?char 13?>
+ </Operator><?char 13?>
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>EQ</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Attribute><?char 13?>
+ <TypeClass>String</TypeClass><?char 13?>
+ <Name>Name</Name><?char 13?>
+ </Attribute><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>String</TypeClass><?char 13?>
+ <ObjType>System.String</ObjType><?char 13?>
+ <Value>model</Value><?char 13?>
+ </Constant><?char 13?>
+ </Operator><?char 13?>
+ </Operator><?char 13?>
+ </Group><?char 13?>
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>EQ</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Attribute><?char 13?>
+ <TypeClass>Unsupported</TypeClass><?char 13?>
+ <Name>Status</Name><?char 13?>
+ </Attribute><?char 13?>
+ <Function><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <FunctionType>Enum</FunctionType><?char 13?>
+ <ReturnType>Numeric</ReturnType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>String</TypeClass><?char 13?>
+ <ObjType>System.String</ObjType><?char 13?>
+ <Value>Microsoft.SqlServer.Management.Smo.DatabaseStatus</Value><?char 13?>
+ </Constant><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>String</TypeClass><?char 13?>
+ <ObjType>System.String</ObjType><?char 13?>
+ <Value>Normal</Value><?char 13?>
+ </Constant><?char 13?>
+ </Function><?char 13?>
+ </Operator><?char 13?>
+</Operator>
+ User or Model
+ Confirms that the database is a user database or the Model database and that the database is online.
+ Database
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Guest Permissions__ObjectSet/TargetSet/Server_/Database_/User/TargetSetLevel/Server_/Database
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Guest Permissions__ObjectSet/TargetSet/Server_/Database_/User
+
+
+
+
+ /PolicyStore/Condition/User or Model
+
+
+ Server/Database
+ Database
+ User or Model
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/samples/features/epm-framework/sample-policies/Last Successful Backup Date.xml b/samples/features/epm-framework/sample-policies/Last Successful Backup Date.xml
new file mode 100644
index 00000000..6b684c7d
--- /dev/null
+++ b/samples/features/epm-framework/sample-policies/Last Successful Backup Date.xml
@@ -0,0 +1,273 @@
+
+
+
+
+ <_locDefinition xmlns="urn:locstudio">
+ <_locDefault _loc="locNone" />
+ <_locTag _loc="locData">DMF:Name
+ <_locTag _loc="locData">DMF:Description
+ <_locTag _loc="locData">DMF:Condition
+ <_locTag _loc="locData">DMF:ObjectSet
+ <_locTag _loc="locData">DMF:RootCondition
+ <_locTag _loc="locData">DMF:PolicyCategory
+ <_locTag _loc="locData">DMF:HelpText
+
+
+ urn:uuid:96fe1236-abf6-4a57-b54d-e9baab394fd1
+ http://documentcollection/
+
+
+
+
+
+
+ /system/schema/DMF
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ /PolicyStore/Policy/Last Successful Backup Date
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+
+
+ /PolicyStore/Condition/Safe Last Backup Date
+
+
+
+
+ /PolicyStore/ObjectSet/Last Successful Backup Date__ObjectSet
+
+
+
+
+ /PolicyStore/PolicyCategory/Microsoft Best Practices_b Maintenance
+
+
+ Last Successful Backup Date
+
+ Checks whether a database has recent backups. Scheduling regular backups is important for protecting your databases against data loss from a variety of failures.<?char 13?>
+ <?char 13?>
+ The appropriate frequency for backing up data depends on the recovery model of the database, on business requirements regarding potential data loss, and on how frequently the database is updated. In a frequently updated database, the amount of work-loss exposure increases relatively quickly between backups.<?char 13?>
+ <?char 13?>
+ The best practice is to perform backups frequently enough to protect databases against data loss. The simple recovery model and full recovery model both require data backups. The full recovery model also requires log backups, which should be taken more often than data backups. For either recovery model, you can supplement your full backups with differential backups to efficiently reduce the risk of data loss. For a database that uses the full recovery model, Microsoft recommends that you take frequent log backups. For a production database that contains critical data, log backups would typically be taken every one to fifteen minutes. Note: The recommended method for scheduling backups is a database maintenance plan. <?char 13?>
+
+ Safe Last Backup Date
+ Last Successful Backup Date_ObjectSet
+ Microsoft Best Practices: Maintenance
+ false
+ None
+
+ http://go.microsoft.com/fwlink/?LinkId=116361
+ 0001-01-01T00:00:00
+ 0001-01-01T00:00:00
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Last Successful Backup Date__ObjectSet
+
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Last Successful Backup Date__ObjectSet/TargetSet/Server_/Database
+
+
+
+
+
+ /PolicyStore
+
+
+ Last Successful Backup Date_ObjectSet
+ IDatabaseMaintenanceFacet
+
+
+
+
+
+
+ /PolicyStore/Condition/Safe Last Backup Date
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>GE</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Attribute><?char 13?>
+ <TypeClass>DateTime</TypeClass><?char 13?>
+ <Name>LastBackupDate</Name><?char 13?>
+ </Attribute><?char 13?>
+ <Function><?char 13?>
+ <TypeClass>DateTime</TypeClass><?char 13?>
+ <FunctionType>DateAdd</FunctionType><?char 13?>
+ <ReturnType>DateTime</ReturnType><?char 13?>
+ <Count>3</Count><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>String</TypeClass><?char 13?>
+ <ObjType>System.String</ObjType><?char 13?>
+ <Value>day</Value><?char 13?>
+ </Constant><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <ObjType>System.Int32</ObjType><?char 13?>
+ <Value>-1</Value><?char 13?>
+ </Constant><?char 13?>
+ <Function><?char 13?>
+ <TypeClass>DateTime</TypeClass><?char 13?>
+ <FunctionType>GetDate</FunctionType><?char 13?>
+ <ReturnType>DateTime</ReturnType><?char 13?>
+ <Count>0</Count><?char 13?>
+ </Function><?char 13?>
+ </Function><?char 13?>
+ </Operator>
+
+ Safe Last Backup Date
+ Confirms that the database was backed up within the last day.
+ IDatabaseMaintenanceFacet
+
+
+
+
+
+
+ /PolicyStore/PolicyCategory/Microsoft Best Practices_b Maintenance
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+ Microsoft Best Practices: Maintenance
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Last Successful Backup Date__ObjectSet/TargetSet/Server_/Database
+
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Last Successful Backup Date__ObjectSet/TargetSet/Server_/Database/TargetSetLevel/Server_/Database
+
+
+
+
+
+ /PolicyStore/ObjectSet/Last Successful Backup Date__ObjectSet
+
+
+ Server/Database
+ true
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Last Successful Backup Date__ObjectSet/TargetSet/Server_/Database/TargetSetLevel/Server_/Database
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Last Successful Backup Date__ObjectSet/TargetSet/Server_/Database
+
+
+ Server/Database
+ Database
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/samples/features/epm-framework/sample-policies/Public Not Granted Server Permissions.xml b/samples/features/epm-framework/sample-policies/Public Not Granted Server Permissions.xml
new file mode 100644
index 00000000..20de5622
--- /dev/null
+++ b/samples/features/epm-framework/sample-policies/Public Not Granted Server Permissions.xml
@@ -0,0 +1,217 @@
+
+
+
+
+ <_locDefinition xmlns="urn:locstudio">
+ <_locDefault _loc="locNone" />
+ <_locTag _loc="locData">DMF:Name
+ <_locTag _loc="locData">DMF:Description
+ <_locTag _loc="locData">DMF:Condition
+ <_locTag _loc="locData">DMF:ObjectSet
+ <_locTag _loc="locData">DMF:RootCondition
+ <_locTag _loc="locData">DMF:PolicyCategory
+ <_locTag _loc="locData">DMF:HelpText
+
+
+ urn:uuid:96fe1236-abf6-4a57-b54d-e9baab394fd1
+ http://documentcollection/
+
+
+
+
+
+
+ /system/schema/DMF
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ /PolicyStore/Policy/Public Not Granted Server Permissions
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+
+
+ /PolicyStore/Condition/Public Server Role Has No Granted Permissions
+
+
+
+
+ /PolicyStore/ObjectSet/Public Not Granted Server Permissions__ObjectSet
+
+
+
+
+ /PolicyStore/PolicyCategory/Microsoft Best Practices_b Security
+
+
+ Public Not Granted Server Permissions
+ Checks that the server permission is not granted to the Public role.
+ Public Server Role Has No Granted Permissions
+ Public Not Granted Server Permissions_ObjectSet
+ Microsoft Best Practices: Security
+ false
+ None
+
+ http://go.microsoft.com/fwlink/?LinkId=116364
+ 0001-01-01T00:00:00
+ 0001-01-01T00:00:00
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Public Not Granted Server Permissions__ObjectSet
+
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Public Not Granted Server Permissions__ObjectSet/TargetSet/Server
+
+
+
+
+
+ /PolicyStore
+
+
+ Public Not Granted Server Permissions_ObjectSet
+ IServerSecurityFacet
+
+
+
+
+
+
+ /PolicyStore/Condition/Public Server Role Has No Granted Permissions
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>EQ</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Attribute><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <Name>PublicServerRoleIsGrantedPermissions</Name><?char 13?>
+ </Attribute><?char 13?>
+ <Function><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <FunctionType>False</FunctionType><?char 13?>
+ <ReturnType>Bool</ReturnType><?char 13?>
+ <Count>0</Count><?char 13?>
+ </Function><?char 13?>
+ </Operator>
+
+ Public Server Role Has No Granted Permissions
+ Confirms that the Server permission is not granted to the Public role.
+ IServerSecurityFacet
+
+
+
+
+
+
+ /PolicyStore/PolicyCategory/Microsoft Best Practices_b Security
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+ Microsoft Best Practices: Security
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Public Not Granted Server Permissions__ObjectSet/TargetSet/Server
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Public Not Granted Server Permissions__ObjectSet
+
+
+ Server
+ true
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/samples/features/epm-framework/sample-policies/README.md b/samples/features/epm-framework/sample-policies/README.md
new file mode 100644
index 00000000..56ceb8c9
--- /dev/null
+++ b/samples/features/epm-framework/sample-policies/README.md
@@ -0,0 +1,3 @@
+# Policy-Based Management Sample Policies
+
+A set of sample policies is provided, which can be imported for use as rules to be evaluated against the database engine. For more about the best practice rules behind these samples and how to import a policy-based management policy, please see [Policy-Based Management on Microsoft Docs](https://docs.microsoft.com/sql/relational-databases/policy-based-management/monitor-and-enforce-best-practices-by-using-policy-based-management).
diff --git a/samples/features/epm-framework/sample-policies/Read-only Database Recovery Model.xml b/samples/features/epm-framework/sample-policies/Read-only Database Recovery Model.xml
new file mode 100644
index 00000000..16162ee1
--- /dev/null
+++ b/samples/features/epm-framework/sample-policies/Read-only Database Recovery Model.xml
@@ -0,0 +1,436 @@
+
+
+
+
+ <_locDefinition xmlns="urn:locstudio">
+ <_locDefault _loc="locNone" />
+ <_locTag _loc="locData">DMF:Name
+ <_locTag _loc="locData">DMF:Description
+ <_locTag _loc="locData">DMF:Condition
+ <_locTag _loc="locData">DMF:ObjectSet
+ <_locTag _loc="locData">DMF:RootCondition
+ <_locTag _loc="locData">DMF:PolicyCategory
+ <_locTag _loc="locData">DMF:HelpText
+
+
+ urn:uuid:96fe1236-abf6-4a57-b54d-e9baab394fd1
+ http://documentcollection/
+
+
+
+
+
+
+ /system/schema/DMF
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ /PolicyStore/Policy/Read-only Database Recovery Model
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+
+
+ /PolicyStore/Condition/Recovery Model Simple
+
+
+
+
+ /PolicyStore/ObjectSet/Read-only Database Recovery Model__ObjectSet
+
+
+
+
+ /PolicyStore/Condition/Enterprise or Standard Edition
+
+
+
+
+ /PolicyStore/PolicyCategory/Microsoft Best Practices_b Maintenance
+
+
+ Read-only Database Recovery Model
+ Checks whether the recovery model is set to simple for read only databases.
+ Recovery Model Simple
+ Read-only Database Recovery Model_ObjectSet
+ Enterprise or Standard Edition
+ Microsoft Best Practices: Maintenance
+ false
+ None
+
+ http://go.microsoft.com/fwlink/?LinkId=116383
+ 0001-01-01T00:00:00
+ 0001-01-01T00:00:00
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Read-only Database Recovery Model__ObjectSet
+
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Read-only Database Recovery Model__ObjectSet/TargetSet/Server_/Database
+
+
+
+
+
+ /PolicyStore
+
+
+ Read-only Database Recovery Model_ObjectSet
+ IDatabaseMaintenanceFacet
+
+
+
+
+
+
+ /PolicyStore/Condition/Recovery Model Simple
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>EQ</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Attribute><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <Name>RecoveryModel</Name><?char 13?>
+ </Attribute><?char 13?>
+ <Function><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <FunctionType>Enum</FunctionType><?char 13?>
+ <ReturnType>Numeric</ReturnType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>String</TypeClass><?char 13?>
+ <ObjType>System.String</ObjType><?char 13?>
+ <Value>Microsoft.SqlServer.Management.Smo.RecoveryModel</Value><?char 13?>
+ </Constant><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>String</TypeClass><?char 13?>
+ <ObjType>System.String</ObjType><?char 13?>
+ <Value>Simple</Value><?char 13?>
+ </Constant><?char 13?>
+ </Function><?char 13?>
+ </Operator>
+
+ Recovery Model Simple
+ Confirms that the database recovery model is set to simple.
+ IDatabaseMaintenanceFacet
+
+
+
+
+
+
+ /PolicyStore/Condition/Enterprise or Standard Edition
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>OR</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>EQ</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Attribute><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <Name>EngineEdition</Name><?char 13?>
+ </Attribute><?char 13?>
+ <Function><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <FunctionType>Enum</FunctionType><?char 13?>
+ <ReturnType>Numeric</ReturnType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>String</TypeClass><?char 13?>
+ <ObjType>System.String</ObjType><?char 13?>
+ <Value>Microsoft.SqlServer.Management.Smo.Edition</Value><?char 13?>
+ </Constant><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>String</TypeClass><?char 13?>
+ <ObjType>System.String</ObjType><?char 13?>
+ <Value>Standard</Value><?char 13?>
+ </Constant><?char 13?>
+ </Function><?char 13?>
+ </Operator><?char 13?>
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>EQ</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Attribute><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <Name>EngineEdition</Name><?char 13?>
+ </Attribute><?char 13?>
+ <Function><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <FunctionType>Enum</FunctionType><?char 13?>
+ <ReturnType>Numeric</ReturnType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>String</TypeClass><?char 13?>
+ <ObjType>System.String</ObjType><?char 13?>
+ <Value>Microsoft.SqlServer.Management.Smo.Edition</Value><?char 13?>
+ </Constant><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>String</TypeClass><?char 13?>
+ <ObjType>System.String</ObjType><?char 13?>
+ <Value>EnterpriseOrDeveloper</Value><?char 13?>
+ </Constant><?char 13?>
+ </Function><?char 13?>
+ </Operator><?char 13?>
+ </Operator>
+
+ Enterprise or Standard Edition
+ Confirms that the instance of SQL Server is either Enterprise or Standard Edition.
+ Server
+
+
+
+
+
+
+ /PolicyStore/PolicyCategory/Microsoft Best Practices_b Maintenance
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+ Microsoft Best Practices: Maintenance
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Read-only Database Recovery Model__ObjectSet/TargetSet/Server_/Database
+
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Read-only Database Recovery Model__ObjectSet/TargetSet/Server_/Database/TargetSetLevel/Server_/Database
+
+
+
+
+
+ /PolicyStore/ObjectSet/Read-only Database Recovery Model__ObjectSet
+
+
+ Server/Database
+ true
+
+
+
+
+
+
+ /PolicyStore/Condition/Read-only
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>AND</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>AND</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>EQ</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Attribute><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <Name>ReadOnly</Name><?char 13?>
+ </Attribute><?char 13?>
+ <Function><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <FunctionType>True</FunctionType><?char 13?>
+ <ReturnType>Bool</ReturnType><?char 13?>
+ <Count>0</Count><?char 13?>
+ </Function><?char 13?>
+ </Operator><?char 13?>
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>EQ</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Attribute><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <Name>Status</Name><?char 13?>
+ </Attribute><?char 13?>
+ <Function><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <FunctionType>Enum</FunctionType><?char 13?>
+ <ReturnType>Numeric</ReturnType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>String</TypeClass><?char 13?>
+ <ObjType>System.String</ObjType><?char 13?>
+ <Value>Microsoft.SqlServer.Management.Smo.DatabaseStatus</Value><?char 13?>
+ </Constant><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>String</TypeClass><?char 13?>
+ <ObjType>System.String</ObjType><?char 13?>
+ <Value>Normal</Value><?char 13?>
+ </Constant><?char 13?>
+ </Function><?char 13?>
+ </Operator><?char 13?>
+ </Operator><?char 13?>
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>EQ</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Attribute><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <Name>IsSystemObject</Name><?char 13?>
+ </Attribute><?char 13?>
+ <Function><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <FunctionType>False</FunctionType><?char 13?>
+ <ReturnType>Bool</ReturnType><?char 13?>
+ <Count>0</Count><?char 13?>
+ </Function><?char 13?>
+ </Operator><?char 13?>
+ </Operator>
+
+ Read-only
+ Confirms that the database ReadOnly property is equal to true.
+ Database
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Read-only Database Recovery Model__ObjectSet/TargetSet/Server_/Database/TargetSetLevel/Server_/Database
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Read-only Database Recovery Model__ObjectSet/TargetSet/Server_/Database
+
+
+
+
+ /PolicyStore/Condition/Read-only
+
+
+ Server/Database
+ Database
+ Read-only
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/samples/features/epm-framework/sample-policies/SQL Server 32-bit Affinity Mask Overlap.xml b/samples/features/epm-framework/sample-policies/SQL Server 32-bit Affinity Mask Overlap.xml
new file mode 100644
index 00000000..8093c4f5
--- /dev/null
+++ b/samples/features/epm-framework/sample-policies/SQL Server 32-bit Affinity Mask Overlap.xml
@@ -0,0 +1,268 @@
+
+
+
+
+ <_locDefinition xmlns="urn:locstudio">
+ <_locDefault _loc="locNone" />
+ <_locTag _loc="locData">DMF:Name
+ <_locTag _loc="locData">DMF:Description
+ <_locTag _loc="locData">DMF:Condition
+ <_locTag _loc="locData">DMF:ObjectSet
+ <_locTag _loc="locData">DMF:RootCondition
+ <_locTag _loc="locData">DMF:PolicyCategory
+ <_locTag _loc="locData">DMF:HelpText
+
+
+ urn:uuid:96fe1236-abf6-4a57-b54d-e9baab394fd1
+ http://documentcollection/
+
+
+
+
+
+
+ /system/schema/DMF
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ /PolicyStore/Policy/SQL Server 32-bit Affinity Mask Overlap
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+
+
+ /PolicyStore/Condition/32-bit Affinity Mask Overlapped
+
+
+
+
+ /PolicyStore/ObjectSet/SQL Server 32-bit Affinity Mask Overlap__ObjectSet
+
+
+
+
+ /PolicyStore/Condition/32-bit Configuration
+
+
+
+
+ /PolicyStore/PolicyCategory/Microsoft Best Practices_b Performance
+
+
+ SQL Server 32-bit Affinity Mask Overlap
+ Checks an instance of SQL Server having processors that are assigned with both the affinity mask and the affinity I/O mask options. On a computer that has more than one processor, the affinity mask and the affinity I/O mask options are used to designate which CPUs are used by SQL Server. Enabling a CPU with both the affinity mask and the affinity I/O mask can slow performance by forcing the processor to be overused.
+ 32-bit Affinity Mask Overlapped
+ SQL Server 32-bit Affinity Mask Overlap_ObjectSet
+ 32-bit Configuration
+ Microsoft Best Practices: Performance
+ false
+ None
+
+ http://go.microsoft.com/fwlink/?LinkId=116381
+ 0001-01-01T00:00:00
+ 0001-01-01T00:00:00
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/SQL Server 32-bit Affinity Mask Overlap__ObjectSet
+
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/SQL Server 32-bit Affinity Mask Overlap__ObjectSet/TargetSet/Server
+
+
+
+
+
+ /PolicyStore
+
+
+ SQL Server 32-bit Affinity Mask Overlap_ObjectSet
+ IServerPerformanceFacet
+
+
+
+
+
+
+ /PolicyStore/Condition/32-bit Affinity Mask Overlapped
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>EQ</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Function><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <FunctionType>BitwiseAnd</FunctionType><?char 13?>
+ <ReturnType>Numeric</ReturnType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Attribute><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <Name>AffinityMask</Name><?char 13?>
+ </Attribute><?char 13?>
+ <Attribute><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <Name>AffinityIOMask</Name><?char 13?>
+ </Attribute><?char 13?>
+ </Function><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <ObjType>System.Int32</ObjType><?char 13?>
+ <Value>0</Value><?char 13?>
+ </Constant><?char 13?>
+ </Operator>
+
+ 32-bit Affinity Mask Overlapped
+ Confirms that the same CPUs are not enabled with both the affinity mask option and the affinity I/O mask option, which can slow performance.
+ IServerPerformanceFacet
+
+
+
+
+
+
+ /PolicyStore/Condition/32-bit Configuration
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>EQ</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Attribute><?char 13?>
+ <TypeClass>String</TypeClass><?char 13?>
+ <Name>Platform</Name><?char 13?>
+ </Attribute><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>String</TypeClass><?char 13?>
+ <ObjType>System.String</ObjType><?char 13?>
+ <Value>NT INTEL X86</Value><?char 13?>
+ </Constant><?char 13?>
+ </Operator>
+
+ 32-bit Configuration
+ Confirms that the version of SQL Server uses 32-bit configuration.
+ Server
+
+
+
+
+
+
+ /PolicyStore/PolicyCategory/Microsoft Best Practices_b Performance
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+ Microsoft Best Practices: Performance
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/SQL Server 32-bit Affinity Mask Overlap__ObjectSet/TargetSet/Server
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/SQL Server 32-bit Affinity Mask Overlap__ObjectSet
+
+
+ Server
+ true
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/samples/features/epm-framework/sample-policies/SQL Server 64-bit Affinity Mask Overlap.xml b/samples/features/epm-framework/sample-policies/SQL Server 64-bit Affinity Mask Overlap.xml
new file mode 100644
index 00000000..a277f6c9
--- /dev/null
+++ b/samples/features/epm-framework/sample-policies/SQL Server 64-bit Affinity Mask Overlap.xml
@@ -0,0 +1,316 @@
+
+
+
+
+ <_locDefinition xmlns="urn:locstudio">
+ <_locDefault _loc="locNone" />
+ <_locTag _loc="locData">DMF:Name
+ <_locTag _loc="locData">DMF:Description
+ <_locTag _loc="locData">DMF:Condition
+ <_locTag _loc="locData">DMF:ObjectSet
+ <_locTag _loc="locData">DMF:RootCondition
+ <_locTag _loc="locData">DMF:PolicyCategory
+ <_locTag _loc="locData">DMF:HelpText
+
+
+ urn:uuid:96fe1236-abf6-4a57-b54d-e9baab394fd1
+ http://documentcollection/
+
+
+
+
+
+
+ /system/schema/DMF
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ /PolicyStore/Policy/SQL Server 64-bit Affinity Mask Overlap
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+
+
+ /PolicyStore/Condition/64-bit Affinity Mask Overlapped
+
+
+
+
+ /PolicyStore/ObjectSet/SQL Server 64-bit Affinity Mask Overlap__ObjectSet
+
+
+
+
+ /PolicyStore/Condition/64-bit Configuration
+
+
+
+
+ /PolicyStore/PolicyCategory/Microsoft Best Practices_b Performance
+
+
+ SQL Server 64-bit Affinity Mask Overlap
+ Checks an instance of SQL Server having processors that are assigned with both the affinity64 mask and the affinity64 I/O mask options. On a computer that has more than one processor, the affinity64 mask and the affinity64 I/O mask options are used to designate which CPUs are used by SQL Server. Enabling a CPU with both the affinity64 mask and the affinity64 I/O mask can slow performance by forcing the processor to be overused.
+ 64-bit Affinity Mask Overlapped
+ SQL Server 64-bit Affinity Mask Overlap_ObjectSet
+ 64-bit Configuration
+ Microsoft Best Practices: Performance
+ false
+ None
+
+ http://go.microsoft.com/fwlink/?LinkId=116381
+ 0001-01-01T00:00:00
+ 0001-01-01T00:00:00
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/SQL Server 64-bit Affinity Mask Overlap__ObjectSet
+
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/SQL Server 64-bit Affinity Mask Overlap__ObjectSet/TargetSet/Server
+
+
+
+
+
+ /PolicyStore
+
+
+ SQL Server 64-bit Affinity Mask Overlap_ObjectSet
+ IServerPerformanceFacet
+
+
+
+
+
+
+ /PolicyStore/Condition/64-bit Affinity Mask Overlapped
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>AND</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>EQ</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Function><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <FunctionType>BitwiseAnd</FunctionType><?char 13?>
+ <ReturnType>Numeric</ReturnType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Attribute><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <Name>AffinityMask</Name><?char 13?>
+ </Attribute><?char 13?>
+ <Attribute><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <Name>AffinityIOMask</Name><?char 13?>
+ </Attribute><?char 13?>
+ </Function><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <ObjType>System.Int32</ObjType><?char 13?>
+ <Value>0</Value><?char 13?>
+ </Constant><?char 13?>
+ </Operator><?char 13?>
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>EQ</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Function><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <FunctionType>BitwiseAnd</FunctionType><?char 13?>
+ <ReturnType>Numeric</ReturnType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Attribute><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <Name>Affinity64Mask</Name><?char 13?>
+ </Attribute><?char 13?>
+ <Attribute><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <Name>Affinity64IOMask</Name><?char 13?>
+ </Attribute><?char 13?>
+ </Function><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <ObjType>System.Int32</ObjType><?char 13?>
+ <Value>0</Value><?char 13?>
+ </Constant><?char 13?>
+ </Operator><?char 13?>
+ </Operator>
+
+ 64-bit Affinity Mask Overlapped
+ Confirms that the same CPUs are not enabled with both the affinity mask option and the affinity I/O mask option, which can slow performance.
+ IServerPerformanceFacet
+
+
+
+
+
+
+ /PolicyStore/Condition/64-bit Configuration
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>OR</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>EQ</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Attribute><?char 13?>
+ <TypeClass>String</TypeClass><?char 13?>
+ <Name>Platform</Name><?char 13?>
+ </Attribute><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>String</TypeClass><?char 13?>
+ <ObjType>System.String</ObjType><?char 13?>
+ <Value>NT AMD64</Value><?char 13?>
+ </Constant><?char 13?>
+ </Operator><?char 13?>
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>EQ</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Attribute><?char 13?>
+ <TypeClass>String</TypeClass><?char 13?>
+ <Name>Platform</Name><?char 13?>
+ </Attribute><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>String</TypeClass><?char 13?>
+ <ObjType>System.String</ObjType><?char 13?>
+ <Value>NT INTEL IA64</Value><?char 13?>
+ </Constant><?char 13?>
+ </Operator><?char 13?>
+ </Operator>
+
+ 64-bit Configuration
+ Confirms that the version of SQL Server uses 64-bit configuration.
+ Server
+
+
+
+
+
+
+ /PolicyStore/PolicyCategory/Microsoft Best Practices_b Performance
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+ Microsoft Best Practices: Performance
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/SQL Server 64-bit Affinity Mask Overlap__ObjectSet/TargetSet/Server
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/SQL Server 64-bit Affinity Mask Overlap__ObjectSet
+
+
+ Server
+ true
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/samples/features/epm-framework/sample-policies/SQL Server Affinity Mask.xml b/samples/features/epm-framework/sample-policies/SQL Server Affinity Mask.xml
new file mode 100644
index 00000000..7cacba4e
--- /dev/null
+++ b/samples/features/epm-framework/sample-policies/SQL Server Affinity Mask.xml
@@ -0,0 +1,220 @@
+
+
+
+
+ <_locDefinition xmlns="urn:locstudio">
+ <_locDefault _loc="locNone" />
+ <_locTag _loc="locData">DMF:Name
+ <_locTag _loc="locData">DMF:Description
+ <_locTag _loc="locData">DMF:Condition
+ <_locTag _loc="locData">DMF:ObjectSet
+ <_locTag _loc="locData">DMF:RootCondition
+ <_locTag _loc="locData">DMF:PolicyCategory
+ <_locTag _loc="locData">DMF:HelpText
+
+
+ urn:uuid:96fe1236-abf6-4a57-b54d-e9baab394fd1
+ http://documentcollection/
+
+
+
+
+
+
+ /system/schema/DMF
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ /PolicyStore/Policy/SQL Server Affinity Mask
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+
+
+ /PolicyStore/Condition/Affinity Mask Default
+
+
+
+
+ /PolicyStore/ObjectSet/SQL Server Affinity Mask__ObjectSet
+
+
+
+
+ /PolicyStore/PolicyCategory/Microsoft Best Practices_b Performance
+
+
+ SQL Server Affinity Mask
+
+ Checks an instance of SQL Server for setting, affinity mask to its default value 0, since in most cases, the Microsoft Windows 2000 or Windows Server 2003 default affinity provides the best performance. <?char 13?>
+ <?char 13?>
+ Confirms whether the setting affinity mask of server is set to zero.<?char 13?>
+
+ Affinity Mask Default
+ SQL Server Affinity Mask_ObjectSet
+ Microsoft Best Practices: Performance
+ false
+ None
+
+ http://go.microsoft.com/fwlink/?LinkId=116357
+ 0001-01-01T00:00:00
+ 0001-01-01T00:00:00
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/SQL Server Affinity Mask__ObjectSet
+
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/SQL Server Affinity Mask__ObjectSet/TargetSet/Server
+
+
+
+
+
+ /PolicyStore
+
+
+ SQL Server Affinity Mask_ObjectSet
+ IServerPerformanceFacet
+
+
+
+
+
+
+ /PolicyStore/Condition/Affinity Mask Default
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>EQ</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Attribute><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <Name>AffinityMask</Name><?char 13?>
+ </Attribute><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <ObjType>System.Int32</ObjType><?char 13?>
+ <Value>0</Value><?char 13?>
+ </Constant><?char 13?>
+ </Operator>
+
+ Affinity Mask Default
+ Confirms whether the setting affinity mask of server is set to zero.
+ IServerPerformanceFacet
+
+
+
+
+
+
+ /PolicyStore/PolicyCategory/Microsoft Best Practices_b Performance
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+ Microsoft Best Practices: Performance
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/SQL Server Affinity Mask__ObjectSet/TargetSet/Server
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/SQL Server Affinity Mask__ObjectSet
+
+
+ Server
+ true
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/samples/features/epm-framework/sample-policies/SQL Server Blocked Process Threshold.xml b/samples/features/epm-framework/sample-policies/SQL Server Blocked Process Threshold.xml
new file mode 100644
index 00000000..406b01f6
--- /dev/null
+++ b/samples/features/epm-framework/sample-policies/SQL Server Blocked Process Threshold.xml
@@ -0,0 +1,277 @@
+
+
+
+
+ <_locDefinition xmlns="urn:locstudio">
+ <_locDefault _loc="locNone" />
+ <_locTag _loc="locData">DMF:Name
+ <_locTag _loc="locData">DMF:Description
+ <_locTag _loc="locData">DMF:Condition
+ <_locTag _loc="locData">DMF:ObjectSet
+ <_locTag _loc="locData">DMF:RootCondition
+ <_locTag _loc="locData">DMF:PolicyCategory
+ <_locTag _loc="locData">DMF:HelpText
+
+
+ urn:uuid:96fe1236-abf6-4a57-b54d-e9baab394fd1
+ http://documentcollection/
+
+
+
+
+
+
+ /system/schema/DMF
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ /PolicyStore/Policy/SQL Server Blocked Process Threshold
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+
+
+ /PolicyStore/Condition/Blocked Process Threshold Optimized
+
+
+
+
+ /PolicyStore/ObjectSet/SQL Server Blocked Process Threshold__ObjectSet
+
+
+
+
+ /PolicyStore/Condition/SQL Server 2005 or a Later Version
+
+
+
+
+ /PolicyStore/PolicyCategory/Microsoft Best Practices_b Performance
+
+
+ SQL Server Blocked Process Threshold
+ Checks whether the blocked process threshold option is set lower than 5 and is not disabled (0). Setting the blocked process threshold option to a value from 1 to 4 can cause the deadlock monitor to run constantly. Values 1 to 4 should only be used for troubleshooting and never long term or in a production environment without the assistance of Microsoft Customer Service and Support.
+ Blocked Process Threshold Optimized
+ SQL Server Blocked Process Threshold_ObjectSet
+ SQL Server 2005 or a Later Version
+ Microsoft Best Practices: Performance
+ false
+ None
+
+ http://go.microsoft.com/fwlink/?LinkId=116356
+ 0001-01-01T00:00:00
+ 0001-01-01T00:00:00
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/SQL Server Blocked Process Threshold__ObjectSet
+
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/SQL Server Blocked Process Threshold__ObjectSet/TargetSet/Server
+
+
+
+
+
+ /PolicyStore
+
+
+ SQL Server Blocked Process Threshold_ObjectSet
+ IServerPerformanceFacet
+
+
+
+
+
+
+ /PolicyStore/Condition/Blocked Process Threshold Optimized
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>OR</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>GE</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Attribute><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <Name>BlockedProcessThreshold</Name><?char 13?>
+ </Attribute><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <ObjType>System.Int32</ObjType><?char 13?>
+ <Value>5</Value><?char 13?>
+ </Constant><?char 13?>
+ </Operator><?char 13?>
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>EQ</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Attribute><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <Name>BlockedProcessThreshold</Name><?char 13?>
+ </Attribute><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <ObjType>System.Int32</ObjType><?char 13?>
+ <Value>0</Value><?char 13?>
+ </Constant><?char 13?>
+ </Operator><?char 13?>
+ </Operator>
+
+ Blocked Process Threshold Optimized
+ Confirms that the blocked process threshold property is set higher than 4, or is disabled (0).
+ IServerPerformanceFacet
+
+
+
+
+
+
+ /PolicyStore/Condition/SQL Server 2005 or a Later Version
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>GE</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Attribute><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <Name>VersionMajor</Name><?char 13?>
+ </Attribute><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <ObjType>System.Int32</ObjType><?char 13?>
+ <Value>9</Value><?char 13?>
+ </Constant><?char 13?>
+ </Operator>
+
+ SQL Server 2005 or a Later Version
+ Confirms that the version of SQL Server is 2005 or a later version.
+ Server
+
+
+
+
+
+
+ /PolicyStore/PolicyCategory/Microsoft Best Practices_b Performance
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+ Microsoft Best Practices: Performance
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/SQL Server Blocked Process Threshold__ObjectSet/TargetSet/Server
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/SQL Server Blocked Process Threshold__ObjectSet
+
+
+ Server
+ true
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/samples/features/epm-framework/sample-policies/SQL Server Default Trace.xml b/samples/features/epm-framework/sample-policies/SQL Server Default Trace.xml
new file mode 100644
index 00000000..574f8b83
--- /dev/null
+++ b/samples/features/epm-framework/sample-policies/SQL Server Default Trace.xml
@@ -0,0 +1,259 @@
+
+
+
+
+ <_locDefinition xmlns="urn:locstudio">
+ <_locDefault _loc="locNone" />
+ <_locTag _loc="locData">DMF:Name
+ <_locTag _loc="locData">DMF:Description
+ <_locTag _loc="locData">DMF:Condition
+ <_locTag _loc="locData">DMF:ObjectSet
+ <_locTag _loc="locData">DMF:RootCondition
+ <_locTag _loc="locData">DMF:PolicyCategory
+ <_locTag _loc="locData">DMF:HelpText
+
+
+ urn:uuid:96fe1236-abf6-4a57-b54d-e9baab394fd1
+ http://documentcollection/
+
+
+
+
+
+
+ /system/schema/DMF
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ /PolicyStore/Policy/SQL Server Default Trace
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+
+
+ /PolicyStore/Condition/Default Trace Enabled
+
+
+
+
+ /PolicyStore/ObjectSet/SQL Server Default Trace__ObjectSet
+
+
+
+
+ /PolicyStore/Condition/SQL Server 2005 or a Later Version
+
+
+
+
+ /PolicyStore/PolicyCategory/Microsoft Best Practices_b Audit
+
+
+ SQL Server Default Trace
+ Checks whether default trace is turned on to collect information about configuration and DDL changes to the instance of SQL Server. This information can be helpful for customers and Microsoft Technical Support when troubleshooting issues with the Database Engine.
+ Default Trace Enabled
+ SQL Server Default Trace_ObjectSet
+ SQL Server 2005 or a Later Version
+ Microsoft Best Practices: Audit
+ false
+ None
+
+ http://go.microsoft.com/fwlink/?LinkId=116384
+ 0001-01-01T00:00:00
+ 0001-01-01T00:00:00
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/SQL Server Default Trace__ObjectSet
+
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/SQL Server Default Trace__ObjectSet/TargetSet/Server
+
+
+
+
+
+ /PolicyStore
+
+
+ SQL Server Default Trace_ObjectSet
+ IServerAuditFacet
+
+
+
+
+
+
+ /PolicyStore/Condition/Default Trace Enabled
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>EQ</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Attribute><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <Name>DefaultTraceEnabled</Name><?char 13?>
+ </Attribute><?char 13?>
+ <Function><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <FunctionType>True</FunctionType><?char 13?>
+ <ReturnType>Bool</ReturnType><?char 13?>
+ <Count>0</Count><?char 13?>
+ </Function><?char 13?>
+ </Operator>
+
+ Default Trace Enabled
+ Confirms that the default trace enabled options is turned on.
+ IServerAuditFacet
+
+
+
+
+
+
+ /PolicyStore/Condition/SQL Server 2005 or a Later Version
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>GE</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Attribute><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <Name>VersionMajor</Name><?char 13?>
+ </Attribute><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <ObjType>System.Int32</ObjType><?char 13?>
+ <Value>9</Value><?char 13?>
+ </Constant><?char 13?>
+ </Operator>
+
+ SQL Server 2005 or a Later Version
+ Confirms that the version of SQL Server is 2005 or a later version.
+ Server
+
+
+
+
+
+
+ /PolicyStore/PolicyCategory/Microsoft Best Practices_b Audit
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+ Microsoft Best Practices: Audit
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/SQL Server Default Trace__ObjectSet/TargetSet/Server
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/SQL Server Default Trace__ObjectSet
+
+
+ Server
+ true
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/samples/features/epm-framework/sample-policies/SQL Server Dynamic Locks.xml b/samples/features/epm-framework/sample-policies/SQL Server Dynamic Locks.xml
new file mode 100644
index 00000000..1f352b3a
--- /dev/null
+++ b/samples/features/epm-framework/sample-policies/SQL Server Dynamic Locks.xml
@@ -0,0 +1,258 @@
+
+
+
+
+ <_locDefinition xmlns="urn:locstudio">
+ <_locDefault _loc="locNone" />
+ <_locTag _loc="locData">DMF:Name
+ <_locTag _loc="locData">DMF:Description
+ <_locTag _loc="locData">DMF:Condition
+ <_locTag _loc="locData">DMF:ObjectSet
+ <_locTag _loc="locData">DMF:RootCondition
+ <_locTag _loc="locData">DMF:PolicyCategory
+ <_locTag _loc="locData">DMF:HelpText
+
+
+ urn:uuid:96fe1236-abf6-4a57-b54d-e9baab394fd1
+ http://documentcollection/
+
+
+
+
+
+
+ /system/schema/DMF
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ /PolicyStore/Policy/SQL Server Dynamic Locks
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+
+
+ /PolicyStore/Condition/Auto-configured Dynamic Locks
+
+
+
+
+ /PolicyStore/ObjectSet/SQL Server Dynamic Locks__ObjectSet
+
+
+
+
+ /PolicyStore/Condition/SQL Server 2005 or a Later Version
+
+
+
+
+ /PolicyStore/PolicyCategory/Microsoft Best Practices_b Performance
+
+
+ SQL Server Dynamic Locks
+ Checks whether the value of the locks option is the default setting of 0. This enables the Database Engine to allocate and deallocate lock structures dynamically, based on changing system requirements. If locks is nonzero, batch jobs will stop, and an out of locks error message will be generated when the value specified is exceeded.
+ Auto-configured Dynamic Locks
+ SQL Server Dynamic Locks_ObjectSet
+ SQL Server 2005 or a Later Version
+ Microsoft Best Practices: Performance
+ false
+ None
+
+ http://go.microsoft.com/fwlink/?LinkId=116358
+ 0001-01-01T00:00:00
+ 0001-01-01T00:00:00
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/SQL Server Dynamic Locks__ObjectSet
+
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/SQL Server Dynamic Locks__ObjectSet/TargetSet/Server
+
+
+
+
+
+ /PolicyStore
+
+
+ SQL Server Dynamic Locks_ObjectSet
+ IServerPerformanceFacet
+
+
+
+
+
+
+ /PolicyStore/Condition/Auto-configured Dynamic Locks
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>EQ</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Attribute><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <Name>DynamicLocks</Name><?char 13?>
+ </Attribute><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <ObjType>System.Int32</ObjType><?char 13?>
+ <Value>0</Value><?char 13?>
+ </Constant><?char 13?>
+ </Operator>
+
+ Auto-configured Dynamic Locks
+ Confirms that the locks option is set to zero. This is the recommended default value.
+ IServerPerformanceFacet
+
+
+
+
+
+
+ /PolicyStore/Condition/SQL Server 2005 or a Later Version
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>GE</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Attribute><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <Name>VersionMajor</Name><?char 13?>
+ </Attribute><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <ObjType>System.Int32</ObjType><?char 13?>
+ <Value>9</Value><?char 13?>
+ </Constant><?char 13?>
+ </Operator>
+
+ SQL Server 2005 or a Later Version
+ Confirms that the version of SQL Server is 2005 or a later version.
+ Server
+
+
+
+
+
+
+ /PolicyStore/PolicyCategory/Microsoft Best Practices_b Performance
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+ Microsoft Best Practices: Performance
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/SQL Server Dynamic Locks__ObjectSet/TargetSet/Server
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/SQL Server Dynamic Locks__ObjectSet
+
+
+ Server
+ true
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/samples/features/epm-framework/sample-policies/SQL Server I_O Affinity Mask For Non-enterprise SQL Servers.xml b/samples/features/epm-framework/sample-policies/SQL Server I_O Affinity Mask For Non-enterprise SQL Servers.xml
new file mode 100644
index 00000000..22b0c193
--- /dev/null
+++ b/samples/features/epm-framework/sample-policies/SQL Server I_O Affinity Mask For Non-enterprise SQL Servers.xml
@@ -0,0 +1,269 @@
+
+
+
+
+ <_locDefinition xmlns="urn:locstudio">
+ <_locDefault _loc="locNone" />
+ <_locTag _loc="locData">DMF:Name
+ <_locTag _loc="locData">DMF:Description
+ <_locTag _loc="locData">DMF:Condition
+ <_locTag _loc="locData">DMF:ObjectSet
+ <_locTag _loc="locData">DMF:RootCondition
+ <_locTag _loc="locData">DMF:PolicyCategory
+ <_locTag _loc="locData">DMF:HelpText
+
+
+ urn:uuid:96fe1236-abf6-4a57-b54d-e9baab394fd1
+ http://documentcollection/
+
+
+
+
+
+
+ /system/schema/DMF
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ /PolicyStore/Policy/SQL Server I_/O Affinity Mask For Non-enterprise SQL Servers
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+
+
+ /PolicyStore/Condition/I_/O Affinity Mask Disabled
+
+
+
+
+ /PolicyStore/ObjectSet/SQL Server I_/O Affinity Mask For Non-enterprise SQL Servers__ObjectSet
+
+
+
+
+ /PolicyStore/Condition/Not Enterprise Edition
+
+
+
+
+ /PolicyStore/PolicyCategory/Microsoft Best Practices_b Performance
+
+
+ SQL Server I/O Affinity Mask For Non-enterprise SQL Servers
+ Checks that the I/O Affinity Mask is disabled for non-enterprise editions.
+ I/O Affinity Mask Disabled
+ SQL Server I/O Affinity Mask For Non-enterprise SQL Servers_ObjectSet
+ Not Enterprise Edition
+ Microsoft Best Practices: Performance
+ false
+ None
+
+ http://go.microsoft.com/fwlink/?LinkId=116381
+ 0001-01-01T00:00:00
+ 0001-01-01T00:00:00
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/SQL Server I_/O Affinity Mask For Non-enterprise SQL Servers__ObjectSet
+
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/SQL Server I_/O Affinity Mask For Non-enterprise SQL Servers__ObjectSet/TargetSet/Server
+
+
+
+
+
+ /PolicyStore
+
+
+ SQL Server I/O Affinity Mask For Non-enterprise SQL Servers_ObjectSet
+ IServerConfigurationFacet
+
+
+
+
+
+
+ /PolicyStore/Condition/I_/O Affinity Mask Disabled
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>EQ</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Attribute><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <Name>AffinityIOMask</Name><?char 13?>
+ </Attribute><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <ObjType>System.Int32</ObjType><?char 13?>
+ <Value>0</Value><?char 13?>
+ </Constant><?char 13?>
+ </Operator>
+
+ I/O Affinity Mask Disabled
+ Confirms that the server I/O affinity mask property is disabled.
+ IServerConfigurationFacet
+
+
+
+
+
+
+ /PolicyStore/Condition/Not Enterprise Edition
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>NE</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Attribute><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <Name>EngineEdition</Name><?char 13?>
+ </Attribute><?char 13?>
+ <Function><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <FunctionType>Enum</FunctionType><?char 13?>
+ <ReturnType>Numeric</ReturnType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>String</TypeClass><?char 13?>
+ <ObjType>System.String</ObjType><?char 13?>
+ <Value>Microsoft.SqlServer.Management.Smo.Edition</Value><?char 13?>
+ </Constant><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>String</TypeClass><?char 13?>
+ <ObjType>System.String</ObjType><?char 13?>
+ <Value>EnterpriseOrDeveloper</Value><?char 13?>
+ </Constant><?char 13?>
+ </Function><?char 13?>
+ </Operator>
+
+ Not Enterprise Edition
+ Confirms that the instance of SQL Server is not Enterprise Edition.
+ Server
+
+
+
+
+
+
+ /PolicyStore/PolicyCategory/Microsoft Best Practices_b Performance
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+ Microsoft Best Practices: Performance
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/SQL Server I_/O Affinity Mask For Non-enterprise SQL Servers__ObjectSet/TargetSet/Server
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/SQL Server I_/O Affinity Mask For Non-enterprise SQL Servers__ObjectSet
+
+
+ Server
+ true
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/samples/features/epm-framework/sample-policies/SQL Server Lightweight Pooling.xml b/samples/features/epm-framework/sample-policies/SQL Server Lightweight Pooling.xml
new file mode 100644
index 00000000..02cc4718
--- /dev/null
+++ b/samples/features/epm-framework/sample-policies/SQL Server Lightweight Pooling.xml
@@ -0,0 +1,217 @@
+
+
+
+
+ <_locDefinition xmlns="urn:locstudio">
+ <_locDefault _loc="locNone" />
+ <_locTag _loc="locData">DMF:Name
+ <_locTag _loc="locData">DMF:Description
+ <_locTag _loc="locData">DMF:Condition
+ <_locTag _loc="locData">DMF:ObjectSet
+ <_locTag _loc="locData">DMF:RootCondition
+ <_locTag _loc="locData">DMF:PolicyCategory
+ <_locTag _loc="locData">DMF:HelpText
+
+
+ urn:uuid:96fe1236-abf6-4a57-b54d-e9baab394fd1
+ http://documentcollection/
+
+
+
+
+
+
+ /system/schema/DMF
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ /PolicyStore/Policy/SQL Server Lightweight Pooling
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+
+
+ /PolicyStore/Condition/Lightweight Pooling Disabled
+
+
+
+
+ /PolicyStore/ObjectSet/SQL Server Lightweight Pooling__ObjectSet
+
+
+
+
+ /PolicyStore/PolicyCategory/Microsoft Best Practices_b Performance
+
+
+ SQL Server Lightweight Pooling
+ Checks whether lightweight pooling is disabled on the server. Setting lightweightpooling to 1 causes SQL Server to switch to fiber mode scheduling. Fiber mode is intended for certain situations when the context switching of the UMS workers are the critical bottleneck in performance. Because this situation is unusual, fiber mode rarely enhances performance or scalability on the typical system.
+ Lightweight Pooling Disabled
+ SQL Server Lightweight Pooling_ObjectSet
+ Microsoft Best Practices: Performance
+ false
+ None
+
+ http://go.microsoft.com/fwlink/?LinkId=116350
+ 0001-01-01T00:00:00
+ 0001-01-01T00:00:00
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/SQL Server Lightweight Pooling__ObjectSet
+
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/SQL Server Lightweight Pooling__ObjectSet/TargetSet/Server
+
+
+
+
+
+ /PolicyStore
+
+
+ SQL Server Lightweight Pooling_ObjectSet
+ IServerPerformanceFacet
+
+
+
+
+
+
+ /PolicyStore/Condition/Lightweight Pooling Disabled
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>EQ</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Attribute><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <Name>LightweightPoolingEnabled</Name><?char 13?>
+ </Attribute><?char 13?>
+ <Function><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <FunctionType>False</FunctionType><?char 13?>
+ <ReturnType>Bool</ReturnType><?char 13?>
+ <Count>0</Count><?char 13?>
+ </Function><?char 13?>
+ </Operator>
+
+ Lightweight Pooling Disabled
+ Confirms that lightweight pooling is disabled on the server.
+ IServerPerformanceFacet
+
+
+
+
+
+
+ /PolicyStore/PolicyCategory/Microsoft Best Practices_b Performance
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+ Microsoft Best Practices: Performance
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/SQL Server Lightweight Pooling__ObjectSet/TargetSet/Server
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/SQL Server Lightweight Pooling__ObjectSet
+
+
+ Server
+ true
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/samples/features/epm-framework/sample-policies/SQL Server Login Mode.xml b/samples/features/epm-framework/sample-policies/SQL Server Login Mode.xml
new file mode 100644
index 00000000..a16c61c8
--- /dev/null
+++ b/samples/features/epm-framework/sample-policies/SQL Server Login Mode.xml
@@ -0,0 +1,216 @@
+
+
+
+
+ <_locDefinition xmlns="urn:locstudio">
+ <_locDefault _loc="locNone" />
+ <_locTag _loc="locData">DMF:Name
+ <_locTag _loc="locData">DMF:Description
+ <_locTag _loc="locData">DMF:Condition
+ <_locTag _loc="locData">DMF:ObjectSet
+ <_locTag _loc="locData">DMF:RootCondition
+ <_locTag _loc="locData">DMF:PolicyCategory
+ <_locTag _loc="locData">DMF:HelpText
+
+
+ urn:uuid:96fe1236-abf6-4a57-b54d-e9baab394fd1
+ http://documentcollection/
+
+
+
+
+
+
+ /system/schema/DMF
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ /PolicyStore/Policy/SQL Server Login Mode
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+
+
+ /PolicyStore/Condition/Windows Authentication Mode
+
+
+
+
+ /PolicyStore/ObjectSet/SQL Server Login Mode__ObjectSet
+
+
+
+
+ /PolicyStore/PolicyCategory/Microsoft Best Practices_b Security
+
+
+ SQL Server Login Mode
+ Checks for Windows Authentication. When possible, Microsoft recommends using Windows Authentication. Windows Authentication uses Kerberos security protocol, provides password policy enforcement in terms of complexity validation for strong passwords (applies only to Windows Server 2003 and later), provides support for account lockout, and supports password expiration.
+ Windows Authentication Mode
+ SQL Server Login Mode_ObjectSet
+ Microsoft Best Practices: Security
+ false
+ None
+
+ http://go.microsoft.com/fwlink/?LinkId=116369
+ 0001-01-01T00:00:00
+ 0001-01-01T00:00:00
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/SQL Server Login Mode__ObjectSet
+
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/SQL Server Login Mode__ObjectSet/TargetSet/Server
+
+
+
+
+
+ /PolicyStore
+
+
+ SQL Server Login Mode_ObjectSet
+ IServerSecurityFacet
+
+
+
+
+
+
+ /PolicyStore/Condition/Windows Authentication Mode
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>EQ</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Attribute><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <Name>LoginMode</Name><?char 13?>
+ </Attribute><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <ObjType>Microsoft.SqlServer.Management.Smo.ServerLoginMode</ObjType><?char 13?>
+ <Value>Integrated</Value><?char 13?>
+ </Constant><?char 13?>
+ </Operator>
+
+ Windows Authentication Mode
+ Confirms that the server LoginMode is Windows integrated authentication.
+ IServerSecurityFacet
+
+
+
+
+
+
+ /PolicyStore/PolicyCategory/Microsoft Best Practices_b Security
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+ Microsoft Best Practices: Security
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/SQL Server Login Mode__ObjectSet/TargetSet/Server
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/SQL Server Login Mode__ObjectSet
+
+
+ Server
+ true
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/samples/features/epm-framework/sample-policies/SQL Server Max Degree of Parallelism.xml b/samples/features/epm-framework/sample-policies/SQL Server Max Degree of Parallelism.xml
new file mode 100644
index 00000000..f4a58308
--- /dev/null
+++ b/samples/features/epm-framework/sample-policies/SQL Server Max Degree of Parallelism.xml
@@ -0,0 +1,216 @@
+
+
+
+
+ <_locDefinition xmlns="urn:locstudio">
+ <_locDefault _loc="locNone" />
+ <_locTag _loc="locData">DMF:Name
+ <_locTag _loc="locData">DMF:Description
+ <_locTag _loc="locData">DMF:Condition
+ <_locTag _loc="locData">DMF:ObjectSet
+ <_locTag _loc="locData">DMF:RootCondition
+ <_locTag _loc="locData">DMF:PolicyCategory
+ <_locTag _loc="locData">DMF:HelpText
+
+
+ urn:uuid:96fe1236-abf6-4a57-b54d-e9baab394fd1
+ http://documentcollection/
+
+
+
+
+
+
+ /system/schema/DMF
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ /PolicyStore/Policy/SQL Server Max Degree of Parallelism
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+
+
+ /PolicyStore/Condition/Maximum Degree of Parallelism Optimized
+
+
+
+
+ /PolicyStore/ObjectSet/SQL Server Max Degree of Parallelism__ObjectSet
+
+
+
+
+ /PolicyStore/PolicyCategory/Microsoft Best Practices_b Performance
+
+
+ SQL Server Max Degree of Parallelism
+ Checks the max degree of parallelism option for the optimal value to avoid unwanted resource consumption and performance degradation. The recommended value of this option is 8 or less. Setting this option to a larger value often results in unwanted resource consumption and performance degradation.
+ Maximum Degree of Parallelism Optimized
+ SQL Server Max Degree of Parallelism_ObjectSet
+ Microsoft Best Practices: Performance
+ false
+ None
+
+ http://go.microsoft.com/fwlink/?LinkId=116335
+ 0001-01-01T00:00:00
+ 0001-01-01T00:00:00
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/SQL Server Max Degree of Parallelism__ObjectSet
+
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/SQL Server Max Degree of Parallelism__ObjectSet/TargetSet/Server
+
+
+
+
+
+ /PolicyStore
+
+
+ SQL Server Max Degree of Parallelism_ObjectSet
+ IServerPerformanceFacet
+
+
+
+
+
+
+ /PolicyStore/Condition/Maximum Degree of Parallelism Optimized
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>LE</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Attribute><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <Name>MaxDegreeOfParallelism</Name><?char 13?>
+ </Attribute><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <ObjType>System.Int32</ObjType><?char 13?>
+ <Value>8</Value><?char 13?>
+ </Constant><?char 13?>
+ </Operator>
+
+ Maximum Degree of Parallelism Optimized
+ Confirms that the maximum degree of parallelism is less than 8. Eight is optimal.
+ IServerPerformanceFacet
+
+
+
+
+
+
+ /PolicyStore/PolicyCategory/Microsoft Best Practices_b Performance
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+ Microsoft Best Practices: Performance
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/SQL Server Max Degree of Parallelism__ObjectSet/TargetSet/Server
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/SQL Server Max Degree of Parallelism__ObjectSet
+
+
+ Server
+ true
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/samples/features/epm-framework/sample-policies/SQL Server Max Worker Threads for SQL Server 2005 and above.xml b/samples/features/epm-framework/sample-policies/SQL Server Max Worker Threads for SQL Server 2005 and above.xml
new file mode 100644
index 00000000..5f699534
--- /dev/null
+++ b/samples/features/epm-framework/sample-policies/SQL Server Max Worker Threads for SQL Server 2005 and above.xml
@@ -0,0 +1,258 @@
+
+
+
+
+ <_locDefinition xmlns="urn:locstudio">
+ <_locDefault _loc="locNone" />
+ <_locTag _loc="locData">DMF:Name
+ <_locTag _loc="locData">DMF:Description
+ <_locTag _loc="locData">DMF:Condition
+ <_locTag _loc="locData">DMF:ObjectSet
+ <_locTag _loc="locData">DMF:RootCondition
+ <_locTag _loc="locData">DMF:PolicyCategory
+ <_locTag _loc="locData">DMF:HelpText
+
+
+ urn:uuid:96fe1236-abf6-4a57-b54d-e9baab394fd1
+ http://documentcollection/
+
+
+
+
+
+
+ /system/schema/DMF
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ /PolicyStore/Policy/SQL Server Max Worker Threads for SQL Server 2005 and above
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+
+
+ /PolicyStore/Condition/Auto-configured Maximum Worker Threads
+
+
+
+
+ /PolicyStore/ObjectSet/SQL Server Max Worker Threads for SQL Server 2005 and above__ObjectSet
+
+
+
+
+ /PolicyStore/Condition/SQL Server 2005 or a Later Version
+
+
+
+
+ /PolicyStore/PolicyCategory/Microsoft Best Practices_b Performance
+
+
+ SQL Server Max Worker Threads for SQL Server 2005 and above
+ Checks the max work threads server option for potentially incorrect settings of an instance of SQL Server 2005. Setting the max worker threads option to a nonzero value will prevent SQL Server from automatically determining the proper number of active worker threads based on user requests.
+ Auto-configured Maximum Worker Threads
+ SQL Server Max Worker Threads for SQL Server 2005 and above_ObjectSet
+ SQL Server 2005 or a Later Version
+ Microsoft Best Practices: Performance
+ false
+ None
+
+ http://go.microsoft.com/fwlink/?LinkId=116324
+ 0001-01-01T00:00:00
+ 0001-01-01T00:00:00
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/SQL Server Max Worker Threads for SQL Server 2005 and above__ObjectSet
+
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/SQL Server Max Worker Threads for SQL Server 2005 and above__ObjectSet/TargetSet/Server
+
+
+
+
+
+ /PolicyStore
+
+
+ SQL Server Max Worker Threads for SQL Server 2005 and above_ObjectSet
+ IServerPerformanceFacet
+
+
+
+
+
+
+ /PolicyStore/Condition/Auto-configured Maximum Worker Threads
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>EQ</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Attribute><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <Name>MaxWorkerThreads</Name><?char 13?>
+ </Attribute><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <ObjType>System.Int32</ObjType><?char 13?>
+ <Value>0</Value><?char 13?>
+ </Constant><?char 13?>
+ </Operator>
+
+ Auto-configured Maximum Worker Threads
+ Confirms that the maximum worker threads server option value is set to the recommended value for instances of SQL Server 2005 and later versions.
+ IServerPerformanceFacet
+
+
+
+
+
+
+ /PolicyStore/Condition/SQL Server 2005 or a Later Version
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>GE</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Attribute><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <Name>VersionMajor</Name><?char 13?>
+ </Attribute><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <ObjType>System.Int32</ObjType><?char 13?>
+ <Value>9</Value><?char 13?>
+ </Constant><?char 13?>
+ </Operator>
+
+ SQL Server 2005 or a Later Version
+ Confirms that the version of SQL Server is 2005 or a later version.
+ Server
+
+
+
+
+
+
+ /PolicyStore/PolicyCategory/Microsoft Best Practices_b Performance
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+ Microsoft Best Practices: Performance
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/SQL Server Max Worker Threads for SQL Server 2005 and above__ObjectSet/TargetSet/Server
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/SQL Server Max Worker Threads for SQL Server 2005 and above__ObjectSet
+
+
+ Server
+ true
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/samples/features/epm-framework/sample-policies/SQL Server Network Packet Size.xml b/samples/features/epm-framework/sample-policies/SQL Server Network Packet Size.xml
new file mode 100644
index 00000000..7207aa2d
--- /dev/null
+++ b/samples/features/epm-framework/sample-policies/SQL Server Network Packet Size.xml
@@ -0,0 +1,216 @@
+
+
+
+
+ <_locDefinition xmlns="urn:locstudio">
+ <_locDefault _loc="locNone" />
+ <_locTag _loc="locData">DMF:Name
+ <_locTag _loc="locData">DMF:Description
+ <_locTag _loc="locData">DMF:Condition
+ <_locTag _loc="locData">DMF:ObjectSet
+ <_locTag _loc="locData">DMF:RootCondition
+ <_locTag _loc="locData">DMF:PolicyCategory
+ <_locTag _loc="locData">DMF:HelpText
+
+
+ urn:uuid:96fe1236-abf6-4a57-b54d-e9baab394fd1
+ http://documentcollection/
+
+
+
+
+
+
+ /system/schema/DMF
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ /PolicyStore/Policy/SQL Server Network Packet Size
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+
+
+ /PolicyStore/Condition/Network Packet Size Optimized
+
+
+
+
+ /PolicyStore/ObjectSet/SQL Server Network Packet Size__ObjectSet
+
+
+
+
+ /PolicyStore/PolicyCategory/Microsoft Best Practices_b Performance
+
+
+ SQL Server Network Packet Size
+ Checks whether for the value specified for network packet size server option is set to the optimal value of 8060 bytes. If the network packet size of any logged-in user is more than 8060 bytes, SQL Server performs different memory allocation operations. This can cause an increase in the process virtual address space that is not reserved for the buffer pool.
+ Network Packet Size Optimized
+ SQL Server Network Packet Size_ObjectSet
+ Microsoft Best Practices: Performance
+ false
+ None
+
+ http://go.microsoft.com/fwlink/?LinkId=116360
+ 0001-01-01T00:00:00
+ 0001-01-01T00:00:00
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/SQL Server Network Packet Size__ObjectSet
+
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/SQL Server Network Packet Size__ObjectSet/TargetSet/Server
+
+
+
+
+
+ /PolicyStore
+
+
+ SQL Server Network Packet Size_ObjectSet
+ IServerPerformanceFacet
+
+
+
+
+
+
+ /PolicyStore/Condition/Network Packet Size Optimized
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>LE</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Attribute><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <Name>NetworkPacketSize</Name><?char 13?>
+ </Attribute><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <ObjType>System.Int32</ObjType><?char 13?>
+ <Value>8060</Value><?char 13?>
+ </Constant><?char 13?>
+ </Operator>
+
+ Network Packet Size Optimized
+ Confirms that the value specified for network packet size server option does not exceed 8060 bytes.
+ IServerPerformanceFacet
+
+
+
+
+
+
+ /PolicyStore/PolicyCategory/Microsoft Best Practices_b Performance
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+ Microsoft Best Practices: Performance
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/SQL Server Network Packet Size__ObjectSet/TargetSet/Server
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/SQL Server Network Packet Size__ObjectSet
+
+
+ Server
+ true
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/samples/features/epm-framework/sample-policies/SQL Server Password Expiration.xml b/samples/features/epm-framework/sample-policies/SQL Server Password Expiration.xml
new file mode 100644
index 00000000..805091d9
--- /dev/null
+++ b/samples/features/epm-framework/sample-policies/SQL Server Password Expiration.xml
@@ -0,0 +1,345 @@
+
+
+
+
+ <_locDefinition xmlns="urn:locstudio">
+ <_locDefault _loc="locNone" />
+ <_locTag _loc="locData">DMF:Name
+ <_locTag _loc="locData">DMF:Description
+ <_locTag _loc="locData">DMF:Condition
+ <_locTag _loc="locData">DMF:ObjectSet
+ <_locTag _loc="locData">DMF:RootCondition
+ <_locTag _loc="locData">DMF:PolicyCategory
+ <_locTag _loc="locData">DMF:HelpText
+
+
+ urn:uuid:96fe1236-abf6-4a57-b54d-e9baab394fd1
+ http://documentcollection/
+
+
+
+
+
+
+ /system/schema/DMF
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ /PolicyStore/Policy/SQL Server Password Expiration
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+
+
+ /PolicyStore/Condition/Password Expiration Enabled
+
+
+
+
+ /PolicyStore/ObjectSet/SQL Server Password Expiration__ObjectSet
+
+
+
+
+ /PolicyStore/Condition/SQL Server 2005 or a Later Version
+
+
+
+
+ /PolicyStore/PolicyCategory/Microsoft Best Practices_b Security
+
+
+ SQL Server Password Expiration
+ Checks whether enforce password expiration on SQL Server logins is enabled. Enforce password expiration should be enabled for all SQL Server logins.
+ Password Expiration Enabled
+ SQL Server Password Expiration_ObjectSet
+ SQL Server 2005 or a Later Version
+ Microsoft Best Practices: Security
+ false
+ None
+
+ http://go.microsoft.com/fwlink/?LinkId=116332
+ 0001-01-01T00:00:00
+ 0001-01-01T00:00:00
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/SQL Server Password Expiration__ObjectSet
+
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/SQL Server Password Expiration__ObjectSet/TargetSet/Server_/Login
+
+
+
+
+
+ /PolicyStore
+
+
+ SQL Server Password Expiration_ObjectSet
+ ILoginOptions
+
+
+
+
+
+
+ /PolicyStore/Condition/Password Expiration Enabled
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>EQ</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Attribute><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <Name>PasswordExpirationEnabled</Name><?char 13?>
+ </Attribute><?char 13?>
+ <Function><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <FunctionType>True</FunctionType><?char 13?>
+ <ReturnType>Bool</ReturnType><?char 13?>
+ <Count>0</Count><?char 13?>
+ </Function><?char 13?>
+ </Operator>
+
+ Password Expiration Enabled
+ Confirms that password expiration is enforced for all SQL Server logins.
+ ILoginOptions
+
+
+
+
+
+
+ /PolicyStore/Condition/SQL Server 2005 or a Later Version
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>GE</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Attribute><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <Name>VersionMajor</Name><?char 13?>
+ </Attribute><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <ObjType>System.Int32</ObjType><?char 13?>
+ <Value>9</Value><?char 13?>
+ </Constant><?char 13?>
+ </Operator>
+
+ SQL Server 2005 or a Later Version
+ Confirms that the version of SQL Server is 2005 or a later version.
+ Server
+
+
+
+
+
+
+ /PolicyStore/PolicyCategory/Microsoft Best Practices_b Security
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+ Microsoft Best Practices: Security
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/SQL Server Password Expiration__ObjectSet/TargetSet/Server_/Login
+
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/SQL Server Password Expiration__ObjectSet/TargetSet/Server_/Login/TargetSetLevel/Server_/Login
+
+
+
+
+
+ /PolicyStore/ObjectSet/SQL Server Password Expiration__ObjectSet
+
+
+ Server/Login
+ true
+
+
+
+
+
+
+ /PolicyStore/Condition/SQL Server Authenticated Logins
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>EQ</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Attribute><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <Name>LoginType</Name><?char 13?>
+ </Attribute><?char 13?>
+ <Function><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <FunctionType>Enum</FunctionType><?char 13?>
+ <ReturnType>Numeric</ReturnType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>String</TypeClass><?char 13?>
+ <ObjType>System.String</ObjType><?char 13?>
+ <Value>Microsoft.SqlServer.Management.Smo.LoginType</Value><?char 13?>
+ </Constant><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>String</TypeClass><?char 13?>
+ <ObjType>System.String</ObjType><?char 13?>
+ <Value>SqlLogin</Value><?char 13?>
+ </Constant><?char 13?>
+ </Function><?char 13?>
+ </Operator>
+
+ SQL Server Authenticated Logins
+
+ Login
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/SQL Server Password Expiration__ObjectSet/TargetSet/Server_/Login/TargetSetLevel/Server_/Login
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/SQL Server Password Expiration__ObjectSet/TargetSet/Server_/Login
+
+
+
+
+ /PolicyStore/Condition/SQL Server Authenticated Logins
+
+
+ Server/Login
+ Login
+ SQL Server Authenticated Logins
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/samples/features/epm-framework/sample-policies/SQL Server Password Policy.xml b/samples/features/epm-framework/sample-policies/SQL Server Password Policy.xml
new file mode 100644
index 00000000..2972e2cf
--- /dev/null
+++ b/samples/features/epm-framework/sample-policies/SQL Server Password Policy.xml
@@ -0,0 +1,345 @@
+
+
+
+
+ <_locDefinition xmlns="urn:locstudio">
+ <_locDefault _loc="locNone" />
+ <_locTag _loc="locData">DMF:Name
+ <_locTag _loc="locData">DMF:Description
+ <_locTag _loc="locData">DMF:Condition
+ <_locTag _loc="locData">DMF:ObjectSet
+ <_locTag _loc="locData">DMF:RootCondition
+ <_locTag _loc="locData">DMF:PolicyCategory
+ <_locTag _loc="locData">DMF:HelpText
+
+
+ urn:uuid:96fe1236-abf6-4a57-b54d-e9baab394fd1
+ http://documentcollection/
+
+
+
+
+
+
+ /system/schema/DMF
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ /PolicyStore/Policy/SQL Server Password Policy
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+
+
+ /PolicyStore/Condition/Password Policy Enforced
+
+
+
+
+ /PolicyStore/ObjectSet/SQL Server Password Policy__ObjectSet
+
+
+
+
+ /PolicyStore/Condition/SQL Server 2005 or a Later Version
+
+
+
+
+ /PolicyStore/PolicyCategory/Microsoft Best Practices_b Security
+
+
+ SQL Server Password Policy
+ Checks whether password policy enforcement on SQL Server logins is enabled. Password policy should be enforced for all SQL Server logins.
+ Password Policy Enforced
+ SQL Server Password Policy_ObjectSet
+ SQL Server 2005 or a Later Version
+ Microsoft Best Practices: Security
+ false
+ None
+
+ http://go.microsoft.com/fwlink/?LinkId=116331
+ 0001-01-01T00:00:00
+ 0001-01-01T00:00:00
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/SQL Server Password Policy__ObjectSet
+
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/SQL Server Password Policy__ObjectSet/TargetSet/Server_/Login
+
+
+
+
+
+ /PolicyStore
+
+
+ SQL Server Password Policy_ObjectSet
+ ILoginOptions
+
+
+
+
+
+
+ /PolicyStore/Condition/Password Policy Enforced
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>EQ</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Attribute><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <Name>PasswordPolicyEnforced</Name><?char 13?>
+ </Attribute><?char 13?>
+ <Function><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <FunctionType>True</FunctionType><?char 13?>
+ <ReturnType>Bool</ReturnType><?char 13?>
+ <Count>0</Count><?char 13?>
+ </Function><?char 13?>
+ </Operator>
+
+ Password Policy Enforced
+ Confirms that the enforce password option on SQL Server logins is enabled.
+ ILoginOptions
+
+
+
+
+
+
+ /PolicyStore/Condition/SQL Server 2005 or a Later Version
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>GE</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Attribute><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <Name>VersionMajor</Name><?char 13?>
+ </Attribute><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <ObjType>System.Int32</ObjType><?char 13?>
+ <Value>9</Value><?char 13?>
+ </Constant><?char 13?>
+ </Operator>
+
+ SQL Server 2005 or a Later Version
+ Confirms that the version of SQL Server is 2005 or a later version.
+ Server
+
+
+
+
+
+
+ /PolicyStore/PolicyCategory/Microsoft Best Practices_b Security
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+ Microsoft Best Practices: Security
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/SQL Server Password Policy__ObjectSet/TargetSet/Server_/Login
+
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/SQL Server Password Policy__ObjectSet/TargetSet/Server_/Login/TargetSetLevel/Server_/Login
+
+
+
+
+
+ /PolicyStore/ObjectSet/SQL Server Password Policy__ObjectSet
+
+
+ Server/Login
+ true
+
+
+
+
+
+
+ /PolicyStore/Condition/SQL Server Authenticated Logins
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>EQ</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Attribute><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <Name>LoginType</Name><?char 13?>
+ </Attribute><?char 13?>
+ <Function><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <FunctionType>Enum</FunctionType><?char 13?>
+ <ReturnType>Numeric</ReturnType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>String</TypeClass><?char 13?>
+ <ObjType>System.String</ObjType><?char 13?>
+ <Value>Microsoft.SqlServer.Management.Smo.LoginType</Value><?char 13?>
+ </Constant><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>String</TypeClass><?char 13?>
+ <ObjType>System.String</ObjType><?char 13?>
+ <Value>SqlLogin</Value><?char 13?>
+ </Constant><?char 13?>
+ </Function><?char 13?>
+ </Operator>
+
+ SQL Server Authenticated Logins
+
+ Login
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/SQL Server Password Policy__ObjectSet/TargetSet/Server_/Login/TargetSetLevel/Server_/Login
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/SQL Server Password Policy__ObjectSet/TargetSet/Server_/Login
+
+
+
+
+ /PolicyStore/Condition/SQL Server Authenticated Logins
+
+
+ Server/Login
+ Login
+ SQL Server Authenticated Logins
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/samples/features/epm-framework/sample-policies/Symmetric Key Encryption for User Databases.xml b/samples/features/epm-framework/sample-policies/Symmetric Key Encryption for User Databases.xml
new file mode 100644
index 00000000..17278716
--- /dev/null
+++ b/samples/features/epm-framework/sample-policies/Symmetric Key Encryption for User Databases.xml
@@ -0,0 +1,397 @@
+
+
+
+
+ <_locDefinition xmlns="urn:locstudio">
+ <_locDefault _loc="locNone" />
+ <_locTag _loc="locData">DMF:Name
+ <_locTag _loc="locData">DMF:Description
+ <_locTag _loc="locData">DMF:Condition
+ <_locTag _loc="locData">DMF:ObjectSet
+ <_locTag _loc="locData">DMF:RootCondition
+ <_locTag _loc="locData">DMF:PolicyCategory
+ <_locTag _loc="locData">DMF:HelpText
+
+
+ urn:uuid:96fe1236-abf6-4a57-b54d-e9baab394fd1
+ http://documentcollection/
+
+
+
+
+
+
+ /system/schema/DMF
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ /PolicyStore/Policy/Symmetric Key Encryption for User Databases
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+
+
+ /PolicyStore/Condition/Strongly Encrypted
+
+
+
+
+ /PolicyStore/ObjectSet/Symmetric Key Encryption for User Databases__ObjectSet
+
+
+
+
+ /PolicyStore/Condition/SQL Server 2005 or a Later Version
+
+
+
+
+ /PolicyStore/PolicyCategory/Microsoft Best Practices_b Security
+
+
+ Symmetric Key Encryption for User Databases
+ Checks that symmetric keys with a length less than 128 bytes do not use the RC2 or RC4 encryption algorithm. The best practice recommendation is to use AES 128 bit and above to create symmetric keys for data encryption. If AES is not supported by the version of your operating system, use 3DES.
+ Strongly Encrypted
+ Symmetric Key Encryption for User Databases_ObjectSet
+ SQL Server 2005 or a Later Version
+ Microsoft Best Practices: Security
+ false
+ None
+
+ http://go.microsoft.com/fwlink/?LinkId=116328
+ 0001-01-01T00:00:00
+ 0001-01-01T00:00:00
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Symmetric Key Encryption for User Databases__ObjectSet
+
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Symmetric Key Encryption for User Databases__ObjectSet/TargetSet/Server_/Database_/SymmetricKey
+
+
+
+
+
+ /PolicyStore
+
+
+ Symmetric Key Encryption for User Databases_ObjectSet
+ SymmetricKey
+
+
+
+
+
+
+ /PolicyStore/Condition/Strongly Encrypted
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>AND</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>NE</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Attribute><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <Name>EncryptionAlgorithm</Name><?char 13?>
+ </Attribute><?char 13?>
+ <Function><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <FunctionType>Enum</FunctionType><?char 13?>
+ <ReturnType>Numeric</ReturnType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>String</TypeClass><?char 13?>
+ <ObjType>System.String</ObjType><?char 13?>
+ <Value>Microsoft.SqlServer.Management.Smo.SymmetricKeyEncryptionAlgorithm</Value><?char 13?>
+ </Constant><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>String</TypeClass><?char 13?>
+ <ObjType>System.String</ObjType><?char 13?>
+ <Value>RC2</Value><?char 13?>
+ </Constant><?char 13?>
+ </Function><?char 13?>
+ </Operator><?char 13?>
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>NE</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Attribute><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <Name>EncryptionAlgorithm</Name><?char 13?>
+ </Attribute><?char 13?>
+ <Function><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <FunctionType>Enum</FunctionType><?char 13?>
+ <ReturnType>Numeric</ReturnType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>String</TypeClass><?char 13?>
+ <ObjType>System.String</ObjType><?char 13?>
+ <Value>Microsoft.SqlServer.Management.Smo.SymmetricKeyEncryptionAlgorithm</Value><?char 13?>
+ </Constant><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>String</TypeClass><?char 13?>
+ <ObjType>System.String</ObjType><?char 13?>
+ <Value>RC4</Value><?char 13?>
+ </Constant><?char 13?>
+ </Function><?char 13?>
+ </Operator><?char 13?>
+ </Operator>
+
+ Strongly Encrypted
+ Confirms that the symmetric key encryption algorithm is neither RC2 nor RC4.
+ SymmetricKey
+
+
+
+
+
+
+ /PolicyStore/Condition/SQL Server 2005 or a Later Version
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>GE</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Attribute><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <Name>VersionMajor</Name><?char 13?>
+ </Attribute><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <ObjType>System.Int32</ObjType><?char 13?>
+ <Value>9</Value><?char 13?>
+ </Constant><?char 13?>
+ </Operator>
+
+ SQL Server 2005 or a Later Version
+ Confirms that the version of SQL Server is 2005 or a later version.
+ Server
+
+
+
+
+
+
+ /PolicyStore/PolicyCategory/Microsoft Best Practices_b Security
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+ Microsoft Best Practices: Security
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Symmetric Key Encryption for User Databases__ObjectSet/TargetSet/Server_/Database_/SymmetricKey
+
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Symmetric Key Encryption for User Databases__ObjectSet/TargetSet/Server_/Database_/SymmetricKey/TargetSetLevel/Server_/Database_/SymmetricKey
+
+
+ /PolicyStore/ObjectSet/Symmetric Key Encryption for User Databases__ObjectSet/TargetSet/Server_/Database_/SymmetricKey/TargetSetLevel/Server_/Database
+
+
+
+
+
+ /PolicyStore/ObjectSet/Symmetric Key Encryption for User Databases__ObjectSet
+
+
+ Server/Database/SymmetricKey
+ true
+
+
+
+
+
+
+ /PolicyStore/Condition/Key Length Less Than 128 Bytes
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>LE</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Attribute><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <Name>KeyLength</Name><?char 13?>
+ </Attribute><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <ObjType>System.Int32</ObjType><?char 13?>
+ <Value>128</Value><?char 13?>
+ </Constant><?char 13?>
+ </Operator>
+
+ Key Length Less Than 128 Bytes
+ Confirms that the Symmetric Key KeyLength property is less than 128 bytes.
+ SymmetricKey
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Symmetric Key Encryption for User Databases__ObjectSet/TargetSet/Server_/Database_/SymmetricKey/TargetSetLevel/Server_/Database_/SymmetricKey
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Symmetric Key Encryption for User Databases__ObjectSet/TargetSet/Server_/Database_/SymmetricKey
+
+
+
+
+ /PolicyStore/Condition/Key Length Less Than 128 Bytes
+
+
+ Server/Database/SymmetricKey
+ SymmetricKey
+ Key Length Less Than 128 Bytes
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Symmetric Key Encryption for User Databases__ObjectSet/TargetSet/Server_/Database_/SymmetricKey/TargetSetLevel/Server_/Database
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Symmetric Key Encryption for User Databases__ObjectSet/TargetSet/Server_/Database_/SymmetricKey
+
+
+ Server/Database
+ Database
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/samples/features/epm-framework/sample-policies/Symmetric Key for System Databases.xml b/samples/features/epm-framework/sample-policies/Symmetric Key for System Databases.xml
new file mode 100644
index 00000000..c84c6577
--- /dev/null
+++ b/samples/features/epm-framework/sample-policies/Symmetric Key for System Databases.xml
@@ -0,0 +1,379 @@
+
+
+
+
+ <_locDefinition xmlns="urn:locstudio">
+ <_locDefault _loc="locNone" />
+ <_locTag _loc="locData">DMF:Name
+ <_locTag _loc="locData">DMF:Description
+ <_locTag _loc="locData">DMF:Condition
+ <_locTag _loc="locData">DMF:ObjectSet
+ <_locTag _loc="locData">DMF:RootCondition
+ <_locTag _loc="locData">DMF:PolicyCategory
+ <_locTag _loc="locData">DMF:HelpText
+
+
+ urn:uuid:96fe1236-abf6-4a57-b54d-e9baab394fd1
+ http://documentcollection/
+
+
+
+
+
+
+ /system/schema/DMF
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ /PolicyStore/Policy/Symmetric Key for System Databases
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+
+
+ /PolicyStore/Condition/Fail For Any Symmetric Key
+
+
+
+
+ /PolicyStore/ObjectSet/Symmetric Key for System Databases__ObjectSet
+
+
+
+
+ /PolicyStore/Condition/SQL Server 2005 or a Later Version
+
+
+
+
+ /PolicyStore/PolicyCategory/Microsoft Best Practices_b Security
+
+
+ Symmetric Key for System Databases
+ Checks for user-created symmetric keys in the msdb, model, and tempdb databases. This is not recommended. This recommendation does not apply to the master database.
+ Fail For Any Symmetric Key
+ Symmetric Key for System Databases_ObjectSet
+ SQL Server 2005 or a Later Version
+ Microsoft Best Practices: Security
+ false
+ None
+
+ http://go.microsoft.com/fwlink/?LinkId=116329
+ 0001-01-01T00:00:00
+ 0001-01-01T00:00:00
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Symmetric Key for System Databases__ObjectSet
+
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Symmetric Key for System Databases__ObjectSet/TargetSet/Server_/Database_/SymmetricKey
+
+
+
+
+
+ /PolicyStore
+
+
+ Symmetric Key for System Databases_ObjectSet
+ SymmetricKey
+
+
+
+
+
+
+ /PolicyStore/Condition/Fail For Any Symmetric Key
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>EQ</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Function><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <FunctionType>True</FunctionType><?char 13?>
+ <ReturnType>Bool</ReturnType><?char 13?>
+ <Count>0</Count><?char 13?>
+ </Function><?char 13?>
+ <Function><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <FunctionType>False</FunctionType><?char 13?>
+ <ReturnType>Bool</ReturnType><?char 13?>
+ <Count>0</Count><?char 13?>
+ </Function><?char 13?>
+ </Operator>
+
+ Fail For Any Symmetric Key
+ Confirms that symmetric keys in the database fail this condition.
+ SymmetricKey
+
+
+
+
+
+
+ /PolicyStore/Condition/SQL Server 2005 or a Later Version
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>GE</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Attribute><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <Name>VersionMajor</Name><?char 13?>
+ </Attribute><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <ObjType>System.Int32</ObjType><?char 13?>
+ <Value>9</Value><?char 13?>
+ </Constant><?char 13?>
+ </Operator>
+
+ SQL Server 2005 or a Later Version
+ Confirms that the version of SQL Server is 2005 or a later version.
+ Server
+
+
+
+
+
+
+ /PolicyStore/PolicyCategory/Microsoft Best Practices_b Security
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+ Microsoft Best Practices: Security
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Symmetric Key for System Databases__ObjectSet/TargetSet/Server_/Database_/SymmetricKey
+
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Symmetric Key for System Databases__ObjectSet/TargetSet/Server_/Database_/SymmetricKey/TargetSetLevel/Server_/Database_/SymmetricKey
+
+
+ /PolicyStore/ObjectSet/Symmetric Key for System Databases__ObjectSet/TargetSet/Server_/Database_/SymmetricKey/TargetSetLevel/Server_/Database
+
+
+
+
+
+ /PolicyStore/ObjectSet/Symmetric Key for System Databases__ObjectSet
+
+
+ Server/Database/SymmetricKey
+ true
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Symmetric Key for System Databases__ObjectSet/TargetSet/Server_/Database_/SymmetricKey/TargetSetLevel/Server_/Database_/SymmetricKey
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Symmetric Key for System Databases__ObjectSet/TargetSet/Server_/Database_/SymmetricKey
+
+
+ Server/Database/SymmetricKey
+ SymmetricKey
+
+
+
+
+
+
+
+ /PolicyStore/Condition/System Databases Not Including Master
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>AND</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>NE</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Attribute><?char 13?>
+ <TypeClass>String</TypeClass><?char 13?>
+ <Name>Name</Name><?char 13?>
+ </Attribute><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>String</TypeClass><?char 13?>
+ <ObjType>System.String</ObjType><?char 13?>
+ <Value>master</Value><?char 13?>
+ </Constant><?char 13?>
+ </Operator><?char 13?>
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>EQ</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Attribute><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <Name>IsSystemObject</Name><?char 13?>
+ </Attribute><?char 13?>
+ <Function><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <FunctionType>True</FunctionType><?char 13?>
+ <ReturnType>Bool</ReturnType><?char 13?>
+ <Count>0</Count><?char 13?>
+ </Function><?char 13?>
+ </Operator><?char 13?>
+ </Operator>
+
+ System Databases Not Including Master
+ Confirms that the database is a system database and its name is not master.
+ Database
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Symmetric Key for System Databases__ObjectSet/TargetSet/Server_/Database_/SymmetricKey/TargetSetLevel/Server_/Database
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Symmetric Key for System Databases__ObjectSet/TargetSet/Server_/Database_/SymmetricKey
+
+
+
+
+ /PolicyStore/Condition/System Databases Not Including Master
+
+
+ Server/Database
+ Database
+ System Databases Not Including Master
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/samples/features/epm-framework/sample-policies/Symmetric Key for master Database.xml b/samples/features/epm-framework/sample-policies/Symmetric Key for master Database.xml
new file mode 100644
index 00000000..311c2765
--- /dev/null
+++ b/samples/features/epm-framework/sample-policies/Symmetric Key for master Database.xml
@@ -0,0 +1,362 @@
+
+
+
+
+ <_locDefinition xmlns="urn:locstudio">
+ <_locDefault _loc="locNone" />
+ <_locTag _loc="locData">DMF:Name
+ <_locTag _loc="locData">DMF:Description
+ <_locTag _loc="locData">DMF:Condition
+ <_locTag _loc="locData">DMF:ObjectSet
+ <_locTag _loc="locData">DMF:RootCondition
+ <_locTag _loc="locData">DMF:PolicyCategory
+ <_locTag _loc="locData">DMF:HelpText
+
+
+ urn:uuid:96fe1236-abf6-4a57-b54d-e9baab394fd1
+ http://documentcollection/
+
+
+
+
+
+
+ /system/schema/DMF
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ /PolicyStore/Policy/Symmetric Key for master Database
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+
+
+ /PolicyStore/Condition/Microsoft Service Master Key
+
+
+
+
+ /PolicyStore/ObjectSet/Symmetric Key for master Database__ObjectSet
+
+
+
+
+ /PolicyStore/Condition/SQL Server 2005 or a Later Version
+
+
+
+
+ /PolicyStore/PolicyCategory/Microsoft Best Practices_b Security
+
+
+ Symmetric Key for master Database
+ Checks for user-created symmetric keys in the master database, which is not recommended. The master database contains the Master Symmetric key.
+ Microsoft Service Master Key
+ Symmetric Key for master Database_ObjectSet
+ SQL Server 2005 or a Later Version
+ Microsoft Best Practices: Security
+ false
+ None
+
+ http://go.microsoft.com/fwlink/?LinkId=116329
+ 0001-01-01T00:00:00
+ 0001-01-01T00:00:00
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Symmetric Key for master Database__ObjectSet
+
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Symmetric Key for master Database__ObjectSet/TargetSet/Server_/Database_/SymmetricKey
+
+
+
+
+
+ /PolicyStore
+
+
+ Symmetric Key for master Database_ObjectSet
+ SymmetricKey
+
+
+
+
+
+
+ /PolicyStore/Condition/Microsoft Service Master Key
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>EQ</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Attribute><?char 13?>
+ <TypeClass>Unsupported</TypeClass><?char 13?>
+ <Name>Name</Name><?char 13?>
+ </Attribute><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>String</TypeClass><?char 13?>
+ <ObjType>System.String</ObjType><?char 13?>
+ <Value>##MS_ServiceMasterKey##</Value><?char 13?>
+ </Constant><?char 13?>
+ </Operator>
+
+ Microsoft Service Master Key
+
+ Confirms that the symmetric key is the Service Master Key.<?char 13?>
+ <?char 13?>
+ The Service Master Key is the root of the SQL Server encryption hierarchy. It is generated automatically the first time it is needed to encrypt another key. By default, the Service Master Key is encrypted using the Windows data protection API and using the local machine key. The Service Master Key can only be opened by the Windows service account under which it was created or by a principal with access to both the service account name and its password.<?char 13?>
+ <?char 13?>
+ Regenerating or restoring the Service Master Key involves decrypting and re-encrypting the complete encryption hierarchy. Unless the key has been compromised, this resource-intensive operation should be scheduled during a period of low demand.<?char 13?>
+
+ SymmetricKey
+
+
+
+
+
+
+ /PolicyStore/Condition/SQL Server 2005 or a Later Version
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>GE</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Attribute><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <Name>VersionMajor</Name><?char 13?>
+ </Attribute><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <ObjType>System.Int32</ObjType><?char 13?>
+ <Value>9</Value><?char 13?>
+ </Constant><?char 13?>
+ </Operator>
+
+ SQL Server 2005 or a Later Version
+ Confirms that the version of SQL Server is 2005 or a later version.
+ Server
+
+
+
+
+
+
+ /PolicyStore/PolicyCategory/Microsoft Best Practices_b Security
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+ Microsoft Best Practices: Security
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Symmetric Key for master Database__ObjectSet/TargetSet/Server_/Database_/SymmetricKey
+
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Symmetric Key for master Database__ObjectSet/TargetSet/Server_/Database_/SymmetricKey/TargetSetLevel/Server_/Database_/SymmetricKey
+
+
+ /PolicyStore/ObjectSet/Symmetric Key for master Database__ObjectSet/TargetSet/Server_/Database_/SymmetricKey/TargetSetLevel/Server_/Database
+
+
+
+
+
+ /PolicyStore/ObjectSet/Symmetric Key for master Database__ObjectSet
+
+
+ Server/Database/SymmetricKey
+ true
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Symmetric Key for master Database__ObjectSet/TargetSet/Server_/Database_/SymmetricKey/TargetSetLevel/Server_/Database_/SymmetricKey
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Symmetric Key for master Database__ObjectSet/TargetSet/Server_/Database_/SymmetricKey
+
+
+ Server/Database/SymmetricKey
+ SymmetricKey
+
+
+
+
+
+
+
+ /PolicyStore/Condition/Is master
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>EQ</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Attribute><?char 13?>
+ <TypeClass>String</TypeClass><?char 13?>
+ <Name>Name</Name><?char 13?>
+ </Attribute><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>String</TypeClass><?char 13?>
+ <ObjType>System.String</ObjType><?char 13?>
+ <Value>master</Value><?char 13?>
+ </Constant><?char 13?>
+ </Operator>
+
+ Is master
+ Confirms that the database name is master.
+ Database
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Symmetric Key for master Database__ObjectSet/TargetSet/Server_/Database_/SymmetricKey/TargetSetLevel/Server_/Database
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Symmetric Key for master Database__ObjectSet/TargetSet/Server_/Database_/SymmetricKey
+
+
+
+
+ /PolicyStore/Condition/Is master
+
+
+ Server/Database
+ Database
+ Is master
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/samples/features/epm-framework/sample-policies/Trustworthy Database.xml b/samples/features/epm-framework/sample-policies/Trustworthy Database.xml
new file mode 100644
index 00000000..cd9b82fe
--- /dev/null
+++ b/samples/features/epm-framework/sample-policies/Trustworthy Database.xml
@@ -0,0 +1,335 @@
+
+
+
+
+ <_locDefinition xmlns="urn:locstudio">
+ <_locDefault _loc="locNone" />
+ <_locTag _loc="locData">DMF:Name
+ <_locTag _loc="locData">DMF:Description
+ <_locTag _loc="locData">DMF:Condition
+ <_locTag _loc="locData">DMF:ObjectSet
+ <_locTag _loc="locData">DMF:RootCondition
+ <_locTag _loc="locData">DMF:PolicyCategory
+ <_locTag _loc="locData">DMF:HelpText
+
+
+ urn:uuid:96fe1236-abf6-4a57-b54d-e9baab394fd1
+ http://documentcollection/
+
+
+
+
+
+
+ /system/schema/DMF
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ /PolicyStore/Policy/Trustworthy Database
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+
+
+ /PolicyStore/Condition/Database Owner Not sysadmin
+
+
+
+
+ /PolicyStore/ObjectSet/Trustworthy Database__ObjectSet
+
+
+
+
+ /PolicyStore/Condition/SQL Server 2005 or a Later Version
+
+
+
+
+ /PolicyStore/PolicyCategory/Microsoft Best Practices_b Security
+
+
+ Trustworthy Database
+ Checks whether the dbo or a db_owner is assigned to a fixed server sysadmin role for databases where the trustworthy bit is set to on. Database users with the appropriate level of permissions can elevate privileges to the sysadmin role. In this role, the user can create and execute unsafe assemblies that compromise the system. The best practice is to turn off the trustworthy bit or change the dbo and db_owner to a fixed server role other than sysadmin.
+ Database Owner Not sysadmin
+ Trustworthy Database_ObjectSet
+ SQL Server 2005 or a Later Version
+ Microsoft Best Practices: Security
+ false
+ None
+
+ http://go.microsoft.com/fwlink/?LinkId=116327
+ 0001-01-01T00:00:00
+ 0001-01-01T00:00:00
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Trustworthy Database__ObjectSet
+
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Trustworthy Database__ObjectSet/TargetSet/Server_/Database
+
+
+
+
+
+ /PolicyStore
+
+
+ Trustworthy Database_ObjectSet
+ IDatabaseSecurityFacet
+
+
+
+
+
+
+ /PolicyStore/Condition/Database Owner Not sysadmin
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>EQ</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Attribute><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <Name>IsOwnerSysadmin</Name><?char 13?>
+ </Attribute><?char 13?>
+ <Function><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <FunctionType>False</FunctionType><?char 13?>
+ <ReturnType>Bool</ReturnType><?char 13?>
+ <Count>0</Count><?char 13?>
+ </Function><?char 13?>
+ </Operator>
+
+ Database Owner Not sysadmin
+ Confirms that no login in the db_owner role has sysadmin privileges.
+ IDatabaseSecurityFacet
+
+
+
+
+
+
+ /PolicyStore/Condition/SQL Server 2005 or a Later Version
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>GE</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Attribute><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <Name>VersionMajor</Name><?char 13?>
+ </Attribute><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <ObjType>System.Int32</ObjType><?char 13?>
+ <Value>9</Value><?char 13?>
+ </Constant><?char 13?>
+ </Operator>
+
+ SQL Server 2005 or a Later Version
+ Confirms that the version of SQL Server is 2005 or a later version.
+ Server
+
+
+
+
+
+
+ /PolicyStore/PolicyCategory/Microsoft Best Practices_b Security
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+ Microsoft Best Practices: Security
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Trustworthy Database__ObjectSet/TargetSet/Server_/Database
+
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Trustworthy Database__ObjectSet/TargetSet/Server_/Database/TargetSetLevel/Server_/Database
+
+
+
+
+
+ /PolicyStore/ObjectSet/Trustworthy Database__ObjectSet
+
+
+ Server/Database
+ true
+
+
+
+
+
+
+ /PolicyStore/Condition/Trustworthy
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>EQ</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Attribute><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <Name>Trustworthy</Name><?char 13?>
+ </Attribute><?char 13?>
+ <Function><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <FunctionType>True</FunctionType><?char 13?>
+ <ReturnType>Bool</ReturnType><?char 13?>
+ <Count>0</Count><?char 13?>
+ </Function><?char 13?>
+ </Operator>
+
+ Trustworthy
+ Confirms that the database Trustworthy property is equal to true.
+ IDatabaseOptions
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Trustworthy Database__ObjectSet/TargetSet/Server_/Database/TargetSetLevel/Server_/Database
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Trustworthy Database__ObjectSet/TargetSet/Server_/Database
+
+
+
+
+ /PolicyStore/Condition/Trustworthy
+
+
+ Server/Database
+ Database
+ Trustworthy
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/samples/features/epm-framework/sample-policies/Windows Event Log Cluster Disk Resource Corruption Error.xml b/samples/features/epm-framework/sample-policies/Windows Event Log Cluster Disk Resource Corruption Error.xml
new file mode 100644
index 00000000..c90d1f13
--- /dev/null
+++ b/samples/features/epm-framework/sample-policies/Windows Event Log Cluster Disk Resource Corruption Error.xml
@@ -0,0 +1,247 @@
+
+
+
+
+ <_locDefinition xmlns="urn:locstudio">
+ <_locDefault _loc="locNone" />
+ <_locTag _loc="locData">DMF:Name
+ <_locTag _loc="locData">DMF:Description
+ <_locTag _loc="locData">DMF:Condition
+ <_locTag _loc="locData">DMF:ObjectSet
+ <_locTag _loc="locData">DMF:RootCondition
+ <_locTag _loc="locData">DMF:PolicyCategory
+ <_locTag _loc="locData">DMF:HelpText
+
+
+ urn:uuid:96fe1236-abf6-4a57-b54d-e9baab394fd1
+ http://documentcollection/
+
+
+
+
+
+
+ /system/schema/DMF
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ /PolicyStore/Policy/Windows Event Log Cluster Disk Resource Corruption Error
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+
+
+ /PolicyStore/Condition/Cluster Disk Resource Corruption Error Check
+
+
+
+
+ /PolicyStore/ObjectSet/Windows Event Log Cluster Disk Resource Corruption Error__ObjectSet
+
+
+
+
+ /PolicyStore/PolicyCategory/Microsoft Best Practices_b Windows Log File
+
+
+ Windows Event Log Cluster Disk Resource Corruption Error
+
+ Detects SCSI host adapter configuration issues or a malfunctioning device error message in the System Log.<?char 13?>
+ http://support.microsoft.com/kb/311081<?char 13?>
+
+ Cluster Disk Resource Corruption Error Check
+ Windows Event Log Cluster Disk Resource Corruption Error_ObjectSet
+ Microsoft Best Practices: Windows Log File
+ false
+ None
+
+ http://go.microsoft.com/fwlink/?LinkId=116377
+ 0001-01-01T00:00:00
+ 0001-01-01T00:00:00
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Windows Event Log Cluster Disk Resource Corruption Error__ObjectSet
+
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Windows Event Log Cluster Disk Resource Corruption Error__ObjectSet/TargetSet/Server
+
+
+
+
+
+ /PolicyStore
+
+
+ Windows Event Log Cluster Disk Resource Corruption Error_ObjectSet
+ Server
+
+
+
+
+
+
+ /PolicyStore/Condition/Cluster Disk Resource Corruption Error Check
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>EQ</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Function><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <FunctionType>IsNull</FunctionType><?char 13?>
+ <ReturnType>Numeric</ReturnType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Function><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <FunctionType>ExecuteWql</FunctionType><?char 13?>
+ <ReturnType>Numeric</ReturnType><?char 13?>
+ <Count>3</Count><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>String</TypeClass><?char 13?>
+ <ObjType>System.String</ObjType><?char 13?>
+ <Value>Numeric</Value><?char 13?>
+ </Constant><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>String</TypeClass><?char 13?>
+ <ObjType>System.String</ObjType><?char 13?>
+ <Value>root\CIMV2</Value><?char 13?>
+ </Constant><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>String</TypeClass><?char 13?>
+ <ObjType>System.String</ObjType><?char 13?>
+ <Value>select EventCode from Win32_NTLogEvent where EventCode=1066 and Logfile="System"</Value><?char 13?>
+ </Constant><?char 13?>
+ </Function><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <ObjType>System.Int32</ObjType><?char 13?>
+ <Value>0</Value><?char 13?>
+ </Constant><?char 13?>
+ </Function><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <ObjType>System.Int32</ObjType><?char 13?>
+ <Value>0</Value><?char 13?>
+ </Constant><?char 13?>
+ </Operator>
+
+ Cluster Disk Resource Corruption Error Check
+ Confirms that an ESCSI host adapter configuration issue or a malfunctioning device error (Event ID –1066) does not exist in the system log.
+ Server
+
+
+
+
+
+
+ /PolicyStore/PolicyCategory/Microsoft Best Practices_b Windows Log File
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+ Microsoft Best Practices: Windows Log File
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Windows Event Log Cluster Disk Resource Corruption Error__ObjectSet/TargetSet/Server
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Windows Event Log Cluster Disk Resource Corruption Error__ObjectSet
+
+
+ Server
+ true
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/samples/features/epm-framework/sample-policies/Windows Event Log Device Driver Control Error.xml b/samples/features/epm-framework/sample-policies/Windows Event Log Device Driver Control Error.xml
new file mode 100644
index 00000000..902bd3a1
--- /dev/null
+++ b/samples/features/epm-framework/sample-policies/Windows Event Log Device Driver Control Error.xml
@@ -0,0 +1,248 @@
+
+
+
+
+ <_locDefinition xmlns="urn:locstudio">
+ <_locDefault _loc="locNone" />
+ <_locTag _loc="locData">DMF:Name
+ <_locTag _loc="locData">DMF:Description
+ <_locTag _loc="locData">DMF:Condition
+ <_locTag _loc="locData">DMF:ObjectSet
+ <_locTag _loc="locData">DMF:RootCondition
+ <_locTag _loc="locData">DMF:PolicyCategory
+ <_locTag _loc="locData">DMF:HelpText
+
+
+ urn:uuid:96fe1236-abf6-4a57-b54d-e9baab394fd1
+ http://documentcollection/
+
+
+
+
+
+
+ /system/schema/DMF
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ /PolicyStore/Policy/Windows Event Log Device Driver Control Error
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+
+
+ /PolicyStore/Condition/Device Driver Control Error Check
+
+
+
+
+ /PolicyStore/ObjectSet/Windows Event Log Device Driver Control Error__ObjectSet
+
+
+
+
+ /PolicyStore/PolicyCategory/Microsoft Best Practices_b Windows Log File
+
+
+ Windows Event Log Device Driver Control Error
+
+ Detects Error EventID –11 in the System Log. This error could be because of a corrupted device driver, a hardware problem, a malfunctioning device, poor cabling, or termination issues. <?char 13?>
+ http://support.microsoft.com/kb/259237 <?char 13?>
+ http://support.microsoft.com/kb/154690
+
+ Device Driver Control Error Check
+ Windows Event Log Device Driver Control Error_ObjectSet
+ Microsoft Best Practices: Windows Log File
+ false
+ None
+
+ http://go.microsoft.com/fwlink/?LinkId=116371
+ 0001-01-01T00:00:00
+ 0001-01-01T00:00:00
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Windows Event Log Device Driver Control Error__ObjectSet
+
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Windows Event Log Device Driver Control Error__ObjectSet/TargetSet/Server
+
+
+
+
+
+ /PolicyStore
+
+
+ Windows Event Log Device Driver Control Error_ObjectSet
+ Server
+
+
+
+
+
+
+ /PolicyStore/Condition/Device Driver Control Error Check
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>EQ</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Function><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <FunctionType>IsNull</FunctionType><?char 13?>
+ <ReturnType>Numeric</ReturnType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Function><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <FunctionType>ExecuteWql</FunctionType><?char 13?>
+ <ReturnType>Numeric</ReturnType><?char 13?>
+ <Count>3</Count><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>String</TypeClass><?char 13?>
+ <ObjType>System.String</ObjType><?char 13?>
+ <Value>Numeric</Value><?char 13?>
+ </Constant><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>String</TypeClass><?char 13?>
+ <ObjType>System.String</ObjType><?char 13?>
+ <Value>root\CIMV2</Value><?char 13?>
+ </Constant><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>String</TypeClass><?char 13?>
+ <ObjType>System.String</ObjType><?char 13?>
+ <Value>select EventCode from Win32_NTLogEvent where EventCode=11 and Logfile="System"</Value><?char 13?>
+ </Constant><?char 13?>
+ </Function><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <ObjType>System.Int32</ObjType><?char 13?>
+ <Value>0</Value><?char 13?>
+ </Constant><?char 13?>
+ </Function><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <ObjType>System.Int32</ObjType><?char 13?>
+ <Value>0</Value><?char 13?>
+ </Constant><?char 13?>
+ </Operator>
+
+ Device Driver Control Error Check
+ Confirms that an I/O time-out event error (Event ID -11) does not exist in the system log.
+ Server
+
+
+
+
+
+
+ /PolicyStore/PolicyCategory/Microsoft Best Practices_b Windows Log File
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+ Microsoft Best Practices: Windows Log File
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Windows Event Log Device Driver Control Error__ObjectSet/TargetSet/Server
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Windows Event Log Device Driver Control Error__ObjectSet
+
+
+ Server
+ true
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/samples/features/epm-framework/sample-policies/Windows Event Log Device Not Ready Error.xml b/samples/features/epm-framework/sample-policies/Windows Event Log Device Not Ready Error.xml
new file mode 100644
index 00000000..f87d94e5
--- /dev/null
+++ b/samples/features/epm-framework/sample-policies/Windows Event Log Device Not Ready Error.xml
@@ -0,0 +1,248 @@
+
+
+
+
+ <_locDefinition xmlns="urn:locstudio">
+ <_locDefault _loc="locNone" />
+ <_locTag _loc="locData">DMF:Name
+ <_locTag _loc="locData">DMF:Description
+ <_locTag _loc="locData">DMF:Condition
+ <_locTag _loc="locData">DMF:ObjectSet
+ <_locTag _loc="locData">DMF:RootCondition
+ <_locTag _loc="locData">DMF:PolicyCategory
+ <_locTag _loc="locData">DMF:HelpText
+
+
+ urn:uuid:96fe1236-abf6-4a57-b54d-e9baab394fd1
+ http://documentcollection/
+
+
+
+
+
+
+ /system/schema/DMF
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ /PolicyStore/Policy/Windows Event Log Device Not Ready Error
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+
+
+ /PolicyStore/Condition/Device Not Ready Error Check
+
+
+
+
+ /PolicyStore/ObjectSet/Windows Event Log Device Not Ready Error__ObjectSet
+
+
+
+
+ /PolicyStore/PolicyCategory/Microsoft Best Practices_b Windows Log File
+
+
+ Windows Event Log Device Not Ready Error
+
+ This policy detects for error messages in Detects error messages in the System Log that can be the result of SCSI host adapter configuration issues or related problems.<?char 13?>
+ http://support.microsoft.com/kb/259237<?char 13?>
+ http://support.microsoft.com/kb/154690<?char 13?>
+
+ Device Not Ready Error Check
+ Windows Event Log Device Not Ready Error_ObjectSet
+ Microsoft Best Practices: Windows Log File
+ false
+ None
+
+ http://go.microsoft.com/fwlink/?LinkId=116349
+ 0001-01-01T00:00:00
+ 0001-01-01T00:00:00
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Windows Event Log Device Not Ready Error__ObjectSet
+
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Windows Event Log Device Not Ready Error__ObjectSet/TargetSet/Server
+
+
+
+
+
+ /PolicyStore
+
+
+ Windows Event Log Device Not Ready Error_ObjectSet
+ Server
+
+
+
+
+
+
+ /PolicyStore/Condition/Device Not Ready Error Check
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>EQ</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Function><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <FunctionType>IsNull</FunctionType><?char 13?>
+ <ReturnType>Numeric</ReturnType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Function><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <FunctionType>ExecuteWql</FunctionType><?char 13?>
+ <ReturnType>Numeric</ReturnType><?char 13?>
+ <Count>3</Count><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>String</TypeClass><?char 13?>
+ <ObjType>System.String</ObjType><?char 13?>
+ <Value>Numeric</Value><?char 13?>
+ </Constant><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>String</TypeClass><?char 13?>
+ <ObjType>System.String</ObjType><?char 13?>
+ <Value>root\CIMV2</Value><?char 13?>
+ </Constant><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>String</TypeClass><?char 13?>
+ <ObjType>System.String</ObjType><?char 13?>
+ <Value>select EventCode from Win32_NTLogEvent where EventCode=15 and Logfile="System"</Value><?char 13?>
+ </Constant><?char 13?>
+ </Function><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <ObjType>System.Int32</ObjType><?char 13?>
+ <Value>0</Value><?char 13?>
+ </Constant><?char 13?>
+ </Function><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <ObjType>System.Int32</ObjType><?char 13?>
+ <Value>0</Value><?char 13?>
+ </Constant><?char 13?>
+ </Operator>
+
+ Device Not Ready Error Check
+ Confirms that a Device Not Ready Error (Event ID –15) does not exist in the system log.
+ Server
+
+
+
+
+
+
+ /PolicyStore/PolicyCategory/Microsoft Best Practices_b Windows Log File
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+ Microsoft Best Practices: Windows Log File
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Windows Event Log Device Not Ready Error__ObjectSet/TargetSet/Server
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Windows Event Log Device Not Ready Error__ObjectSet
+
+
+ Server
+ true
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/samples/features/epm-framework/sample-policies/Windows Event Log Failed I_O Request Error.xml b/samples/features/epm-framework/sample-policies/Windows Event Log Failed I_O Request Error.xml
new file mode 100644
index 00000000..0f111e17
--- /dev/null
+++ b/samples/features/epm-framework/sample-policies/Windows Event Log Failed I_O Request Error.xml
@@ -0,0 +1,248 @@
+
+
+
+
+ <_locDefinition xmlns="urn:locstudio">
+ <_locDefault _loc="locNone" />
+ <_locTag _loc="locData">DMF:Name
+ <_locTag _loc="locData">DMF:Description
+ <_locTag _loc="locData">DMF:Condition
+ <_locTag _loc="locData">DMF:ObjectSet
+ <_locTag _loc="locData">DMF:RootCondition
+ <_locTag _loc="locData">DMF:PolicyCategory
+ <_locTag _loc="locData">DMF:HelpText
+
+
+ urn:uuid:96fe1236-abf6-4a57-b54d-e9baab394fd1
+ http://documentcollection/
+
+
+
+
+
+
+ /system/schema/DMF
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ /PolicyStore/Policy/Windows Event Log Failed I_/O Request Error
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+
+
+ /PolicyStore/Condition/Failed I_/O Request Check
+
+
+
+
+ /PolicyStore/ObjectSet/Windows Event Log Failed I_/O Request Error__ObjectSet
+
+
+
+
+ /PolicyStore/PolicyCategory/Microsoft Best Practices_b Windows Log File
+
+
+ Windows Event Log Failed I/O Request Error
+
+ This policy detects a failed I/O request error message in the system log. This could be the result of a variety of things, including a firmware bug or faulty SCSI cables.<?char 13?>
+ http://support.microsoft.com/kb/311081<?char 13?>
+ http://support.microsoft.com/kb/885688<?char 13?>
+
+ Failed I/O Request Check
+ Windows Event Log Failed I/O Request Error_ObjectSet
+ Microsoft Best Practices: Windows Log File
+ false
+ None
+
+ http://go.microsoft.com/fwlink/?LinkId=116385
+ 0001-01-01T00:00:00
+ 0001-01-01T00:00:00
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Windows Event Log Failed I_/O Request Error__ObjectSet
+
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Windows Event Log Failed I_/O Request Error__ObjectSet/TargetSet/Server
+
+
+
+
+
+ /PolicyStore
+
+
+ Windows Event Log Failed I/O Request Error_ObjectSet
+ Server
+
+
+
+
+
+
+ /PolicyStore/Condition/Failed I_/O Request Check
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>EQ</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Function><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <FunctionType>IsNull</FunctionType><?char 13?>
+ <ReturnType>Numeric</ReturnType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Function><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <FunctionType>ExecuteWql</FunctionType><?char 13?>
+ <ReturnType>Numeric</ReturnType><?char 13?>
+ <Count>3</Count><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>String</TypeClass><?char 13?>
+ <ObjType>System.String</ObjType><?char 13?>
+ <Value>Numeric</Value><?char 13?>
+ </Constant><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>String</TypeClass><?char 13?>
+ <ObjType>System.String</ObjType><?char 13?>
+ <Value>root\CIMV2</Value><?char 13?>
+ </Constant><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>String</TypeClass><?char 13?>
+ <ObjType>System.String</ObjType><?char 13?>
+ <Value>select EventCode from Win32_NTLogEvent where EventCode=50 and Logfile="System"</Value><?char 13?>
+ </Constant><?char 13?>
+ </Function><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <ObjType>System.Int32</ObjType><?char 13?>
+ <Value>0</Value><?char 13?>
+ </Constant><?char 13?>
+ </Function><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <ObjType>System.Int32</ObjType><?char 13?>
+ <Value>0</Value><?char 13?>
+ </Constant><?char 13?>
+ </Operator>
+
+ Failed I/O Request Check
+ Confirms that a failed I/O request (Event ID 50) does not exist in the system log.
+ Server
+
+
+
+
+
+
+ /PolicyStore/PolicyCategory/Microsoft Best Practices_b Windows Log File
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+ Microsoft Best Practices: Windows Log File
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Windows Event Log Failed I_/O Request Error__ObjectSet/TargetSet/Server
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Windows Event Log Failed I_/O Request Error__ObjectSet
+
+
+ Server
+ true
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/samples/features/epm-framework/sample-policies/Windows Event Log I_O Delay Warning.xml b/samples/features/epm-framework/sample-policies/Windows Event Log I_O Delay Warning.xml
new file mode 100644
index 00000000..542ed215
--- /dev/null
+++ b/samples/features/epm-framework/sample-policies/Windows Event Log I_O Delay Warning.xml
@@ -0,0 +1,244 @@
+
+
+
+
+ <_locDefinition xmlns="urn:locstudio">
+ <_locDefault _loc="locNone" />
+ <_locTag _loc="locData">DMF:Name
+ <_locTag _loc="locData">DMF:Description
+ <_locTag _loc="locData">DMF:Condition
+ <_locTag _loc="locData">DMF:ObjectSet
+ <_locTag _loc="locData">DMF:RootCondition
+ <_locTag _loc="locData">DMF:PolicyCategory
+ <_locTag _loc="locData">DMF:HelpText
+
+
+ urn:uuid:96fe1236-abf6-4a57-b54d-e9baab394fd1
+ http://documentcollection/
+
+
+
+
+
+
+ /system/schema/DMF
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ /PolicyStore/Policy/Windows Event Log I_/O Delay Warning
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+
+
+ /PolicyStore/Condition/I_/O Delay Warning Check
+
+
+
+
+ /PolicyStore/ObjectSet/Windows Event Log I_/O Delay Warning__ObjectSet
+
+
+
+
+ /PolicyStore/PolicyCategory/Microsoft Best Practices_b Windows Log File
+
+
+ Windows Event Log I/O Delay Warning
+ Detects Event ID 833 in the system log. This message indicates that SQL Server has issued a read or write request from disk, and that the request has taken longer than 15 seconds to return. This error is reported by SQL Server and indicates a problem with the disk I/O subsystem. Delays this long can severely limit the performance of your instance of SQL Server.
+ I/O Delay Warning Check
+ Windows Event Log I/O Delay Warning_ObjectSet
+ Microsoft Best Practices: Windows Log File
+ false
+ None
+
+ http://go.microsoft.com/fwlink/?LinkId=116375
+ 0001-01-01T00:00:00
+ 0001-01-01T00:00:00
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Windows Event Log I_/O Delay Warning__ObjectSet
+
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Windows Event Log I_/O Delay Warning__ObjectSet/TargetSet/Server
+
+
+
+
+
+ /PolicyStore
+
+
+ Windows Event Log I/O Delay Warning_ObjectSet
+ Server
+
+
+
+
+
+
+ /PolicyStore/Condition/I_/O Delay Warning Check
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>EQ</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Function><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <FunctionType>IsNull</FunctionType><?char 13?>
+ <ReturnType>Numeric</ReturnType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Function><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <FunctionType>ExecuteWql</FunctionType><?char 13?>
+ <ReturnType>Numeric</ReturnType><?char 13?>
+ <Count>3</Count><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>String</TypeClass><?char 13?>
+ <ObjType>System.String</ObjType><?char 13?>
+ <Value>Numeric</Value><?char 13?>
+ </Constant><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>String</TypeClass><?char 13?>
+ <ObjType>System.String</ObjType><?char 13?>
+ <Value>root\CIMV2</Value><?char 13?>
+ </Constant><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>String</TypeClass><?char 13?>
+ <ObjType>System.String</ObjType><?char 13?>
+ <Value>select EventCode from Win32_NTLogEvent where EventCode=833 and Logfile="System"</Value><?char 13?>
+ </Constant><?char 13?>
+ </Function><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <ObjType>System.Int32</ObjType><?char 13?>
+ <Value>0</Value><?char 13?>
+ </Constant><?char 13?>
+ </Function><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <ObjType>System.Int32</ObjType><?char 13?>
+ <Value>0</Value><?char 13?>
+ </Constant><?char 13?>
+ </Operator>
+
+ I/O Delay Warning Check
+ Confirms that an I/O delay warning (Event ID 833) does not exist in the system log.
+ Server
+
+
+
+
+
+
+ /PolicyStore/PolicyCategory/Microsoft Best Practices_b Windows Log File
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+ Microsoft Best Practices: Windows Log File
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Windows Event Log I_/O Delay Warning__ObjectSet/TargetSet/Server
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Windows Event Log I_/O Delay Warning__ObjectSet
+
+
+ Server
+ true
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/samples/features/epm-framework/sample-policies/Windows Event Log I_O Error During Hard Page Fault Error.xml b/samples/features/epm-framework/sample-policies/Windows Event Log I_O Error During Hard Page Fault Error.xml
new file mode 100644
index 00000000..91c80ed1
--- /dev/null
+++ b/samples/features/epm-framework/sample-policies/Windows Event Log I_O Error During Hard Page Fault Error.xml
@@ -0,0 +1,248 @@
+
+
+
+
+ <_locDefinition xmlns="urn:locstudio">
+ <_locDefault _loc="locNone" />
+ <_locTag _loc="locData">DMF:Name
+ <_locTag _loc="locData">DMF:Description
+ <_locTag _loc="locData">DMF:Condition
+ <_locTag _loc="locData">DMF:ObjectSet
+ <_locTag _loc="locData">DMF:RootCondition
+ <_locTag _loc="locData">DMF:PolicyCategory
+ <_locTag _loc="locData">DMF:HelpText
+
+
+ urn:uuid:96fe1236-abf6-4a57-b54d-e9baab394fd1
+ http://documentcollection/
+
+
+
+
+
+
+ /system/schema/DMF
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ /PolicyStore/Policy/Windows Event Log I_/O Error During Hard Page Fault Error
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+
+
+ /PolicyStore/Condition/I_/O Error During Hard Page Fault Error Check
+
+
+
+
+ /PolicyStore/ObjectSet/Windows Event Log I_/O Error During Hard Page Fault Error__ObjectSet
+
+
+
+
+ /PolicyStore/PolicyCategory/Microsoft Best Practices_b Windows Log File
+
+
+ Windows Event Log I/O Error During Hard Page Fault Error
+
+ DetectsI/O Error during hard page fault in System Log.<?char 13?>
+ http://support.microsoft.com/kb/304415 <?char 13?>
+ http://support.microsoft.com/kb/305547<?char 13?>
+
+ I/O Error During Hard Page Fault Error Check
+ Windows Event Log I/O Error During Hard Page Fault Error_ObjectSet
+ Microsoft Best Practices: Windows Log File
+ false
+ None
+
+ http://go.microsoft.com/fwlink/?LinkId=116355
+ 0001-01-01T00:00:00
+ 0001-01-01T00:00:00
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Windows Event Log I_/O Error During Hard Page Fault Error__ObjectSet
+
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Windows Event Log I_/O Error During Hard Page Fault Error__ObjectSet/TargetSet/Server
+
+
+
+
+
+ /PolicyStore
+
+
+ Windows Event Log I/O Error During Hard Page Fault Error_ObjectSet
+ Server
+
+
+
+
+
+
+ /PolicyStore/Condition/I_/O Error During Hard Page Fault Error Check
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>EQ</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Function><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <FunctionType>IsNull</FunctionType><?char 13?>
+ <ReturnType>Numeric</ReturnType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Function><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <FunctionType>ExecuteWql</FunctionType><?char 13?>
+ <ReturnType>Numeric</ReturnType><?char 13?>
+ <Count>3</Count><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>String</TypeClass><?char 13?>
+ <ObjType>System.String</ObjType><?char 13?>
+ <Value>Numeric</Value><?char 13?>
+ </Constant><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>String</TypeClass><?char 13?>
+ <ObjType>System.String</ObjType><?char 13?>
+ <Value>root\CIMV2</Value><?char 13?>
+ </Constant><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>String</TypeClass><?char 13?>
+ <ObjType>System.String</ObjType><?char 13?>
+ <Value>select EventCode from Win32_NTLogEvent where EventCode=51 and Logfile="System"</Value><?char 13?>
+ </Constant><?char 13?>
+ </Function><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <ObjType>System.Int32</ObjType><?char 13?>
+ <Value>0</Value><?char 13?>
+ </Constant><?char 13?>
+ </Function><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <ObjType>System.Int32</ObjType><?char 13?>
+ <Value>0</Value><?char 13?>
+ </Constant><?char 13?>
+ </Operator>
+
+ I/O Error During Hard Page Fault Error Check
+ Confirms that an I/O Error during hard page fault (Event ID – 51) does not exist in the system log.
+ Server
+
+
+
+
+
+
+ /PolicyStore/PolicyCategory/Microsoft Best Practices_b Windows Log File
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+ Microsoft Best Practices: Windows Log File
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Windows Event Log I_/O Error During Hard Page Fault Error__ObjectSet/TargetSet/Server
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Windows Event Log I_/O Error During Hard Page Fault Error__ObjectSet
+
+
+ Server
+ true
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/samples/features/epm-framework/sample-policies/Windows Event Log Read Retry Error.xml b/samples/features/epm-framework/sample-policies/Windows Event Log Read Retry Error.xml
new file mode 100644
index 00000000..6ecf9259
--- /dev/null
+++ b/samples/features/epm-framework/sample-policies/Windows Event Log Read Retry Error.xml
@@ -0,0 +1,244 @@
+
+
+
+
+ <_locDefinition xmlns="urn:locstudio">
+ <_locDefault _loc="locNone" />
+ <_locTag _loc="locData">DMF:Name
+ <_locTag _loc="locData">DMF:Description
+ <_locTag _loc="locData">DMF:Condition
+ <_locTag _loc="locData">DMF:ObjectSet
+ <_locTag _loc="locData">DMF:RootCondition
+ <_locTag _loc="locData">DMF:PolicyCategory
+ <_locTag _loc="locData">DMF:HelpText
+
+
+ urn:uuid:96fe1236-abf6-4a57-b54d-e9baab394fd1
+ http://documentcollection/
+
+
+
+
+
+
+ /system/schema/DMF
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ /PolicyStore/Policy/Windows Event Log Read Retry Error
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+
+
+ /PolicyStore/Condition/Read Retry Error Check
+
+
+
+
+ /PolicyStore/ObjectSet/Windows Event Log Read Retry Error__ObjectSet
+
+
+
+
+ /PolicyStore/PolicyCategory/Microsoft Best Practices_b Windows Log File
+
+
+ Windows Event Log Read Retry Error
+ Detects Error Event ID 825 in the system log. This error message indicates that SQL Server could not read data from the disk on the first try. This message indicates a major problem with the disk I/O subsystem, not with SQL Server itself. However, the disk problem can cause data loss or database corruption if it is not resolved.
+ Read Retry Error Check
+ Windows Event Log Read Retry Error_ObjectSet
+ Microsoft Best Practices: Windows Log File
+ false
+ None
+
+ http://go.microsoft.com/fwlink/?LinkId=116339
+ 0001-01-01T00:00:00
+ 0001-01-01T00:00:00
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Windows Event Log Read Retry Error__ObjectSet
+
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Windows Event Log Read Retry Error__ObjectSet/TargetSet/Server
+
+
+
+
+
+ /PolicyStore
+
+
+ Windows Event Log Read Retry Error_ObjectSet
+ Server
+
+
+
+
+
+
+ /PolicyStore/Condition/Read Retry Error Check
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>EQ</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Function><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <FunctionType>IsNull</FunctionType><?char 13?>
+ <ReturnType>Numeric</ReturnType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Function><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <FunctionType>ExecuteWql</FunctionType><?char 13?>
+ <ReturnType>Numeric</ReturnType><?char 13?>
+ <Count>3</Count><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>String</TypeClass><?char 13?>
+ <ObjType>System.String</ObjType><?char 13?>
+ <Value>Numeric</Value><?char 13?>
+ </Constant><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>String</TypeClass><?char 13?>
+ <ObjType>System.String</ObjType><?char 13?>
+ <Value>root\CIMV2</Value><?char 13?>
+ </Constant><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>String</TypeClass><?char 13?>
+ <ObjType>System.String</ObjType><?char 13?>
+ <Value>select EventCode from Win32_NTLogEvent where EventCode=825 and Logfile="System"</Value><?char 13?>
+ </Constant><?char 13?>
+ </Function><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <ObjType>System.Int32</ObjType><?char 13?>
+ <Value>0</Value><?char 13?>
+ </Constant><?char 13?>
+ </Function><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <ObjType>System.Int32</ObjType><?char 13?>
+ <Value>0</Value><?char 13?>
+ </Constant><?char 13?>
+ </Operator>
+
+ Read Retry Error Check
+ Confirms that read retry issues (Event ID 825) do not exist in the system log.
+ Server
+
+
+
+
+
+
+ /PolicyStore/PolicyCategory/Microsoft Best Practices_b Windows Log File
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+ Microsoft Best Practices: Windows Log File
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Windows Event Log Read Retry Error__ObjectSet/TargetSet/Server
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Windows Event Log Read Retry Error__ObjectSet
+
+
+ Server
+ true
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/samples/features/epm-framework/sample-policies/Windows Event Log Storage System I_O Timeout Error.xml b/samples/features/epm-framework/sample-policies/Windows Event Log Storage System I_O Timeout Error.xml
new file mode 100644
index 00000000..77b46f32
--- /dev/null
+++ b/samples/features/epm-framework/sample-policies/Windows Event Log Storage System I_O Timeout Error.xml
@@ -0,0 +1,248 @@
+
+
+
+
+ <_locDefinition xmlns="urn:locstudio">
+ <_locDefault _loc="locNone" />
+ <_locTag _loc="locData">DMF:Name
+ <_locTag _loc="locData">DMF:Description
+ <_locTag _loc="locData">DMF:Condition
+ <_locTag _loc="locData">DMF:ObjectSet
+ <_locTag _loc="locData">DMF:RootCondition
+ <_locTag _loc="locData">DMF:PolicyCategory
+ <_locTag _loc="locData">DMF:HelpText
+
+
+ urn:uuid:96fe1236-abf6-4a57-b54d-e9baab394fd1
+ http://documentcollection/
+
+
+
+
+
+
+ /system/schema/DMF
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ /PolicyStore/Policy/Windows Event Log Storage System I_/O Timeout Error
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+
+
+ /PolicyStore/Condition/Storage System I_/O Timeout Error Check
+
+
+
+
+ /PolicyStore/ObjectSet/Windows Event Log Storage System I_/O Timeout Error__ObjectSet
+
+
+
+
+ /PolicyStore/PolicyCategory/Microsoft Best Practices_b Windows Log File
+
+
+ Windows Event Log Storage System I/O Timeout Error
+
+ Detects Error EventID –9 in the System Log. This error indicates that I/O time-out has occurred within the storage system, as detected from the driver for the controller. <?char 13?>
+ http://support.microsoft.com/kb/259237 <?char 13?>
+ http://support.microsoft.com/kb/154690
+
+ Storage System I/O Timeout Error Check
+ Windows Event Log Storage System I/O Timeout Error_ObjectSet
+ Microsoft Best Practices: Windows Log File
+ false
+ None
+
+ http://go.microsoft.com/fwlink/?LinkId=116330
+ 0001-01-01T00:00:00
+ 0001-01-01T00:00:00
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Windows Event Log Storage System I_/O Timeout Error__ObjectSet
+
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Windows Event Log Storage System I_/O Timeout Error__ObjectSet/TargetSet/Server
+
+
+
+
+
+ /PolicyStore
+
+
+ Windows Event Log Storage System I/O Timeout Error_ObjectSet
+ Server
+
+
+
+
+
+
+ /PolicyStore/Condition/Storage System I_/O Timeout Error Check
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>EQ</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Function><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <FunctionType>IsNull</FunctionType><?char 13?>
+ <ReturnType>Numeric</ReturnType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Function><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <FunctionType>ExecuteWql</FunctionType><?char 13?>
+ <ReturnType>Numeric</ReturnType><?char 13?>
+ <Count>3</Count><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>String</TypeClass><?char 13?>
+ <ObjType>System.String</ObjType><?char 13?>
+ <Value>Numeric</Value><?char 13?>
+ </Constant><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>String</TypeClass><?char 13?>
+ <ObjType>System.String</ObjType><?char 13?>
+ <Value>root\CIMV2</Value><?char 13?>
+ </Constant><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>String</TypeClass><?char 13?>
+ <ObjType>System.String</ObjType><?char 13?>
+ <Value>select EventCode from Win32_NTLogEvent where EventCode=9 and Logfile="System"</Value><?char 13?>
+ </Constant><?char 13?>
+ </Function><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <ObjType>System.Int32</ObjType><?char 13?>
+ <Value>0</Value><?char 13?>
+ </Constant><?char 13?>
+ </Function><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <ObjType>System.Int32</ObjType><?char 13?>
+ <Value>0</Value><?char 13?>
+ </Constant><?char 13?>
+ </Operator>
+
+ Storage System I/O Timeout Error Check
+ Confirms that an I/O time-out event error (Event ID -9) does not exist in the system log.
+ Server
+
+
+
+
+
+
+ /PolicyStore/PolicyCategory/Microsoft Best Practices_b Windows Log File
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+ Microsoft Best Practices: Windows Log File
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Windows Event Log Storage System I_/O Timeout Error__ObjectSet/TargetSet/Server
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Windows Event Log Storage System I_/O Timeout Error__ObjectSet
+
+
+ Server
+ true
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/samples/features/epm-framework/sample-policies/Windows Event Log System Failure Error.xml b/samples/features/epm-framework/sample-policies/Windows Event Log System Failure Error.xml
new file mode 100644
index 00000000..81b7162d
--- /dev/null
+++ b/samples/features/epm-framework/sample-policies/Windows Event Log System Failure Error.xml
@@ -0,0 +1,244 @@
+
+
+
+
+ <_locDefinition xmlns="urn:locstudio">
+ <_locDefault _loc="locNone" />
+ <_locTag _loc="locData">DMF:Name
+ <_locTag _loc="locData">DMF:Description
+ <_locTag _loc="locData">DMF:Condition
+ <_locTag _loc="locData">DMF:ObjectSet
+ <_locTag _loc="locData">DMF:RootCondition
+ <_locTag _loc="locData">DMF:PolicyCategory
+ <_locTag _loc="locData">DMF:HelpText
+
+
+ urn:uuid:96fe1236-abf6-4a57-b54d-e9baab394fd1
+ http://documentcollection/
+
+
+
+
+
+
+ /system/schema/DMF
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ /PolicyStore/Policy/Windows Event Log System Failure Error
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+
+
+ /PolicyStore/Condition/System Failure Error Check
+
+
+
+
+ /PolicyStore/ObjectSet/Windows Event Log System Failure Error__ObjectSet
+
+
+
+
+ /PolicyStore/PolicyCategory/Microsoft Best Practices_b Windows Log File
+
+
+ Windows Event Log System Failure Error
+ Detects Error Event ID 6008 in the System Log. This error indicates an unexpected system shutdown. The system might be unstable and might not provide the stability and integrity that is required to host an instance of SQL Server. If it is known, you should address the root cause of the unexpected server restarts. Otherwise, move the instance of SQL Server to another computer.
+ System Failure Error Check
+ Windows Event Log System Failure Error_ObjectSet
+ Microsoft Best Practices: Windows Log File
+ false
+ None
+
+ http://go.microsoft.com/fwlink/?LinkId=116326
+ 0001-01-01T00:00:00
+ 0001-01-01T00:00:00
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Windows Event Log System Failure Error__ObjectSet
+
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Windows Event Log System Failure Error__ObjectSet/TargetSet/Server
+
+
+
+
+
+ /PolicyStore
+
+
+ Windows Event Log System Failure Error_ObjectSet
+ Server
+
+
+
+
+
+
+ /PolicyStore/Condition/System Failure Error Check
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+
+ <Operator><?char 13?>
+ <TypeClass>Bool</TypeClass><?char 13?>
+ <OpType>EQ</OpType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Function><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <FunctionType>IsNull</FunctionType><?char 13?>
+ <ReturnType>Numeric</ReturnType><?char 13?>
+ <Count>2</Count><?char 13?>
+ <Function><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <FunctionType>ExecuteWql</FunctionType><?char 13?>
+ <ReturnType>Numeric</ReturnType><?char 13?>
+ <Count>3</Count><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>String</TypeClass><?char 13?>
+ <ObjType>System.String</ObjType><?char 13?>
+ <Value>Numeric</Value><?char 13?>
+ </Constant><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>String</TypeClass><?char 13?>
+ <ObjType>System.String</ObjType><?char 13?>
+ <Value>root\CIMV2</Value><?char 13?>
+ </Constant><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>String</TypeClass><?char 13?>
+ <ObjType>System.String</ObjType><?char 13?>
+ <Value>select EventCode from Win32_NTLogEvent where EventCode=6008 and Logfile="System"</Value><?char 13?>
+ </Constant><?char 13?>
+ </Function><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <ObjType>System.Int32</ObjType><?char 13?>
+ <Value>0</Value><?char 13?>
+ </Constant><?char 13?>
+ </Function><?char 13?>
+ <Constant><?char 13?>
+ <TypeClass>Numeric</TypeClass><?char 13?>
+ <ObjType>System.Int32</ObjType><?char 13?>
+ <Value>0</Value><?char 13?>
+ </Constant><?char 13?>
+ </Operator>
+
+ System Failure Error Check
+ Confirms that an unexpected system shutdown error message (Event ID – 6008) does not exist in the system log.
+ Server
+
+
+
+
+
+
+ /PolicyStore/PolicyCategory/Microsoft Best Practices_b Windows Log File
+
+
+
+
+
+
+
+ /PolicyStore
+
+
+ Microsoft Best Practices: Windows Log File
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Windows Event Log System Failure Error__ObjectSet/TargetSet/Server
+
+
+
+
+
+
+
+ /PolicyStore/ObjectSet/Windows Event Log System Failure Error__ObjectSet
+
+
+ Server
+ true
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/samples/features/sql-big-data-cluster/deployment/README.md b/samples/features/sql-big-data-cluster/deployment/README.md
index b8d629e3..6793158b 100644
--- a/samples/features/sql-big-data-cluster/deployment/README.md
+++ b/samples/features/sql-big-data-cluster/deployment/README.md
@@ -19,3 +19,6 @@ Using the sample Python script in **offline** folder, you will push the necessar
Using the sample Python script in **private-aks** folder, you will Deploy SQL Server big data cluster in in your private network with Azure Kubernetes service (AKS) private cluster.
+## __[OpenShift manifests and scripts](openshift/)__
+
+Use manifests and scripts in **openshift** folder, to support SQL Server Big Data Clusters on OpenShift.
\ No newline at end of file
diff --git a/samples/features/sql-big-data-cluster/deployment/kubeadm/ubuntu-single-node-vm-ad/setup-bdc-ad.sh b/samples/features/sql-big-data-cluster/deployment/kubeadm/ubuntu-single-node-vm-ad/setup-bdc-ad.sh
index fe3a3513..f4d8a124 100644
--- a/samples/features/sql-big-data-cluster/deployment/kubeadm/ubuntu-single-node-vm-ad/setup-bdc-ad.sh
+++ b/samples/features/sql-big-data-cluster/deployment/kubeadm/ubuntu-single-node-vm-ad/setup-bdc-ad.sh
@@ -92,10 +92,8 @@ IMAGES=(
mssql-monitor-influxdb
mssql-monitor-kibana
mssql-monitor-telegraf
- mssql-security-domainctl
mssql-security-knox
mssql-security-support
- mssql-server
mssql-server-controller
mssql-server-data
mssql-ha-operator
diff --git a/samples/features/sql-big-data-cluster/deployment/kubeadm/ubuntu-single-node-vm/setup-bdc.sh b/samples/features/sql-big-data-cluster/deployment/kubeadm/ubuntu-single-node-vm/setup-bdc.sh
index 26cda1a4..f5b8076e 100644
--- a/samples/features/sql-big-data-cluster/deployment/kubeadm/ubuntu-single-node-vm/setup-bdc.sh
+++ b/samples/features/sql-big-data-cluster/deployment/kubeadm/ubuntu-single-node-vm/setup-bdc.sh
@@ -73,10 +73,8 @@ IMAGES=(
mssql-monitor-influxdb
mssql-monitor-kibana
mssql-monitor-telegraf
- mssql-security-domainctl
mssql-security-knox
mssql-security-support
- mssql-server
mssql-server-controller
mssql-server-data
mssql-ha-operator
diff --git a/samples/features/sql-big-data-cluster/deployment/offline/push-bdc-images-to-custom-private-repo.py b/samples/features/sql-big-data-cluster/deployment/offline/push-bdc-images-to-custom-private-repo.py
index 9174b102..96e37c04 100644
--- a/samples/features/sql-big-data-cluster/deployment/offline/push-bdc-images-to-custom-private-repo.py
+++ b/samples/features/sql-big-data-cluster/deployment/offline/push-bdc-images-to-custom-private-repo.py
@@ -41,10 +41,8 @@ images = ['mssql-app-service-proxy',
'mssql-monitor-influxdb'
'mssql-monitor-kibana'
'mssql-monitor-telegraf'
- 'mssql-security-domainctl'
'mssql-security-knox'
'mssql-security-support'
- 'mssql-server'
'mssql-server-controller'
'mssql-server-data'
'mssql-ha-operator'
diff --git a/samples/features/sql-big-data-cluster/deployment/openshift/bdc-scc.yaml b/samples/features/sql-big-data-cluster/deployment/openshift/bdc-scc.yaml
new file mode 100644
index 00000000..01615a1f
--- /dev/null
+++ b/samples/features/sql-big-data-cluster/deployment/openshift/bdc-scc.yaml
@@ -0,0 +1,39 @@
+apiVersion: security.openshift.io/v1
+kind: SecurityContextConstraints
+metadata:
+ annotations:
+ kubernetes.io/description: SQL Server BDC custom scc is based on 'nonroot' scc plus additional capabilities.
+ generation: 2
+ name: bdc-scc
+allowHostDirVolumePlugin: false
+allowHostIPC: false
+allowHostNetwork: false
+allowHostPID: false
+allowHostPorts: false
+allowPrivilegeEscalation: true
+allowPrivilegedContainer: false
+allowedCapabilities:
+ - SETUID
+ - SETGID
+ - CHOWN
+ - SYS_PTRACE
+defaultAddCapabilities: null
+fsGroup:
+ type: RunAsAny
+readOnlyRootFilesystem: false
+requiredDropCapabilities:
+ - KILL
+ - MKNOD
+runAsUser:
+ type: MustRunAsNonRoot
+seLinuxContext:
+ type: MustRunAs
+supplementalGroups:
+ type: RunAsAny
+volumes:
+ - configMap
+ - downwardAPI
+ - emptyDir
+ - persistentVolumeClaim
+ - projected
+ - secret
\ No newline at end of file
diff --git a/samples/features/sql-big-data-cluster/deployment/private-aks/README.md b/samples/features/sql-big-data-cluster/deployment/private-aks/README.md
index 5dc27b56..d5289dd4 100644
--- a/samples/features/sql-big-data-cluster/deployment/private-aks/README.md
+++ b/samples/features/sql-big-data-cluster/deployment/private-aks/README.md
@@ -67,7 +67,7 @@ sudo ./deploy-private-aks-udr.sh
1. Download the script on the location that you are planning to use for the deployment
``` bash
-curl --output deploy-bdc https://raw.githubusercontent.com/microsoft/sql-server-samples/master/samples/features/sql-big-data-cluster/deployment/private-aks/scripts/deploy-bdc.sh
+curl --output deploy-bdc.sh https://raw.githubusercontent.com/microsoft/sql-server-samples/master/samples/features/sql-big-data-cluster/deployment/private-aks/scripts/deploy-bdc.sh
```
2. Make the script executable
diff --git a/samples/features/sql-big-data-cluster/deployment/private-aks/scripts/deploy-bdc.sh b/samples/features/sql-big-data-cluster/deployment/private-aks/scripts/deploy-bdc.sh
index 21c5160c..90337531 100644
--- a/samples/features/sql-big-data-cluster/deployment/private-aks/scripts/deploy-bdc.sh
+++ b/samples/features/sql-big-data-cluster/deployment/private-aks/scripts/deploy-bdc.sh
@@ -25,9 +25,9 @@ azdata bdc config replace -c private-bdc-aks/control.json -j "$.spec.storage.log
azdata bdc config replace -c private-bdc-aks/control.json -j "$.spec.endpoints[0].serviceType=NodePort"
azdata bdc config replace -c private-bdc-aks/control.json -j "$.spec.endpoints[1].serviceType=NodePort"
-azdata bdc config replace -c private-bdc-aks /bdc.json -j "$.spec.resources.master.spec.endpoints[0].serviceType=NodePort"
-azdata bdc config replace -c private-bdc-aks /bdc.json -j "$.spec.resources.gateway.spec.endpoints[0].serviceType=NodePort"
-azdata bdc config replace -c private-bdc-aks /bdc.json -j "$.spec.resources.appproxy.spec.endpoints[0].serviceType=NodePort"
+azdata bdc config replace -c private-bdc-aks/bdc.json -j "$.spec.resources.master.spec.endpoints[0].serviceType=NodePort"
+azdata bdc config replace -c private-bdc-aks/bdc.json -j "$.spec.resources.gateway.spec.endpoints[0].serviceType=NodePort"
+azdata bdc config replace -c private-bdc-aks/bdc.json -j "$.spec.resources.appproxy.spec.endpoints[0].serviceType=NodePort"
#In case you're deploying BDC in HA mode ( aks-dev-test-ha profile ) please also use the following command
#azdata bdc config replace -c private-bdc-aks /bdc.json -j "$.spec.resources.master.spec.endpoints[1].serviceType=NodePort"
diff --git a/samples/features/sql-big-data-cluster/spark/config-install/installpackage_Spark.ipynb b/samples/features/sql-big-data-cluster/spark/config-install/installpackage_Spark.ipynb
index 833b2f8e..afed0633 100644
--- a/samples/features/sql-big-data-cluster/spark/config-install/installpackage_Spark.ipynb
+++ b/samples/features/sql-big-data-cluster/spark/config-install/installpackage_Spark.ipynb
@@ -57,7 +57,7 @@
"Maven packages can be installed onto your Spark cluster using notebook cell configuration at the start of your spark session. Before starting a spark session in Azure Data Studio, run the following code:\r\n",
"\r\n",
"```\r\n",
- "%%configure -f` \\\r\n",
+ "%%configure -f \\\r\n",
"{\"conf\": {\"spark.jars.packages\": \"com.microsoft.azure:azure-eventhubs-spark_2.11:2.3.1\"}}\r\n",
"```\r\n",
""
diff --git a/samples/features/ssms-templates/Sql/External Data Source/Create External Data Source.sql b/samples/features/ssms-templates/Sql/External Data Source/Create External Data Source.sql
index 55c58e8f..040244a7 100644
--- a/samples/features/ssms-templates/Sql/External Data Source/Create External Data Source.sql
+++ b/samples/features/ssms-templates/Sql/External Data Source/Create External Data Source.sql
@@ -7,7 +7,7 @@ GO
IF EXISTS (
SELECT *
FROM sys.external_data_sources
- WHERE name = N''
+ WHERE name = N''
)
DROP EXTERNAL DATA SOURCE
GO
diff --git a/samples/features/ssms-templates/Sql/External Data Source/Drop External Data Source.sql b/samples/features/ssms-templates/Sql/External Data Source/Drop External Data Source.sql
index 0b767cae..2e83e39c 100644
--- a/samples/features/ssms-templates/Sql/External Data Source/Drop External Data Source.sql
+++ b/samples/features/ssms-templates/Sql/External Data Source/Drop External Data Source.sql
@@ -6,8 +6,8 @@ GO
IF EXISTS (
SELECT *
- FROM sys.external_data_sources
- WHERE name = N''
+ FROM sys.external_data_sources
+ WHERE name = N''
)
DROP EXTERNAL DATA SOURCE
GO
\ No newline at end of file
diff --git a/samples/features/ssms-templates/Sql/SQL Azure Database/Database/Create Database.sql b/samples/features/ssms-templates/Sql/SQL Azure Database/Database/Create Database.sql
index 08c11275..eeb19c1e 100644
--- a/samples/features/ssms-templates/Sql/SQL Azure Database/Database/Create Database.sql
+++ b/samples/features/ssms-templates/Sql/SQL Azure Database/Database/Create Database.sql
@@ -1,5 +1,5 @@
-- ===================================================================================================================================
--- Create database template for Azure SQL Database and Azure SQL Data Warehouse Database
+-- Create database template for Azure SQL Database and Azure Synapse Analytics Database
--
-- This script will only run in the context of the master database. To manage this database in
-- SQL Server Management Studio, either connect to the created database, or connect to master.
@@ -9,27 +9,30 @@
-- continuity, data protection and security, and near-zero administration all backed by the power
-- and reach of Microsoft Azure.
--
--- SQL Database is available in the following service tiers: Basic, Standard, Premium , DataWarehouse, Web (Retired)
+-- SQL Database is available in the following service tiers: GeneralPurpose, Basic, Standard, Premium , DataWarehouse, Web (Retired)
-- and Business (Retired).
+-- General Purpose service tier is a default service tier in Azure SQL Database that is designed for most of the generic workloads.
+-- If you need a fully managed database engine with 99.99% SLA with storage latency between 5 and 10 ms that match Azure SQL
+-- IaaS in most of the cases, General Purpose tier is the option for you.
-- Standard is the go-to option for getting started with cloud-designed business applications and
-- offers mid-level performance and business continuity features. Performance objectives for Standard
-- deliver predictable per minute transaction rates.
--
--- See http://go.microsoft.com/fwlink/p/?LinkId=306622 for more information about Azure SQL Database.
+-- See https://go.microsoft.com/fwlink/p/?LinkId=306622 for more information about Azure SQL Database.
--
--- See http://go.microsoft.com/fwlink/?LinkId=787140 for more information about Azure SQL Data Warehouse.
+-- See https://go.microsoft.com/fwlink/?LinkId=787140 for more information about Azure Synapse Analytics.
--
--- See http://go.microsoft.com/fwlink/p/?LinkId=402063 for more information about CREATE DATABASE for Azure SQL Database.
+-- See https://go.microsoft.com/fwlink/p/?LinkId=402063 for more information about CREATE DATABASE for Azure SQL Database.
--
--- See http://go.microsoft.com/fwlink/?LinkId=787139 for more information about CREATE DATABASE for Azure SQL Data Warehouse Database.
+-- See https://go.microsoft.com/fwlink/?LinkId=787139 for more information about CREATE DATABASE for Azure Synapse Analytics Database.
-- ===================================================================================================================================
CREATE DATABASE COLLATE
(
- EDITION = '',
- SERVICE_OBJECTIVE='',
- MAXSIZE =
+ EDITION = '',
+ SERVICE_OBJECTIVE='',
+ MAXSIZE =
)
GO
diff --git a/samples/features/ssms-templates/Sql/SQL Azure Database/Database/Drop Database.sql b/samples/features/ssms-templates/Sql/SQL Azure Database/Database/Drop Database.sql
index 6b1c6790..e782dae8 100644
--- a/samples/features/ssms-templates/Sql/SQL Azure Database/Database/Drop Database.sql
+++ b/samples/features/ssms-templates/Sql/SQL Azure Database/Database/Drop Database.sql
@@ -1,5 +1,5 @@
--- ===================================================================================
--- Drop database template for Azure SQL Database and Azure SQL Data Warehouse Database
--- ===================================================================================
+-- ===================================================================================================================================
+-- Drop database template for Azure SQL Database, Azure Synapse Analytics Database, and Azure Synapse SQL Analytics on-demand Database
+-- ===================================================================================================================================
DROP DATABASE
GO
diff --git a/samples/features/ssms-templates/Sql/SQL Azure Database/External Data Source/Alter External Data Source DW.sql b/samples/features/ssms-templates/Sql/SQL Azure Database/External Data Source/Alter External Data Source DW.sql
index 77a40355..c8923004 100644
--- a/samples/features/ssms-templates/Sql/SQL Azure Database/External Data Source/Alter External Data Source DW.sql
+++ b/samples/features/ssms-templates/Sql/SQL Azure Database/External Data Source/Alter External Data Source DW.sql
@@ -1,6 +1,6 @@
--- =========================================================================
--- Alter external data source template for Azure SQL Data Warehouse Database
--- =========================================================================
+-- ========================================================================
+-- Alter external data source template for Azure Synapse Analytics Database
+-- ========================================================================
ALTER EXTERNAL DATA SOURCE SET
LOCATION = N'',
diff --git a/samples/features/ssms-templates/Sql/SQL Azure Database/External Data Source/Create External Data Source DW.sql b/samples/features/ssms-templates/Sql/SQL Azure Database/External Data Source/Create External Data Source DW.sql
index 886d87b6..1f7b36b3 100644
--- a/samples/features/ssms-templates/Sql/SQL Azure Database/External Data Source/Create External Data Source DW.sql
+++ b/samples/features/ssms-templates/Sql/SQL Azure Database/External Data Source/Create External Data Source DW.sql
@@ -1,20 +1,20 @@
--- ==========================================================================
--- Create external data source template for Azure SQL Data Warehouse Database
--- ==========================================================================
+-- =========================================================================
+-- Create external data source template for Azure Synapse Analytics Database
+-- =========================================================================
IF EXISTS (
SELECT *
- FROM sys.external_data_sources
- WHERE name = N''
+ FROM sys.external_data_sources
+ WHERE name = N''
)
DROP EXTERNAL DATA SOURCE
GO
CREATE EXTERNAL DATA SOURCE WITH
(
- TYPE = ,
- LOCATION = N'',
- RESOURCE_MANAGER_LOCATION = N'',
- CREDENTIAL =
+ TYPE = ,
+ LOCATION = N'',
+ RESOURCE_MANAGER_LOCATION = N'',
+ CREDENTIAL =
)
GO
\ No newline at end of file
diff --git a/samples/features/ssms-templates/Sql/SQL Azure Database/External Data Source/Create External Data Source.sql b/samples/features/ssms-templates/Sql/SQL Azure Database/External Data Source/Create External Data Source.sql
index 13b90e80..200cbce9 100644
--- a/samples/features/ssms-templates/Sql/SQL Azure Database/External Data Source/Create External Data Source.sql
+++ b/samples/features/ssms-templates/Sql/SQL Azure Database/External Data Source/Create External Data Source.sql
@@ -4,7 +4,7 @@
IF EXISTS (
SELECT *
FROM sys.external_data_sources
- WHERE name = N''
+ WHERE name = N''
)
DROP EXTERNAL DATA SOURCE
GO
diff --git a/samples/features/ssms-templates/Sql/SQL Azure Database/External Data Source/Drop External Data Source.sql b/samples/features/ssms-templates/Sql/SQL Azure Database/External Data Source/Drop External Data Source.sql
index 69e66fd3..1072e9f9 100644
--- a/samples/features/ssms-templates/Sql/SQL Azure Database/External Data Source/Drop External Data Source.sql
+++ b/samples/features/ssms-templates/Sql/SQL Azure Database/External Data Source/Drop External Data Source.sql
@@ -1,11 +1,11 @@
--- ===============================================================================================
--- Drop external data source template for Azure SQL Database and Azure SQL Data Warehouse Database
--- ===============================================================================================
+-- ======================================================================================================================================
+-- Drop external data source template for Azure SQL Database, Azure Synapse Analytics Database, and Azure Synapse SQL Analytics on-demand
+-- ======================================================================================================================================
IF EXISTS (
SELECT *
- FROM sys.external_data_sources
- WHERE name = N''
+ FROM sys.external_data_sources
+ WHERE name = N''
)
DROP EXTERNAL DATA SOURCE
GO
\ No newline at end of file
diff --git a/samples/features/ssms-templates/Sql/SQL Azure Database/External File Format/Create External File Format.sql b/samples/features/ssms-templates/Sql/SQL Azure Database/External File Format/Create External File Format.sql
index 6f0a5fdf..1772c506 100644
--- a/samples/features/ssms-templates/Sql/SQL Azure Database/External File Format/Create External File Format.sql
+++ b/samples/features/ssms-templates/Sql/SQL Azure Database/External File Format/Create External File Format.sql
@@ -1,6 +1,6 @@
--- ==========================================================================
--- Create external file format template for Azure SQL Data Warehouse Database
--- ==========================================================================
+-- =========================================================================
+-- Create external file format template for Azure Synapse Analytics Database
+-- =========================================================================
IF EXISTS (
SELECT *
diff --git a/samples/features/ssms-templates/Sql/SQL Azure Database/External File Format/Drop External File Format.sql b/samples/features/ssms-templates/Sql/SQL Azure Database/External File Format/Drop External File Format.sql
index e39fec07..352a5617 100644
--- a/samples/features/ssms-templates/Sql/SQL Azure Database/External File Format/Drop External File Format.sql
+++ b/samples/features/ssms-templates/Sql/SQL Azure Database/External File Format/Drop External File Format.sql
@@ -1,6 +1,6 @@
--- ========================================================================
--- Drop external file format template for Azure SQL Data Warehouse Database
--- ========================================================================
+-- ==================================================================================================================
+-- Drop external file format template for Azure Synapse Analytics Database, and Azure Synapse SQL Analytics on-demand
+-- ==================================================================================================================
IF EXISTS (
SELECT *
diff --git a/samples/features/ssms-templates/Sql/SQL Azure Database/Function/Create Scalar Function DW (New Menu).sql b/samples/features/ssms-templates/Sql/SQL Azure Database/Function/Create Scalar Function DW (New Menu).sql
index bc24016a..1827a584 100644
--- a/samples/features/ssms-templates/Sql/SQL Azure Database/Function/Create Scalar Function DW (New Menu).sql
+++ b/samples/features/ssms-templates/Sql/SQL Azure Database/Function/Create Scalar Function DW (New Menu).sql
@@ -1,6 +1,6 @@
--- =====================================================================
--- Create Scalar Function Template for Azure SQL Data Warehouse Database
--- =====================================================================
+-- ====================================================================
+-- Create Scalar Function Template for Azure Synapse Analytics Database
+-- ====================================================================
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
diff --git a/samples/features/ssms-templates/Sql/SQL Azure Database/Function/Drop Function.sql b/samples/features/ssms-templates/Sql/SQL Azure Database/Function/Drop Function.sql
index acce825a..f7b2d7cd 100644
--- a/samples/features/ssms-templates/Sql/SQL Azure Database/Function/Drop Function.sql
+++ b/samples/features/ssms-templates/Sql/SQL Azure Database/Function/Drop Function.sql
@@ -1,6 +1,6 @@
- --===================================================================================
--- Drop function template for Azure SQL Database and Azure SQL Data Warehouse Database
---====================================================================================
+ --==================================================================================
+-- Drop function template for Azure SQL Database and Azure Synapse Analytics Database
+--===================================================================================
IF OBJECT_ID (N'.') IS NOT NULL
DROP FUNCTION .
GO
diff --git a/samples/features/ssms-templates/Sql/SQL Azure Database/Index/Create Index.sql b/samples/features/ssms-templates/Sql/SQL Azure Database/Index/Create Index.sql
index 861fea58..b37b8b6f 100644
--- a/samples/features/ssms-templates/Sql/SQL Azure Database/Index/Create Index.sql
+++ b/samples/features/ssms-templates/Sql/SQL Azure Database/Index/Create Index.sql
@@ -1,6 +1,6 @@
--- ==================================================================================
--- Create index template for Azure SQL Database and Azure SQL Data Warehouse Database
--- ==================================================================================
+-- =================================================================================
+-- Create index template for Azure SQL Database and Azure Synapse Analytics Database
+-- =================================================================================
CREATE INDEX
ON .
diff --git a/samples/features/ssms-templates/Sql/SQL Azure Database/Index/Drop Index.sql b/samples/features/ssms-templates/Sql/SQL Azure Database/Index/Drop Index.sql
index 7da05954..4f8f0881 100644
--- a/samples/features/ssms-templates/Sql/SQL Azure Database/Index/Drop Index.sql
+++ b/samples/features/ssms-templates/Sql/SQL Azure Database/Index/Drop Index.sql
@@ -1,6 +1,6 @@
---========================================================================
--- Drop index template for Azure SQL Database and Azure SQL Data Warehouse
---========================================================================
+--=======================================================================
+-- Drop index template for Azure SQL Database and Azure Synapse Analytics
+--=======================================================================
IF EXISTS (
SELECT *
FROM sys.indexes
diff --git a/samples/features/ssms-templates/Sql/SQL Azure Database/Login/Create Login.sql b/samples/features/ssms-templates/Sql/SQL Azure Database/Login/Create Login.sql
index a060f492..519f58f2 100644
--- a/samples/features/ssms-templates/Sql/SQL Azure Database/Login/Create Login.sql
+++ b/samples/features/ssms-templates/Sql/SQL Azure Database/Login/Create Login.sql
@@ -1,6 +1,6 @@
--- ======================================================================================
--- Create SQL Login template for Azure SQL Database and Azure SQL Data Warehouse Database
--- ======================================================================================
+-- =============================================================================================================================
+-- Create SQL Login template for Azure SQL Database, Azure Synapse Analytics Database, and Azure Synapse SQL Analytics on-demand
+-- =============================================================================================================================
CREATE LOGIN
WITH PASSWORD = ''
diff --git a/samples/features/ssms-templates/Sql/SQL Azure Database/Login/Drop Login.sql b/samples/features/ssms-templates/Sql/SQL Azure Database/Login/Drop Login.sql
index ce390455..ed021dd8 100644
--- a/samples/features/ssms-templates/Sql/SQL Azure Database/Login/Drop Login.sql
+++ b/samples/features/ssms-templates/Sql/SQL Azure Database/Login/Drop Login.sql
@@ -1,6 +1,6 @@
--- ====================================================================================
--- Drop SQL Login template for Azure SQL Database and Azure SQL Data Warehouse Database
--- ====================================================================================
+-- ===========================================================================================================================
+-- Drop SQL Login template for Azure SQL Database, Azure Synapse Analytics Database, and Azure Synapse SQL Analytics on-demand
+-- ===========================================================================================================================
DROP LOGIN
Go
diff --git a/samples/features/ssms-templates/Sql/SQL Azure Database/Role/Create Role.sql b/samples/features/ssms-templates/Sql/SQL Azure Database/Role/Create Role.sql
index 216bc3de..174dd2bb 100644
--- a/samples/features/ssms-templates/Sql/SQL Azure Database/Role/Create Role.sql
+++ b/samples/features/ssms-templates/Sql/SQL Azure Database/Role/Create Role.sql
@@ -1,6 +1,6 @@
--- ==========================================================================================
--- Create Database Role template for Azure SQL Database and Azure SQL Data Warehouse Database
--- ==========================================================================================
+-- =========================================================================================
+-- Create Database Role template for Azure SQL Database and Azure Synapse Analytics Database
+-- =========================================================================================
-- Create the database role
CREATE ROLE AUTHORIZATION [dbo]
GO
diff --git a/samples/features/ssms-templates/Sql/SQL Azure Database/Role/Drop Role.sql b/samples/features/ssms-templates/Sql/SQL Azure Database/Role/Drop Role.sql
index 2f00d1ec..ae45b76b 100644
--- a/samples/features/ssms-templates/Sql/SQL Azure Database/Role/Drop Role.sql
+++ b/samples/features/ssms-templates/Sql/SQL Azure Database/Role/Drop Role.sql
@@ -1,6 +1,6 @@
--- ========================================================================================
--- Drop Database Role template for Azure SQL Database and Azure SQL Data Warehouse Database
--- ========================================================================================
+-- ===============================================================================================================================
+-- Drop Database Role template for Azure SQL Database, Azure Synapse Analytics Database, and Azure Synapse SQL Analytics on-demand
+-- ===============================================================================================================================
-- Drop the role
DROP ROLE ;
diff --git a/samples/features/ssms-templates/Sql/SQL Azure Database/Schema/Create Schema.sql b/samples/features/ssms-templates/Sql/SQL Azure Database/Schema/Create Schema.sql
index 5db793fa..a1f5fa84 100644
--- a/samples/features/ssms-templates/Sql/SQL Azure Database/Schema/Create Schema.sql
+++ b/samples/features/ssms-templates/Sql/SQL Azure Database/Schema/Create Schema.sql
@@ -1,6 +1,6 @@
--- ===================================================================================
--- Create Schema Template for Azure SQL Database and Azure SQL Data Warehouse Database
--- ===================================================================================
+-- ==========================================================================================================================
+-- Create Schema Template for Azure SQL Database, Azure Synapse Analytics Database, and Azure Synapse SQL Analytics on-demand
+-- ==========================================================================================================================
CREATE SCHEMA
AUTHORIZATION
diff --git a/samples/features/ssms-templates/Sql/SQL Azure Database/Schema/Drop Schema.sql b/samples/features/ssms-templates/Sql/SQL Azure Database/Schema/Drop Schema.sql
index ca204aba..60862187 100644
--- a/samples/features/ssms-templates/Sql/SQL Azure Database/Schema/Drop Schema.sql
+++ b/samples/features/ssms-templates/Sql/SQL Azure Database/Schema/Drop Schema.sql
@@ -1,6 +1,6 @@
---==================================================================================
--- Drop Schema template for Azure SQL Database and Azure SQL Data Warehouse Database
---==================================================================================
+--=========================================================================================================================
+-- Drop Schema template for Azure SQL Database, Azure Synapse Analytics Database, and Azure Synapse SQL Analytics on-demand
+--=========================================================================================================================
IF EXISTS(
SELECT *
FROM sys.schemas
diff --git a/samples/features/ssms-templates/Sql/SQL Azure Database/Statistics/Create Statistics.sql b/samples/features/ssms-templates/Sql/SQL Azure Database/Statistics/Create Statistics.sql
index 8010ace8..61e49403 100644
--- a/samples/features/ssms-templates/Sql/SQL Azure Database/Statistics/Create Statistics.sql
+++ b/samples/features/ssms-templates/Sql/SQL Azure Database/Statistics/Create Statistics.sql
@@ -1,6 +1,6 @@
--- ===============================================================================================
--- Create Sampled Statistics Template for Azure SQL Database and Azure SQL Data Warehouse Database
--- ===============================================================================================
+-- ======================================================================================================================================
+-- Create Sampled Statistics Template for Azure SQL Database, Azure Synapse Analytics Database, and Azure Synapse SQL Analytics on-demand
+-- ======================================================================================================================================
CREATE STATISTICS
ON .
(
diff --git a/samples/features/ssms-templates/Sql/SQL Azure Database/Statistics/Drop Statistics.sql b/samples/features/ssms-templates/Sql/SQL Azure Database/Statistics/Drop Statistics.sql
index be0d700a..bbc6cf1c 100644
--- a/samples/features/ssms-templates/Sql/SQL Azure Database/Statistics/Drop Statistics.sql
+++ b/samples/features/ssms-templates/Sql/SQL Azure Database/Statistics/Drop Statistics.sql
@@ -1,6 +1,6 @@
---======================================================================================
--- Drop Statistics template for Azure SQL Database and Azure SQL Data Warehouse Database
---======================================================================================
+--=============================================================================================================================
+-- Drop Statistics template for Azure SQL Database, Azure Synapse Analytics Database, and Azure Synapse SQL Analytics on-demand
+--=============================================================================================================================
IF EXISTS (
SELECT *
FROM sys.stats as st
diff --git a/samples/features/ssms-templates/Sql/SQL Azure Database/Stored Procedure/Create Stored Procedure DW (New Menu).sql b/samples/features/ssms-templates/Sql/SQL Azure Database/Stored Procedure/Create Stored Procedure DW (New Menu).sql
index a723c18f..cb919301 100644
--- a/samples/features/ssms-templates/Sql/SQL Azure Database/Stored Procedure/Create Stored Procedure DW (New Menu).sql
+++ b/samples/features/ssms-templates/Sql/SQL Azure Database/Stored Procedure/Create Stored Procedure DW (New Menu).sql
@@ -1,6 +1,6 @@
--- ======================================================================
--- Create Stored Procedure Template for Azure SQL Data Warehouse Database
--- ======================================================================
+-- =====================================================================
+-- Create Stored Procedure Template for Azure Synapse Analytics Database
+-- =====================================================================
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
diff --git a/samples/features/ssms-templates/Sql/SQL Azure Database/Stored Procedure/Drop Stored Procedure.sql b/samples/features/ssms-templates/Sql/SQL Azure Database/Stored Procedure/Drop Stored Procedure.sql
index 8914ee50..7af30c9e 100644
--- a/samples/features/ssms-templates/Sql/SQL Azure Database/Stored Procedure/Drop Stored Procedure.sql
+++ b/samples/features/ssms-templates/Sql/SQL Azure Database/Stored Procedure/Drop Stored Procedure.sql
@@ -1,6 +1,6 @@
--- ===========================================================================================
--- Drop Stored Procedure Template for Azure SQL Database and Azure SQL Data Warehouse Database
--- ===========================================================================================
+-- ==========================================================================================
+-- Drop Stored Procedure Template for Azure SQL Database and Azure Synapse Analytics Database
+-- ==========================================================================================
-- Drop stored procedure if it already exists
IF EXISTS (
diff --git a/samples/features/ssms-templates/Sql/SQL Azure Database/Table/Create External Table DW.sql b/samples/features/ssms-templates/Sql/SQL Azure Database/Table/Create External Table DW.sql
index ff56e788..753e1079 100644
--- a/samples/features/ssms-templates/Sql/SQL Azure Database/Table/Create External Table DW.sql
+++ b/samples/features/ssms-templates/Sql/SQL Azure Database/Table/Create External Table DW.sql
@@ -1,6 +1,6 @@
--- ====================================================================
--- Create External Table Template for Azure SQL Data Warehouse Database
--- ====================================================================
+-- ===================================================================
+-- Create External Table Template for Azure Synapse Analytics Database
+-- ===================================================================
IF OBJECT_ID('.', 'U') IS NOT NULL
DROP EXTERNAL TABLE .
diff --git a/samples/features/ssms-templates/Sql/SQL Azure Database/Table/Create Graph Edge Table.sql b/samples/features/ssms-templates/Sql/SQL Azure Database/Table/Create Graph Edge Table.sql
index 9c520ee5..d3967030 100644
--- a/samples/features/ssms-templates/Sql/SQL Azure Database/Table/Create Graph Edge Table.sql
+++ b/samples/features/ssms-templates/Sql/SQL Azure Database/Table/Create Graph Edge Table.sql
@@ -1,24 +1,32 @@
-- =========================================
--- Create Graph Edge Template
+-- Create Graph Edge Table Template
-- =========================================
+USE
+GO
-IF OBJECT_ID('.', 'U') IS NOT NULL
- DROP TABLE .
+DROP TABLE IF EXISTS .
GO
CREATE TABLE .
(
- -- Columns are optional for Edge Tables.
+ -- Columns are optional for Graph Edge Tables.
--
,
,
,
+ -- System generated edge constraint.
+ --
+ CONNECTION (),
+
+ CONSTRAINT EC_ CONNECTION (, TO ),
-- Unique index on $edge_id is required.
- -- If no user-defined index is specified, a default index is created instead.
+ -- If no user-defined index is specified, a default index is created.
+ --
INDEX ix_graphid UNIQUE ($edge_id),
-- indexes on $from_id and $to_id are optional, but support faster lookups.
+ --
INDEX ix_fromid ($from_id, $to_id),
INDEX ix_toid ($to_id, $from_id)
)
diff --git a/samples/features/ssms-templates/Sql/SQL Azure Database/Table/Create SQL DW Partitioned Table.sql b/samples/features/ssms-templates/Sql/SQL Azure Database/Table/Create SQL DW Partitioned Table.sql
index 6762010e..ad6873dd 100644
--- a/samples/features/ssms-templates/Sql/SQL Azure Database/Table/Create SQL DW Partitioned Table.sql
+++ b/samples/features/ssms-templates/Sql/SQL Azure Database/Table/Create SQL DW Partitioned Table.sql
@@ -1,6 +1,6 @@
--- =======================================================================
--- Create Partitioned Table Template for Azure SQL Data Warehouse Database
--- =======================================================================
+-- ======================================================================
+-- Create Partitioned Table Template for Azure Synapse Analytics Database
+-- ======================================================================
IF OBJECT_ID('.', 'U') IS NOT NULL
DROP TABLE .
diff --git a/samples/features/ssms-templates/Sql/SQL Azure Database/Table/Create SQL DW Table.sql b/samples/features/ssms-templates/Sql/SQL Azure Database/Table/Create SQL DW Table.sql
index ee646172..ad8859e6 100644
--- a/samples/features/ssms-templates/Sql/SQL Azure Database/Table/Create SQL DW Table.sql
+++ b/samples/features/ssms-templates/Sql/SQL Azure Database/Table/Create SQL DW Table.sql
@@ -1,6 +1,6 @@
--- ===========================================================
--- Create Table Template for Azure SQL Data Warehouse Database
--- ===========================================================
+-- ==========================================================
+-- Create Table Template for Azure Synapse Analytics Database
+-- ==========================================================
IF OBJECT_ID('.', 'U') IS NOT NULL
DROP TABLE .
diff --git a/samples/features/ssms-templates/Sql/SQL Azure Database/Table/Create System-Versioned Table.sql b/samples/features/ssms-templates/Sql/SQL Azure Database/Table/Create System-Versioned Table.sql
index fff691c8..2496fbf9 100644
--- a/samples/features/ssms-templates/Sql/SQL Azure Database/Table/Create System-Versioned Table.sql
+++ b/samples/features/ssms-templates/Sql/SQL Azure Database/Table/Create System-Versioned Table.sql
@@ -13,7 +13,7 @@
BEGIN
--If table is system-versioned, SYSTEM_VERSIONING must be set to OFF first
- IF ((SELECT temporal_type FROM SYS.TABLES WHERE object_id = OBJECT_ID('.', 'U')) = 2)
+ IF ((SELECT temporal_type FROM sys.tables WHERE object_id = OBJECT_ID('.', 'U')) = 2)
BEGIN
ALTER TABLE [].[] SET (SYSTEM_VERSIONING = OFF)
END
diff --git a/samples/features/ssms-templates/Sql/SQL Azure Database/Table/Drop External Table.sql b/samples/features/ssms-templates/Sql/SQL Azure Database/Table/Drop External Table.sql
index 1bb161fa..fad276b0 100644
--- a/samples/features/ssms-templates/Sql/SQL Azure Database/Table/Drop External Table.sql
+++ b/samples/features/ssms-templates/Sql/SQL Azure Database/Table/Drop External Table.sql
@@ -1,6 +1,6 @@
---==========================================================================================
--- Drop External Table template for Azure SQL Database and Azure SQL Data Warehouse Database
---==========================================================================================
+--=================================================================================================================================
+-- Drop External Table template for Azure SQL Database, Azure Synapse Analytics Database, and Azure Synapse SQL Analytics on-demand
+--=================================================================================================================================
IF EXISTS (
SELECT *
FROM sys.tables
diff --git a/samples/features/ssms-templates/Sql/SQL Azure Database/Table/Drop Table.sql b/samples/features/ssms-templates/Sql/SQL Azure Database/Table/Drop Table.sql
index 7758c8b9..8bca0fcf 100644
--- a/samples/features/ssms-templates/Sql/SQL Azure Database/Table/Drop Table.sql
+++ b/samples/features/ssms-templates/Sql/SQL Azure Database/Table/Drop Table.sql
@@ -1,6 +1,6 @@
---=================================================================================
--- Drop Table template for Azure SQL Database and Azure SQL Data Warehouse Database
---=================================================================================
+--================================================================================
+-- Drop Table template for Azure SQL Database and Azure Synapse Analytics Database
+--================================================================================
IF EXISTS (
SELECT *
FROM sys.tables
diff --git a/samples/features/ssms-templates/Sql/SQL Azure Database/User/Create User.sql b/samples/features/ssms-templates/Sql/SQL Azure Database/User/Create User.sql
index 61de5bf7..cb838af2 100644
--- a/samples/features/ssms-templates/Sql/SQL Azure Database/User/Create User.sql
+++ b/samples/features/ssms-templates/Sql/SQL Azure Database/User/Create User.sql
@@ -1,6 +1,6 @@
--- ========================================================================================
--- Create User as DBO template for Azure SQL Database and Azure SQL Data Warehouse Database
--- ========================================================================================
+-- =======================================================================================
+-- Create User as DBO template for Azure SQL Database and Azure Synapse Analytics Database
+-- =======================================================================================
-- For login , create a user in the database
CREATE USER
FOR LOGIN
diff --git a/samples/features/ssms-templates/Sql/SQL Azure Database/User/Drop User.sql b/samples/features/ssms-templates/Sql/SQL Azure Database/User/Drop User.sql
index f1a830b4..f21cca8a 100644
--- a/samples/features/ssms-templates/Sql/SQL Azure Database/User/Drop User.sql
+++ b/samples/features/ssms-templates/Sql/SQL Azure Database/User/Drop User.sql
@@ -1,5 +1,5 @@
--- ========================================================================================
--- Create User as DBO template for Azure SQL Database and Azure SQL Data Warehouse Database
--- ========================================================================================
+-- ===============================================================================================================================
+-- Create User as DBO template for Azure SQL Database, Azure Synapse Analytics Database, and Azure Synapse SQL Analytics on-demand
+-- ===============================================================================================================================
DROP USER
GO
diff --git a/samples/features/ssms-templates/Sql/SQL Azure Database/View/Create View.sql b/samples/features/ssms-templates/Sql/SQL Azure Database/View/Create View.sql
index 93570399..151b4106 100644
--- a/samples/features/ssms-templates/Sql/SQL Azure Database/View/Create View.sql
+++ b/samples/features/ssms-templates/Sql/SQL Azure Database/View/Create View.sql
@@ -1,6 +1,6 @@
--- =================================================================================
--- Create View template for Azure SQL Database and Azure SQL Data Warehouse Database
--- =================================================================================
+-- ================================================================================
+-- Create View template for Azure SQL Database and Azure Synapse Analytics Database
+-- ================================================================================
IF object_id(N'.', 'V') IS NOT NULL
DROP VIEW .
diff --git a/samples/features/ssms-templates/Sql/SQL Azure Database/View/Drop View.sql b/samples/features/ssms-templates/Sql/SQL Azure Database/View/Drop View.sql
index a5aeb66f..b65c8345 100644
--- a/samples/features/ssms-templates/Sql/SQL Azure Database/View/Drop View.sql
+++ b/samples/features/ssms-templates/Sql/SQL Azure Database/View/Drop View.sql
@@ -1,6 +1,6 @@
---================================================================================
--- Drop View template for Azure SQL Database and Azure SQL Data Warehouse Database
---================================================================================
+--=======================================================================================================================
+-- Drop View template for Azure SQL Database, Azure Synapse Analytics Database, and Azure Synapse SQL Analytics on-demand
+--=======================================================================================================================
IF EXISTS (
SELECT *
FROM sys.views
diff --git a/samples/features/ssms-templates/Sql/Table/Create Graph Edge Table.sql b/samples/features/ssms-templates/Sql/Table/Create Graph Edge Table.sql
index c56b10e4..d3967030 100644
--- a/samples/features/ssms-templates/Sql/Table/Create Graph Edge Table.sql
+++ b/samples/features/ssms-templates/Sql/Table/Create Graph Edge Table.sql
@@ -1,26 +1,32 @@
-- =========================================
--- Create Graph Edge Template
+-- Create Graph Edge Table Template
-- =========================================
USE
GO
-IF OBJECT_ID('.', 'U') IS NOT NULL
- DROP TABLE .
+DROP TABLE IF EXISTS .
GO
CREATE TABLE .
(
- -- Columns are optional for Edge Tables.
+ -- Columns are optional for Graph Edge Tables.
--
,
,
,
+ -- System generated edge constraint.
+ --
+ CONNECTION (),
+
+ CONSTRAINT EC_ CONNECTION (, TO ),
-- Unique index on $edge_id is required.
-- If no user-defined index is specified, a default index is created.
+ --
INDEX ix_graphid UNIQUE ($edge_id),
-- indexes on $from_id and $to_id are optional, but support faster lookups.
+ --
INDEX ix_fromid ($from_id, $to_id),
INDEX ix_toid ($to_id, $from_id)
)
diff --git a/samples/features/ssms-templates/Sql/Table/Create Memory Optimized System-Versioned Table.sql b/samples/features/ssms-templates/Sql/Table/Create Memory Optimized System-Versioned Table.sql
index 2061a1cd..371dfa33 100644
--- a/samples/features/ssms-templates/Sql/Table/Create Memory Optimized System-Versioned Table.sql
+++ b/samples/features/ssms-templates/Sql/Table/Create Memory Optimized System-Versioned Table.sql
@@ -19,7 +19,7 @@ USE
GO
BEGIN
- IF ((SELECT temporal_type FROM SYS.TABLES WHERE object_id = OBJECT_ID('.', 'U')) = 2)
+ IF ((SELECT temporal_type FROM sys.tables WHERE object_id = OBJECT_ID('.', 'U')) = 2)
BEGIN
ALTER TABLE [].[] SET (SYSTEM_VERSIONING = OFF)
END
diff --git a/samples/features/ssms-templates/Sql/Table/Create System-Versioned Table.sql b/samples/features/ssms-templates/Sql/Table/Create System-Versioned Table.sql
index 420f0300..58231ac6 100644
--- a/samples/features/ssms-templates/Sql/Table/Create System-Versioned Table.sql
+++ b/samples/features/ssms-templates/Sql/Table/Create System-Versioned Table.sql
@@ -16,7 +16,7 @@ GO
BEGIN
--If table is system-versioned, SYSTEM_VERSIONING must be set to OFF first
- IF ((SELECT temporal_type FROM SYS.TABLES WHERE object_id = OBJECT_ID('.', 'U')) = 2)
+ IF ((SELECT temporal_type FROM sys.tables WHERE object_id = OBJECT_ID('.', 'U')) = 2)
BEGIN
ALTER TABLE [].[] SET (SYSTEM_VERSIONING = OFF)
END
diff --git a/samples/features/ssms-templates/Sql/Table/drop constraint.sql b/samples/features/ssms-templates/Sql/Table/drop constraint.sql
index 893d85fa..15c30a7b 100644
--- a/samples/features/ssms-templates/Sql/Table/drop constraint.sql
+++ b/samples/features/ssms-templates/Sql/Table/drop constraint.sql
@@ -3,6 +3,11 @@
--
-- This template creates a table with a CHECK CONSTRAINT,
-- then it removes the CHECK CONSTRAINT from the table
+
+-- Note: The DROP syntax can also be used to drop
+-- Edge Constraint object types. To achieve this replace
+-- the constraint_name attribute with the name of the
+-- respective Edge Constraint object
-- ========================================================
USE
GO
diff --git a/samples/features/unicode/DataType_WesternMyth.sql b/samples/features/unicode/DataType_WesternMyth.sql
index 2ef4b9d9..cfd1a3cb 100644
--- a/samples/features/unicode/DataType_WesternMyth.sql
+++ b/samples/features/unicode/DataType_WesternMyth.sql
@@ -7,7 +7,13 @@
-- Test Latin character strings with Latin collation
-- Set size limit of data types to be the same under Basic Multilingual Plane (BMP)
-- Characters between 1-byte (ASCII) and 3-bytes (East Asian)
+USE master;
+DROP DATABASE IF EXISTS UnicodeDatabase;
+CREATE DATABASE UnicodeDatabase COLLATE LATIN1_GENERAL_100_CI_AS_SC_UTF8
+GO
+USE UnicodeDatabase
+GO
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (c1 varchar(24) COLLATE Latin1_General_100_CI_AI,
c2 nvarchar(8) COLLATE Latin1_General_100_CI_AI);
@@ -46,7 +52,8 @@ GO
-- uh-oh data loss on the varchar example. Why?
--- varchar is bound to code page enconding, and these code points cannot be found in the Latin code page.
+-- varchar is bound to code page enconding,
+-- and these code points cannot be found in the Latin code page.
SELECT ASCII('敏' COLLATE Latin1_General_100_CI_AI), CHAR(63)
SELECT ASCII('捷' COLLATE Latin1_General_100_CI_AI), CHAR(63)
@@ -152,10 +159,10 @@ GO
-- But the majority of my data is set to Latin (ASCII)
DROP TABLE IF EXISTS t4;
-CREATE TABLE t4 (c1 varchar(110) COLLATE Latin1_General_100_CI_AI_SC);
+CREATE TABLE t4 (c1 varchar(110) COLLATE Latin1_General_100_CI_AI_SC_UTF8);
INSERT INTO t4 VALUES (N'MyStringThequickbrownfoxjumpsoverthelazydogIsLatinAscii敏捷的棕色狐狸跳👶👦')
-SELECT LEN(c1) AS [varchar UTF16 LEN],
- DATALENGTH(c1) AS [varchar UTF16 DATALENGTH], c1
+SELECT LEN(c1) AS [varchar UTF8 LEN],
+ DATALENGTH(c1) AS [varchar UTF8 DATALENGTH], c1
FROM t4;
GO
@@ -164,8 +171,8 @@ GO
-- Where are the savings?
SELECT DATALENGTH(N'MyStringThequickbrownfoxjumpsoverthelazydogIsLatinAscii') AS [Latin_UTF16_2bytes],
DATALENGTH(N'敏捷的棕色狐狸跳') AS [Chinese_UTF16_2bytes],
- DATALENGTH(N'👶👦') AS [SC_UTF16_4bytes]
+ DATALENGTH(N'👶') AS [SC_UTF16_4bytes]
SELECT DATALENGTH('MyStringThequickbrownfoxjumpsoverthelazydogIsLatinAscii' COLLATE Latin1_General_100_CI_AI_SC_UTF8) AS [Latin_UTF8_1byte],
DATALENGTH('敏捷的棕色狐狸跳' COLLATE Latin1_General_100_CI_AI_SC_UTF8) AS [Chinese_UTF8_3bytes],
- DATALENGTH('👶👦' COLLATE Latin1_General_100_CI_AI_SC_UTF8) AS [SC_UTF8_4bytes]
+ DATALENGTH('👶' COLLATE Latin1_General_100_CI_AI_SC_UTF8) AS [SC_UTF8_4bytes]
GO
\ No newline at end of file
diff --git a/samples/features/unicode/notebooks/DataType_WesternMyth.ipynb b/samples/features/unicode/notebooks/DataType_WesternMyth.ipynb
index 92a4160f..bcd928bc 100644
--- a/samples/features/unicode/notebooks/DataType_WesternMyth.ipynb
+++ b/samples/features/unicode/notebooks/DataType_WesternMyth.ipynb
@@ -15,45 +15,18 @@
"cells": [
{
"cell_type": "markdown",
- "source": [
- "# Data type sizes - a western myth"
- ],
- "metadata": {
- "azdata_cell_guid": "9e602698-2ef8-4fed-872f-5bad8c440600"
- }
+ "source": "# Data type sizes - a western myth",
+ "metadata": {}
},
{
"cell_type": "markdown",
- "source": [
- "## Test Latin character strings with Latin collation\r\n",
- "\r\n",
- "**Note:** My server default is SQL_Latin1_General_CP1_CI_AS\r\n",
- "\r\n",
- "Set size limit of data types to be the same under Basic Multilingual Plane (BMP)\r\n",
- "Characters between 1-byte (ASCII) and 3-bytes (East Asian)"
- ],
- "metadata": {
- "azdata_cell_guid": "78fc4a30-52e8-407d-8807-04097ad12348"
- }
+ "source": "## Test Latin character strings with Latin collation\r\n\r\n**Note:** My server default is SQL_Latin1_General_CP1_CI_AS\r\n\r\nSet size limit of data types to be the same under Basic Multilingual Plane (BMP)\r\nCharacters: ranging from 1-byte (ASCII) to 3-bytes (East Asian) per character. So a max of 24-bytes for an East Asian 8 character string.",
+ "metadata": {}
},
{
"cell_type": "code",
- "source": [
- "DROP TABLE IF EXISTS t1;\r\n",
- "CREATE TABLE t1 (c1 varchar(24) COLLATE Latin1_General_100_CI_AI, \r\n",
- "\tc2 nvarchar(8) COLLATE Latin1_General_100_CI_AI); \r\n",
- "INSERT INTO t1 VALUES (N'MyString', N'MyString') \r\n",
- "SELECT LEN(c1) AS [varchar LEN], \r\n",
- "\tDATALENGTH(c1) AS [varchar DATALENGTH], c1\r\n",
- "FROM t1; \r\n",
- "SELECT LEN(c2) AS [nvarchar LEN], \r\n",
- "\tDATALENGTH(c2) AS [nvarchar DATALENGTH], c2 \r\n",
- "FROM t1;\r\n",
- "GO"
- ],
- "metadata": {
- "azdata_cell_guid": "4a7b199e-3117-4fcb-b149-776f4da6cf71"
- },
+ "source": "USE UnicodeDatabase\r\nGO\r\nDROP TABLE IF EXISTS t1;\r\nCREATE TABLE t1 (c1 varchar(24) COLLATE Latin1_General_100_CI_AI, \r\n\tc2 nvarchar(8) COLLATE Latin1_General_100_CI_AI); \r\nINSERT INTO t1 VALUES (N'MyString', N'MyString') \r\nSELECT LEN(c1) AS [varchar LEN], \r\n\tDATALENGTH(c1) AS [varchar DATALENGTH], c1\r\nFROM t1; \r\nSELECT LEN(c2) AS [nvarchar LEN], \r\n\tDATALENGTH(c2) AS [nvarchar DATALENGTH], c2 \r\nFROM t1;\r\nGO",
+ "metadata": {},
"outputs": [
{
"output_type": "display_data",
@@ -79,14 +52,13 @@
{
"output_type": "display_data",
"data": {
- "text/html": "Total execution time: 00:00:00.068"
+ "text/html": "Total execution time: 00:00:00.1996267"
},
"metadata": {}
},
{
"output_type": "execute_result",
- "metadata": {},
- "execution_count": 15,
+ "execution_count": 1,
"data": {
"application/vnd.dataresource+json": {
"schema": {
@@ -111,12 +83,12 @@
]
},
"text/html": "
"
+ },
+ "metadata": {}
}
],
- "execution_count": 25
+ "execution_count": 2
}
]
}
\ No newline at end of file
diff --git a/samples/manage/azure-arc-enabled-sql-server/README.md b/samples/manage/azure-arc-enabled-sql-server/README.md
new file mode 100644
index 00000000..b0aa6a5f
--- /dev/null
+++ b/samples/manage/azure-arc-enabled-sql-server/README.md
@@ -0,0 +1,30 @@
+---
+services: Azure Arc enabled SQL Server
+platforms: Azure
+author: anosov1960
+ms.author: sashan
+ms.date: 12/08/2020
+---
+
+# Running the script using Cloud Shell
+
+Use the following steps to migrate your existing SQL Server - Azure Arc resources from Microsoft.AzureData namespace to Microsoft.AzureArcData namespace.
+
+1. Launch the [Cloud Shell](https://shell.azure.com/). For details, [read more about PowerShell in Cloud Shell](https://aka.ms/pscloudshell/docs).
+
+2. Upload the script to the shell using the following command:
+
+ ```console
+ curl https://raw.githubusercontent.com/microsoft/sql-server-samples/master/samples/manage/azure-arc-enabled-sql-server/migrate-to-azure-arc-data.ps1 -o migrate-to-azure-arc-data.ps1
+ ```
+
+3. Run the script.
+
+ ```console
+ ./migrate-to-azure-arc-data.ps1
+ ```
+
+> [!NOTE]
+> - To paste the commands into the shell, use `Ctrl-Shift-V` on Windows or `Cmd-v` on MacOS.
+> - The script will be uploaded directly to the home folder associated with your Cloud Shell session.
+> - The script will prompt for the resource group name and print a message when migration is completed.
diff --git a/samples/manage/azure-arc-enabled-sql-server/migrate-to-azure-arc-data.ps1 b/samples/manage/azure-arc-enabled-sql-server/migrate-to-azure-arc-data.ps1
new file mode 100644
index 00000000..a4521a1d
--- /dev/null
+++ b/samples/manage/azure-arc-enabled-sql-server/migrate-to-azure-arc-data.ps1
@@ -0,0 +1,50 @@
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ---------------------------------------------------------------------------------
+#
+# Sample script for migrating the existing SQL Server - Azure Arc resources from Microsoft.AzureData namespace to Microsoft.AzureArcData namespace
+# within a single Resource Group
+#
+
+$ResourceGroup=read-host -Prompt "Enter Resource Group Name"
+
+$SqlArcResources = Get-AzResource -ExpandProperties -ResourceType Microsoft.AzureData/sqlServerInstances -ResourceGroupName $ResourceGroup
+foreach ($r in $SqlArcResources) {
+ Write-Host ("Migrating resource: {0}" -f $r.Name)
+
+ if ( ! ($r.Properties.containerResourceId -match "Microsoft.HybridCompute/machines") ) {
+ $arcResource = Get-AzResource -ResourceType Microsoft.HybridCompute/machines -Name $r.Properties.containerResourceId
+ if($null -eq $arcResource) {
+ Write-Warning ("Could not locate the Machine - Azure Arc resource associated with this SQL Server Instance. You should manually un-register and re-register this instance.")
+ continue
+ } else {
+ $r.Properties.containerResourceId = $arcResource.ResourceId
+ }
+ }
+
+ if( $null -ne $r.Properties.tcpPorts ){
+ Write-Warning "The property `"tcpPorts`" has been renamed to `"tcpStaticPorts`". The property name will be updated during resource migration."
+ $r.Properties | Add-Member -MemberType NoteProperty -Name "tcpStaticPorts" -Value $r.Properties.tcpPorts
+ $r.Properties.psobject.properties.remove("tcpPorts")
+ }
+
+ if( $null -ne $r.Properties.createTime ){
+ Write-Warning "There is a known bug in the createTime property. This property will be removed during resource migration."
+ $r.Properties.psobject.properties.remove("createTime")
+ }
+
+ New-AzResource -ResourceName $r.Name -Location $r.Location -Properties $r.Properties -ResourceGroupName $r.ResourceGroupName `
+ -ResourceType Microsoft.AzureArcData/sqlServerInstances -Force
+}
+
+Write-Host "Namespace migration completed for SQL Server - Azure Arc resources."
diff --git a/samples/manage/azure-hybrid-benefit/README.md b/samples/manage/azure-hybrid-benefit/README.md
new file mode 100644
index 00000000..b48286bf
--- /dev/null
+++ b/samples/manage/azure-hybrid-benefit/README.md
@@ -0,0 +1,61 @@
+---
+services: Azure SQL
+platforms: Azure
+author: anosov1960
+ms.author: sashan
+ms.date: 12/17/2020
+---
+
+# Overview
+
+This script is provided to help you manage the SQL Server licenses that are consumed by the SQL Servers deployed to Azure. The script writes the results to a `sql-license-usage.csv` file. If the file with this name already exists, the new results will be appended to it. The report includes the following information for each scanned subscription as well as the totals for each category.
+| **Category** | **Description** |
+|:--|:--|
+|Date|Date of the scan|
+|Time|Time of the scan|
+|Subscription name|The name of the subscription|
+|Subscription ID|The unique subscription ID|
+|AHB Std vCores|Total vCores used by General Purpose service tier or SQL Server Standard edition billed with AHB discount|
+|AHB Ent vCores|Total vCores used by Business Critical service tier or SQL Server Enterprise edition billed with AHB discount|
+|PAYG Std vCores|Total vCores used by General Purpose service tier or SQL Server Standard edition billed at full price|
+|PAYG Ent vCores|Total vCores used by Business Critical service tier or SQL Server Enterprise edition billed at full price|
+|HADR Std vCores|Total vCores used by HADR replicas running SQL Server Standard edition|
+|HADR Ent vCores|Total vCores used by HADR replicas running SQL Server Enterprise edition|
+|Developer vCores|Total vCores used by SQL Server Developer edition|
+|Express vCores|Total vCores used by SQL Server Express edition|
+
+>[!NOTE]
+> - The usage data is a snapshot at the time of the script execution based on the size of the deployed SQL resources in vCores.
+> - For IaaS workloads, such as SQL Server in Virtual Machines or SSIS integration runtimes, each vCPU is counted as one vCore.
+> - For PaaS workloads, each vCore of Business Critical service tier is counted as one Enterprise vCore and each vCore of General Purpose service tier is counted as one Standard vCore.
+
+# Running the script using Cloud Shell
+
+Use the following steps to calculate the SQL Server license usage:
+
+1. Launch the [Cloud Shell](https://shell.azure.com/). For details, read [PowerShell in Cloud Shell](https://aka.ms/pscloudshell/docs).
+
+2. Upload the script to the shell using the following command:
+
+ ```console
+ curl https://raw.githubusercontent.com/microsoft/sql-server-samples/master/samples/manage/azure-hybrid-benefit/sql-license-usage.ps1 -o sql-license-usage.ps1
+ ```
+
+3. Run the script with a specific subscriptions ID or the file name as the parameter. The file should be used if you need to scan a subset of the subscriptions. If the parameter is not specified, the script will scan all the subscriptions in your account.
+
+ ```console
+ ./sql-license-usage.ps1 or .csv
+ ```
+
+If the a file is specified, it must be a `.csv` file with the list of subscriptions. To create a file containing all subscriptions in your account, use the following command. You can then edit the file to remove the subscriptions you don't want to scan.
+
+ ```console
+ Get-AzSubscription | Export-Csv .\mysubscriptions.csv -NoTypeInformation
+ ```
+> [!NOTE]
+> - To paste the commands into the shell, use `Ctrl-Shift-V` on Windows or `Cmd-v` on MacOS.
+> - The `curl` command will copy the script directly to the home folder associated with your Cloud Shell session.
+
+# Tracking SQL license usage over time
+
+You can track your license utilization over time by periodically running this script. Each new scan will add the results to `sql-license-usage.csv`, which you can use for reporting the license usage over time in Excel or other tools. To run this script on schedule using Azure automation, read [Create a PowerShell runbook tutorial](https://docs.microsoft.com/azure/automation/learn/automation-tutorial-runbook-textual-powershell).
diff --git a/samples/manage/azure-hybrid-benefit/ahb-usage-in-subscription.ps1 b/samples/manage/azure-hybrid-benefit/ahb-usage-in-subscription.ps1
new file mode 100644
index 00000000..1ddf8865
--- /dev/null
+++ b/samples/manage/azure-hybrid-benefit/ahb-usage-in-subscription.ps1
@@ -0,0 +1,112 @@
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ---------------------------------------------------------------------------------
+#
+# This script calculates the usage of different types of SQL Server licenses by the SQL resources
+# in the specific subscriptions.
+#
+# NOTE:
+# 1. The script requires a .csv file with the list of subscriptions. Use Export-Csv comlet to create the file.
+# 2. SQL Database resources that use the DTU based business model are excluded.
+#
+
+# Set the subscription Id
+$SubcriptionId = read-host -Prompt "Enter Subscription ID"
+Set-AzContext -SubscriptionId $SubcriptionId
+
+# Variables to keep track of SQL VMs and VCPUs count
+$total_std_vcores = 0
+$total_ent_vcores = 0
+
+#Get all SQL databases in the subscription
+$databases = Get-AzSqlServer | Get-AzSqlDatabase
+
+# Get the databases with License Included and add to VCore count
+foreach ($db in $databases){
+ if (($db.SkuName -ne "ElasticPool") -and ($db.LicenseType -eq "LicenseIncluded")) {
+ if ($db.Edition -eq "BusinessCritical") {
+ $total_ent_vcores += $db.Capacity
+ } elseif ($db.Edition -eq "GeneralPurpose") {
+ $total_std_vcores += $db.Capacity
+ }
+ }
+}
+
+#Get all SQL elastic pools in the subscription
+$pools = Get-AzSqlServer | Get-AzSqlElasticPool
+
+# Get the elastic pools with License Included and and add to VCore count
+foreach ($pool in $pools){
+ if ($pool.LicenseType -eq "LicenseIncluded") {
+ if ($pool.Edition -eq "BusinessCritical") {
+ $total_ent_vcores += $pool.Capacity
+ } elseif ($pool.Edition -eq "GeneralPurpose") {
+ $total_std_vcores += $pool.Capacity
+ }
+ }
+}
+
+#Get all SQL managed instances in the subscription
+$instances = Get-AzSqlInstance
+
+# Get the SQL managed instances with License Included and add to VCore count
+foreach ($ins in $instances){
+ if (($ins.InstancePoolName -eq $null) -and ($ins.LicenseType -eq "LicenseIncluded")) {
+ if ($ins.Sku.Tier -eq "BusinessCritical") {
+ $total_ent_vcores += $ins.VCores
+ } elseif ($ins.Sku.Tier -eq "GeneralPurpose") {
+ $total_std_vcores += $ins.VCores
+ }
+ }
+}
+
+#Get all instance pools in the subscription
+$ipools = Get-AzSqlInstancePool
+
+# Get the instance pools with License Included and add to VCore count
+foreach ($ip in $ipools){
+ if ($ip.LicenseType -eq "LicenseIncluded") {
+ if ($ip.Edition -eq "BusinessCritical") {
+ $total_ent_vcores += $ip.VCores
+ } elseif ($ip.Edition -eq "GeneralPurpose") {
+ $total_std_vcores += $ip.VCores
+ }
+ }
+}
+
+#Get All Sql VMs with AHB license configured
+$sql_vms= Get-AzSqlVM | where {$_.LicenseType.Contains("AHUB")}
+
+# Get the VM size, match it with the corresponding VCPU count and add to VCore count
+foreach ($sql_vm in $sql_vms){
+ $vm = Get-AzVm -Name $sql_vm.Name -ResourceGroupName $sql_vm.ResourceGroupName
+ $vm_size = $vm.HardwareProfile.VmSize
+ # Select first size and get the VCPus available
+ $size_info = Get-AzComputeResourceSku | where {$_.ResourceType.Contains('virtualMachines') -and $_.Name -like $vm_size} | Select-Object -First 1
+ # Save the VCPU count
+ $vcpu= $size_info.Capabilities | Where-Object {$_.name -eq "vCPUsAvailable"}
+
+ if ($vcpu){
+ $data = [pscustomobject]@{vm_resource_uri=$vm.Id;sku=$sql_vm.Sku;size=$vm_size;vcpus=$vcpu.value}
+ $array += $data
+
+ if ($data.sku -like "Enterprise"){
+ $total_ent_vcores += $data.vcpus
+ }elseif ($data.sku -like "Standard"){
+ $total_std_vcores += $data.vcpus
+ }
+ }
+}
+
+Write-Host "Total number of VCores for SQL Enterprise: " $total_ent_vcores
+Write-Host "Total number of VCores for SQL Standard: " $total_std_vcores
\ No newline at end of file
diff --git a/samples/manage/azure-hybrid-benefit/sql-license-usage.ps1 b/samples/manage/azure-hybrid-benefit/sql-license-usage.ps1
new file mode 100644
index 00000000..24452f64
--- /dev/null
+++ b/samples/manage/azure-hybrid-benefit/sql-license-usage.ps1
@@ -0,0 +1,263 @@
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ---------------------------------------------------------------------------------
+#
+# Sample script to calculate the consolidated SQL Server license usage by all of the SQL resources in a specific subscription or the entire the account.
+#
+# This script accepts a .csv file or a subscription ID as a parameter. The file must include a list of subscriptions to be scanned for the license usage. You can create
+# such a file by the following command and then edit to remove the subscriptions you don't want to scan:
+# > Get-AzSubscription | Export-Csv .\mysubscriptions.csv -NoTypeInformation
+#
+# If no parameter is provided, the script will prompt for a file or subscriptiobn ID. If no value is provided, the scipt will scan all the subscriptions you account
+# has access to.
+#
+#
+# NOTE: The script does not calculate usage for Azure SQL resources that use the DTU-based purchasing model
+#
+
+# Subscriptions to scan
+
+if ($args[0] -like "*.csv") {
+ $subscriptions = Import-Csv $args[0]
+}elseif($args[0] -ne $null){
+ $subscriptions = [PSCustomObject]@{SubscriptionId = $args[0]} | Get-AzSubscription
+}else{
+ $subscriptions = Get-AzSubscription
+}
+
+
+#Initialize tables and arrays
+
+[System.Collections.ArrayList]$usage = @()
+if ($includeEC -eq $null){
+ $usage += ,(@("Date", "Time", "Subscription Name", "Subscription ID", "AHB Std vCores", "AHB Ent vCores", "PAYG Std vCores", "PAYG Ent vCores", "HADR Std vCores", "HADR Ent vCores", "Developer vCores", "Express vCores"))
+}else{
+ $usage += ,(@("Date", "Time", "Subscription Name", "Subscription ID", "AHB ECs", "PAYG ECs", "AHB Std vCores", "AHB Ent vCores", "PAYG Std vCores", "PAYG Ent vCores", "HADR Std vCores", "HADR Ent vCores", "Developer vCores", "Express vCores"))
+}
+
+$subtotal = [pscustomobject]@{ahb_std=0; ahb_ent=0; payg_std=0; payg_ent=0; hadr_std=0; hadr_ent=0; developer=0; express=0}
+$total = [pscustomobject]@{}
+$subtotal.psobject.properties.name | %{$total | Add-Member -MemberType NoteProperty -Name $_ -Value 0}
+
+#Save the VM SKU table for future use
+
+$VM_SKUs = Get-AzComputeResourceSku
+
+Write-Host ([Environment]::NewLine + "-- Scanning subscriptions --")
+
+# Calculate usage for each subscription
+
+foreach ($sub in $subscriptions){
+
+ if ($sub.State -ne "Enabled") {continue}
+
+ try {
+ Set-AzContext -SubscriptionId $sub.Id
+ }catch {
+ write-host "Invalid subscription: " $sub.Id
+ {continue}
+ }
+
+ # Reset the subtotals
+ $subtotal.psobject.properties.name | %{$subtotal.$_ = 0}
+
+ #Get all logical servers
+ $servers = Get-AzSqlServer
+
+ #Get all SQL database resources in the subscription
+ $databases = $servers | Get-AzSqlDatabase
+
+ # Process the vCore-based databases
+ foreach ($db in $databases ){
+ if ($db.SkuName -eq "ElasticPool") {continue}
+
+ if ($db.LicenseType -eq "LicenseIncluded") {
+ if ($db.Edition -eq "BusinessCritical") {
+ $subtotal.ahb_ent += $db.Capacity
+ } elseif ($db.Edition -eq "GeneralPurpose") {
+ $subtotal.ahb_std += $db.Capacity
+ }
+ }else{
+ if ($db.Edition -eq "BusinessCritical") {
+ $subtotal.payg_ent += $db.Capacity
+ } elseif ($db.Edition -eq "GeneralPurpose") {
+ $subtotal.payg_std += $db.Capacity
+ }
+ }
+ }
+
+ #Get all SQL elastic pool resources in the subscription
+ $pools = $servers | Get-AzSqlElasticPool
+
+ # Process the vCore-based elastic pools
+ foreach ($pool in $pools){
+ if ($pool.LicenseType -eq "LicenseIncluded") {
+ if ($pool.Edition -eq "BusinessCritical") {
+ $subtotal.ahb_ent += $pool.Capacity
+ } elseif ($pool.Edition -eq "GeneralPurpose") {
+ $subtotal.ahb_std += $pool.Capacity
+ }
+ }else{
+ if ($pool.Edition -eq "BusinessCritical") {
+ $subtotal.payg_ent += $pool.Capacity
+ } elseif ($pool.Edition -eq "GeneralPurpose") {
+ $subtotal.payg_std += $pool.Capacity
+ }
+ }
+ }
+
+ #Get all SQL managed instance resources in the subscription
+ $instances = Get-AzSqlInstance
+
+ # Process the SQL managed instances with License Included and add to VCore count
+ foreach ($ins in $instances){
+ if ($ins.InstancePoolName -eq $null){
+ if ($ins.LicenseType -eq "LicenseIncluded") {
+ if ($ins.Sku.Tier -eq "BusinessCritical") {
+ $subtotal.ahb_ent += $ins.VCores
+ } elseif ($ins.Sku.Tier -eq "GeneralPurpose") {
+ $subtotal.ahb_std += $ins.VCores
+ }
+ }else{
+ if ($ins.Edition -eq "BusinessCritical") {
+ $subtotal.payg_ent += $pool.Capacity
+ } elseif ($ins.Edition -eq "GeneralPurpose") {
+ $subtotal.payg_std += $ins.Capacity
+ }
+ }
+ }
+ }
+
+ #Get all instance pool resources in the subscription
+ $ipools = Get-AzSqlInstancePool
+
+ # Process the instance pools
+ foreach ($ip in $ipools){
+ if ($ip.LicenseType -eq "LicenseIncluded") {
+ if ($ip.Edition -eq "BusinessCritical") {
+ $subtotal.ahb_ent += $ip.VCores
+ } elseif ($ip.Edition -eq "GeneralPurpose") {
+ $subtotal.ahb_std += $ip.VCores
+ }
+ }else{
+ if ($ip.Edition -eq "BusinessCritical") {
+ $subtotal.payg_ent += $ip.Capacity
+ } elseif ($ip.Edition -eq "GeneralPurpose") {
+ $subtotal.payg_std += $ip.Capacity
+ }
+ }
+ }
+
+
+ #Get all SSIS imtegration runtime resources in the subscription
+ $ssis_irs = Get-AzResourceGroup | Get-AzDataFactoryV2 | Get-AzDataFactoryV2IntegrationRuntime
+
+ # Get the VM size, match it with the corresponding VCPU count and add to VCore count
+ foreach ($ssis_ir in $ssis_irs){
+ # Select first size and get the VCPus available
+ $size_info = $VM_SKUs | where { $_.Name -like $ssis_ir.NodeSize} | Select-Object -First 1
+
+ # Save the VCPU count
+ $vcpu= $size_info.Capabilities | Where-Object {$_.name -eq "vCPUsAvailable"}
+
+ if ($ssis_ir.State -eq "Started"){
+ if ($ssis_ir.LicenseType -like "LicenseIncluded"){
+ if ($ssis_ir.Edition -like "Enterprise"){
+ $subtotal.ahb_ent += $vcpu.value
+ }elseif ($ssis_ir.Edition -like "Standard"){
+ $subtotal.ahb_std += $vcpu.value
+ }
+ }elseif ($data.license -like "BasePrice"){
+ if ($ssis_ir.Edition -like "Enterprise"){
+ $subtotal.payg_ent += $vcpu.value
+ }elseif ($ssis_ir.Edition -like "Standard"){
+ $subtotal.payg_std += $vcpu.value
+ }elseif ($ssis_ir.Edition -like "Developer"){
+ $subtotal.developer += $vcpu.value
+ }elseif ($ssis_ir.Edition -like "Express"){
+ $subtotal.express += $vcpu.value
+ }
+ }
+ }
+ }
+
+
+ #Get All SQL VMs resources in the subscription
+ $sql_vms = Get-AzSqlVM
+
+ # Get the VM size, match it with the corresponding VCPU count and add to VCore count
+ foreach ($sql_vm in $sql_vms){
+ $vm = Get-AzVm -Name $sql_vm.Name -ResourceGroupName $sql_vm.ResourceGroupName
+ $vm_size = $vm.HardwareProfile.VmSize
+ # Select first size and get the VCPus available
+ $size_info = $VM_SKUs | where {$_.ResourceType.Contains('virtualMachines') -and $_.Name -like $vm_size} | Select-Object -First 1
+ # Save the VCPU count
+ $vcpu= $size_info.Capabilities | Where-Object {$_.name -eq "vCPUsAvailable"}
+
+ if ($vcpu){
+ $data = [pscustomobject]@{vm_resource_uri=$vm.Id;sku=$sql_vm.Sku;license=$sql_vm.LicenseType;size=$vm_size;vcpus=$vcpu.value}
+
+ if ($data.license -like "DR"){
+ if ($data.sku -like "Enterprise"){
+ $subtotal.hadr_ent += $data.vcpus
+ }elseif ($data.sku -like "Standard"){
+ $subtotal.hadr_std += $data.vcpus
+ }
+ }elseif ($data.license -like "AHUB"){
+ if ($data.sku -like "Enterprise"){
+ $subtotal.ahb_ent += $data.vcpus
+ }elseif ($data.sku -like "Standard"){
+ $subtotal.ahb_std += $data.vcpus
+ }
+ }elseif ($data.license -like "PAYG"){
+ if ($data.sku -like "Enterprise"){
+ $subtotal.payg_ent += $data.vcpus
+ }elseif ($data.sku -like "Standard"){
+ $subtotal.payg_std += $data.vcpus
+ }elseif ($data.sku -like "Developer"){
+ $subtotal.developer += $data.vcpus
+ }elseif ($data.sku -like "Express"){
+ $subtotal.express += $data.vcpus
+ }
+ }
+ }
+ }
+
+ # Increment the totals and add subtotals to the usage array
+
+ $subtotal.psobject.properties.name | %{$total.$_ += $subtotal.$_}
+
+ if ($includeEC -eq $null){
+ $usage += ,(@((Get-Date -Format d), (Get-Date -Format t), $sub.Name, $sub.Id, $subtotal.ahb_std, $subtotal.ahb_ent, $subtotal.payg_std, $subtotal.payg_ent, $subtotal.hadr_std, $subtotal.hadr_ent, $subtotal.developer, $subtotal.express))
+ }else{
+ $usage += ,(@((Get-Date -Format d), (Get-Date -Format t), $sub.Name, $sub.Id, ($subtotal.ahb_std + $subtotal.ahb_ent*4), ($subtotal.payg_std + $subtotal.payg_ent*4), $subtotal.ahb_std, $subtotal.ahb_ent, $subtotal.payg_std, $subtotal.payg_ent, $subtotal.hadr_std, $subtotal.hadr_ent, $subtotal.developer, $subtotal.express))
+ }
+}
+
+# Add the total numbers to the usage array
+
+if ($includeEC -eq $null){
+ $usage += ,(@((Get-Date -Format d), (Get-Date -Format t), "Total", $null, $total.ahb_std, $total.ahb_ent, $total.payg_std, $total.payg_ent, $total.hadr_std, $total.hadr_ent, $total.developer, $total.express))
+}else{
+ $usage += ,(@((Get-Date -Format d), (Get-Date -Format t), "Total", $null, ($total.ahb_std + $total.ahb_ent*4), ($total.payg_std + $total.payg_ent*4), $total.ahb_std, $total.ahb_ent, $total.payg_std, $total.payg_ent, $total.hadr_std, $total.hadr_ent, $total.developer, $total.express))
+}
+
+# Append to '.\sql-license-usage.csv'
+
+$table = ConvertFrom-Csv ($usage | %{ $_ -join ','} )
+$table | Format-table
+#$fileName = '.\sql-license-usage_' + (Get-Date -f yyyy-MM-dd_HH-mm-ss) + '.csv'
+$fileName = '.\sql-license-usage.csv'
+$table | Export-Csv $fileName -NoTypeInformation -Append
+
+Write-Host ([Environment]::NewLine + "-- The usage data is saved to " + $fileName + "--")
diff --git a/samples/manage/sql-assessment-api/SqlAssessmentClient/.gitignore b/samples/manage/sql-assessment-api/SqlAssessmentClient/.gitignore
new file mode 100644
index 00000000..dfcfd56f
--- /dev/null
+++ b/samples/manage/sql-assessment-api/SqlAssessmentClient/.gitignore
@@ -0,0 +1,350 @@
+## Ignore Visual Studio temporary files, build results, and
+## files generated by popular Visual Studio add-ons.
+##
+## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
+
+# User-specific files
+*.rsuser
+*.suo
+*.user
+*.userosscache
+*.sln.docstates
+
+# User-specific files (MonoDevelop/Xamarin Studio)
+*.userprefs
+
+# Mono auto generated files
+mono_crash.*
+
+# Build results
+[Dd]ebug/
+[Dd]ebugPublic/
+[Rr]elease/
+[Rr]eleases/
+x64/
+x86/
+[Aa][Rr][Mm]/
+[Aa][Rr][Mm]64/
+bld/
+[Bb]in/
+[Oo]bj/
+[Ll]og/
+[Ll]ogs/
+
+# Visual Studio 2015/2017 cache/options directory
+.vs/
+# Uncomment if you have tasks that create the project's static files in wwwroot
+#wwwroot/
+
+# Visual Studio 2017 auto generated files
+Generated\ Files/
+
+# MSTest test Results
+[Tt]est[Rr]esult*/
+[Bb]uild[Ll]og.*
+
+# NUnit
+*.VisualState.xml
+TestResult.xml
+nunit-*.xml
+
+# Build Results of an ATL Project
+[Dd]ebugPS/
+[Rr]eleasePS/
+dlldata.c
+
+# Benchmark Results
+BenchmarkDotNet.Artifacts/
+
+# .NET Core
+project.lock.json
+project.fragment.lock.json
+artifacts/
+
+# StyleCop
+StyleCopReport.xml
+
+# Files built by Visual Studio
+*_i.c
+*_p.c
+*_h.h
+*.ilk
+*.meta
+*.obj
+*.iobj
+*.pch
+*.pdb
+*.ipdb
+*.pgc
+*.pgd
+*.rsp
+*.sbr
+*.tlb
+*.tli
+*.tlh
+*.tmp
+*.tmp_proj
+*_wpftmp.csproj
+*.log
+*.vspscc
+*.vssscc
+.builds
+*.pidb
+*.svclog
+*.scc
+
+# Chutzpah Test files
+_Chutzpah*
+
+# Visual C++ cache files
+ipch/
+*.aps
+*.ncb
+*.opendb
+*.opensdf
+*.sdf
+*.cachefile
+*.VC.db
+*.VC.VC.opendb
+
+# Visual Studio profiler
+*.psess
+*.vsp
+*.vspx
+*.sap
+
+# Visual Studio Trace Files
+*.e2e
+
+# TFS 2012 Local Workspace
+$tf/
+
+# Guidance Automation Toolkit
+*.gpState
+
+# ReSharper is a .NET coding add-in
+_ReSharper*/
+*.[Rr]e[Ss]harper
+*.DotSettings.user
+
+# TeamCity is a build add-in
+_TeamCity*
+
+# DotCover is a Code Coverage Tool
+*.dotCover
+
+# AxoCover is a Code Coverage Tool
+.axoCover/*
+!.axoCover/settings.json
+
+# Visual Studio code coverage results
+*.coverage
+*.coveragexml
+
+# NCrunch
+_NCrunch_*
+.*crunch*.local.xml
+nCrunchTemp_*
+
+# MightyMoose
+*.mm.*
+AutoTest.Net/
+
+# Web workbench (sass)
+.sass-cache/
+
+# Installshield output folder
+[Ee]xpress/
+
+# DocProject is a documentation generator add-in
+DocProject/buildhelp/
+DocProject/Help/*.HxT
+DocProject/Help/*.HxC
+DocProject/Help/*.hhc
+DocProject/Help/*.hhk
+DocProject/Help/*.hhp
+DocProject/Help/Html2
+DocProject/Help/html
+
+# Click-Once directory
+publish/
+
+# Publish Web Output
+*.[Pp]ublish.xml
+*.azurePubxml
+# Note: Comment the next line if you want to checkin your web deploy settings,
+# but database connection strings (with potential passwords) will be unencrypted
+*.pubxml
+*.publishproj
+
+# Microsoft Azure Web App publish settings. Comment the next line if you want to
+# checkin your Azure Web App publish settings, but sensitive information contained
+# in these scripts will be unencrypted
+PublishScripts/
+
+# NuGet Packages
+*.nupkg
+# NuGet Symbol Packages
+*.snupkg
+# The packages folder can be ignored because of Package Restore
+**/[Pp]ackages/*
+# except build/, which is used as an MSBuild target.
+!**/[Pp]ackages/build/
+# Uncomment if necessary however generally it will be regenerated when needed
+#!**/[Pp]ackages/repositories.config
+# NuGet v3's project.json files produces more ignorable files
+*.nuget.props
+*.nuget.targets
+
+# Microsoft Azure Build Output
+csx/
+*.build.csdef
+
+# Microsoft Azure Emulator
+ecf/
+rcf/
+
+# Windows Store app package directories and files
+AppPackages/
+BundleArtifacts/
+Package.StoreAssociation.xml
+_pkginfo.txt
+*.appx
+*.appxbundle
+*.appxupload
+
+# Visual Studio cache files
+# files ending in .cache can be ignored
+*.[Cc]ache
+# but keep track of directories ending in .cache
+!?*.[Cc]ache/
+
+# Others
+ClientBin/
+~$*
+*~
+*.dbmdl
+*.dbproj.schemaview
+*.jfm
+*.pfx
+*.publishsettings
+orleans.codegen.cs
+
+# Including strong name files can present a security risk
+# (https://github.com/github/gitignore/pull/2483#issue-259490424)
+#*.snk
+
+# Since there are multiple workflows, uncomment next line to ignore bower_components
+# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
+#bower_components/
+
+# RIA/Silverlight projects
+Generated_Code/
+
+# Backup & report files from converting an old project file
+# to a newer Visual Studio version. Backup files are not needed,
+# because we have git ;-)
+_UpgradeReport_Files/
+Backup*/
+UpgradeLog*.XML
+UpgradeLog*.htm
+ServiceFabricBackup/
+*.rptproj.bak
+
+# SQL Server files
+*.mdf
+*.ldf
+*.ndf
+
+# Business Intelligence projects
+*.rdl.data
+*.bim.layout
+*.bim_*.settings
+*.rptproj.rsuser
+*- [Bb]ackup.rdl
+*- [Bb]ackup ([0-9]).rdl
+*- [Bb]ackup ([0-9][0-9]).rdl
+
+# Microsoft Fakes
+FakesAssemblies/
+
+# GhostDoc plugin setting file
+*.GhostDoc.xml
+
+# Node.js Tools for Visual Studio
+.ntvs_analysis.dat
+node_modules/
+
+# Visual Studio 6 build log
+*.plg
+
+# Visual Studio 6 workspace options file
+*.opt
+
+# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
+*.vbw
+
+# Visual Studio LightSwitch build output
+**/*.HTMLClient/GeneratedArtifacts
+**/*.DesktopClient/GeneratedArtifacts
+**/*.DesktopClient/ModelManifest.xml
+**/*.Server/GeneratedArtifacts
+**/*.Server/ModelManifest.xml
+_Pvt_Extensions
+
+# Paket dependency manager
+.paket/paket.exe
+paket-files/
+
+# FAKE - F# Make
+.fake/
+
+# CodeRush personal settings
+.cr/personal
+
+# Python Tools for Visual Studio (PTVS)
+__pycache__/
+*.pyc
+
+# Cake - Uncomment if you are using it
+# tools/**
+# !tools/packages.config
+
+# Tabs Studio
+*.tss
+
+# Telerik's JustMock configuration file
+*.jmconfig
+
+# BizTalk build output
+*.btp.cs
+*.btm.cs
+*.odx.cs
+*.xsd.cs
+
+# OpenCover UI analysis results
+OpenCover/
+
+# Azure Stream Analytics local run output
+ASALocalRun/
+
+# MSBuild Binary and Structured Log
+*.binlog
+
+# NVidia Nsight GPU debugger configuration file
+*.nvuser
+
+# MFractors (Xamarin productivity tool) working folder
+.mfractor/
+
+# Local History for Visual Studio
+.localhistory/
+
+# BeatPulse healthcheck temp database
+healthchecksdb
+
+# Backup folder for Package Reference Convert tool in Visual Studio 2017
+MigrationBackup/
+
+# Ionide (cross platform F# VS Code tools) working folder
+.ionide/
diff --git a/samples/manage/sql-assessment-api/SqlAssessmentClient/.vscode/launch.json b/samples/manage/sql-assessment-api/SqlAssessmentClient/.vscode/launch.json
new file mode 100644
index 00000000..c15aa054
--- /dev/null
+++ b/samples/manage/sql-assessment-api/SqlAssessmentClient/.vscode/launch.json
@@ -0,0 +1,27 @@
+{
+ // Use IntelliSense to find out which attributes exist for C# debugging
+ // Use hover for the description of the existing attributes
+ // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
+ "version": "0.2.0",
+ "configurations": [
+ {
+ "name": ".NET Core Launch (console)",
+ "type": "coreclr",
+ "request": "launch",
+ "preLaunchTask": "build",
+ // If you have changed target frameworks, make sure to update the program path.
+ "program": "${workspaceFolder}/AssessmentClient.SMO/bin/Debug/netcoreapp3.1/AssessmentClient.SMO.dll",
+ "args": [],
+ "cwd": "${workspaceFolder}/AssessmentClient.SMO",
+ // For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console
+ "console": "externalTerminal",
+ "stopAtEntry": false
+ },
+ {
+ "name": ".NET Core Attach",
+ "type": "coreclr",
+ "request": "attach",
+ "processId": "${command:pickProcess}"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/samples/manage/sql-assessment-api/SqlAssessmentClient/.vscode/tasks.json b/samples/manage/sql-assessment-api/SqlAssessmentClient/.vscode/tasks.json
new file mode 100644
index 00000000..f4db04fa
--- /dev/null
+++ b/samples/manage/sql-assessment-api/SqlAssessmentClient/.vscode/tasks.json
@@ -0,0 +1,42 @@
+{
+ "version": "2.0.0",
+ "tasks": [
+ {
+ "label": "build",
+ "command": "dotnet",
+ "type": "process",
+ "args": [
+ "build",
+ "${workspaceFolder}/AssessmentClient.SMO/AssessmentClient.SMO.csproj",
+ "/property:GenerateFullPaths=true",
+ "/consoleloggerparameters:NoSummary"
+ ],
+ "problemMatcher": "$msCompile"
+ },
+ {
+ "label": "publish",
+ "command": "dotnet",
+ "type": "process",
+ "args": [
+ "publish",
+ "${workspaceFolder}/AssessmentClient.SMO/AssessmentClient.SMO.csproj",
+ "/property:GenerateFullPaths=true",
+ "/consoleloggerparameters:NoSummary"
+ ],
+ "problemMatcher": "$msCompile"
+ },
+ {
+ "label": "watch",
+ "command": "dotnet",
+ "type": "process",
+ "args": [
+ "watch",
+ "run",
+ "${workspaceFolder}/AssessmentClient.SMO/AssessmentClient.SMO.csproj",
+ "/property:GenerateFullPaths=true",
+ "/consoleloggerparameters:NoSummary"
+ ],
+ "problemMatcher": "$msCompile"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/samples/manage/sql-assessment-api/SqlAssessmentClient/AssessmentClient.SMO/AssessmentClient.SMO.csproj b/samples/manage/sql-assessment-api/SqlAssessmentClient/AssessmentClient.SMO/AssessmentClient.SMO.csproj
new file mode 100644
index 00000000..54302bd7
--- /dev/null
+++ b/samples/manage/sql-assessment-api/SqlAssessmentClient/AssessmentClient.SMO/AssessmentClient.SMO.csproj
@@ -0,0 +1,14 @@
+
+
+
+ Exe
+ netcoreapp3.1
+ enable
+
+
+
+
+
+
+
+
diff --git a/samples/manage/sql-assessment-api/SqlAssessmentClient/AssessmentClient.SMO/Program.cs b/samples/manage/sql-assessment-api/SqlAssessmentClient/AssessmentClient.SMO/Program.cs
new file mode 100644
index 00000000..5f7c5e96
--- /dev/null
+++ b/samples/manage/sql-assessment-api/SqlAssessmentClient/AssessmentClient.SMO/Program.cs
@@ -0,0 +1,75 @@
+namespace AssessmentClient.SMO
+{
+ using System;
+ using System.Collections.Generic;
+ using System.Linq;
+ using System.Threading.Tasks;
+
+ using Microsoft.SqlServer.Management.Assessment;
+ using Microsoft.SqlServer.Management.Assessment.Checks;
+ using Microsoft.SqlServer.Management.Smo;
+
+ public static class Program
+ {
+ private static async Task Main(string[] args)
+ {
+ // Connect to a server or a database with SMO
+ // https://docs.microsoft.com/en-us/sql/relational-databases/server-management-objects-smo/create-program/connecting-to-an-instance-of-sql-server
+ var target = new Server();
+
+
+ // Use GetAssessmentItem method to obtain
+ // a list of available SQL Assessment checks
+ IEnumerable checklist = target.GetAssessmentItems();
+
+
+ // Checks are tagged with strings corresponding to
+ // categories like "Performance", "Storage", or "Security"
+ var allTags = new SortedSet(checklist.SelectMany(c => c.Tags));
+
+ DisplayCategories(target.Name, allTags);
+
+ while (Prompt(out string? line))
+ {
+ // Use GetAssessmentResultsList to run assessment
+ List assessmentResults = string.IsNullOrWhiteSpace(line)
+ ? await target.GetAssessmentResultsList().ConfigureAwait(false) // all checks
+ : await target.GetAssessmentResultsList(line.Split()).ConfigureAwait(false); // selected checks
+
+ DisplayAssessmentResults(assessmentResults);
+ }
+ }
+
+ private static void DisplayAssessmentResults(List assessmentResults)
+ {
+ // Properties of IAssessmentResult provide
+ // recommendation text, help link, etc
+ foreach (var result in assessmentResults)
+ {
+ Console.WriteLine("-------");
+ Console.Write(" ");
+ Console.WriteLine(result.Message);
+ Console.Write(" ");
+ Console.WriteLine(result.Check.HelpLink);
+ }
+ }
+
+ private static bool Prompt(out string? line)
+ {
+ Console.Write("Enter category (ENTER for all categories, 'exit' to leave) > ");
+ line = Console.ReadLine();
+
+ return string.Compare(line, "exit", StringComparison.OrdinalIgnoreCase) != 0;
+ }
+
+ private static void DisplayCategories(string targetName, IEnumerable allTags)
+ {
+ Console.WriteLine($"All categories available for {targetName}:\n");
+
+ foreach (var tag in allTags)
+ {
+ Console.WriteLine($" {tag}");
+ }
+ }
+ }
+}
diff --git a/samples/manage/sql-assessment-api/SqlAssessmentClient/AssessmentClient.sln b/samples/manage/sql-assessment-api/SqlAssessmentClient/AssessmentClient.sln
new file mode 100644
index 00000000..bf523892
--- /dev/null
+++ b/samples/manage/sql-assessment-api/SqlAssessmentClient/AssessmentClient.sln
@@ -0,0 +1,25 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.30621.155
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AssessmentClient.SMO", "AssessmentClient.SMO\AssessmentClient.SMO.csproj", "{C9745F7C-40B1-43FA-AA5D-C2BF0588038D}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {C9745F7C-40B1-43FA-AA5D-C2BF0588038D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {C9745F7C-40B1-43FA-AA5D-C2BF0588038D}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {C9745F7C-40B1-43FA-AA5D-C2BF0588038D}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {C9745F7C-40B1-43FA-AA5D-C2BF0588038D}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {113F74E6-A46A-4090-A4F5-7280F2623F23}
+ EndGlobalSection
+EndGlobal
diff --git a/samples/manage/sql-assessment-api/SqlAssessmentClient/README.md b/samples/manage/sql-assessment-api/SqlAssessmentClient/README.md
new file mode 100644
index 00000000..000e236b
--- /dev/null
+++ b/samples/manage/sql-assessment-api/SqlAssessmentClient/README.md
@@ -0,0 +1,224 @@
+# SQL Assessment API client sample
+
+## Overview
+
+This repository contains an example C# application using SQL Assessment API. The application uses popular [SQL Management Objects (SMO)](https://docs.microsoft.com/en-us/sql/relational-databases/server-management-objects-smo/overview-smo?view=sql-server-ver15) library. WHile it was not required to invoke assessment, SMO gives a convenient object-oriented API for managing SQL Server objects. See [Service based SQL Assessment](#Using-SQL-Tools-Service) for an example of non-SMO application.
+
+To use SQL Assessment API this sample project references [Microsoft.SqlServer.SqlManagementObjects](https://www.nuget.org/packages/Microsoft.SqlServer.SqlManagementObjects) and [Microsoft.SqlServer.Assessment](https://www.nuget.org/packages/Microsoft.SqlServer.Assessment/) Nuget packages.
+
+## SQL Assessment workflow
+
+A typical SQL Assessment workflow consists of three stages:
+
+1. Establish a connection to a SQL Server and select target instance or database (Microsoft.Data.SqlClient, SQL Management Objects, SQL Tools Service, PowerShell).
+
+2. (Optional) Create SQL Assessment check list. A default check list is used if this step was skipped.
+
+3. Invoke assessment on the target object selected at step 1.
+
+## Using SQL Assessment with SQL Management Objects
+
+### Establish a connection and select a SQL Server object with SMO
+
+SQL Management Objects is a handy tool for accessing and managing SQL SErver objects. This sample application connects to a local SQL Server instance with a short statement:
+
+```CSharp
+var target = new Server();
+```
+
+To assess a database replace this line with the following snippet:
+
+```CSharp
+var target = new Server().Databases["MyDatabase"];
+```
+
+See [SMO documentation](https://docs.microsoft.com/en-us/sql/relational-databases/server-management-objects-smo/overview-smo) for more details on connecting to a server or a database.
+
+### Invoke assessment with default check list
+
+SQL Assessment asynchronous code returns a list of SQL Assessment results. Each result can be an assessment note, warning, or error. Every assessment result contains a message to the user with a recommendation. Each assessment note is associated to the corresponding check from the list.
+
+```CSharp
+List results = await target.GetAssessmentResultsList();
+```
+
+### Invoke assessment with selected checks
+
+SQL Assessment API gives a collection of checks currently available for given target. Selected checks may be passed to `GetAssessmentResultsList`.
+
+```CSharp
+IEnumerable availableChecks = target.GetAssessmentItems();
+```
+
+Select checks to be run.
+
+```CSharp
+var checklist = availableChecks.First(5);
+var results = await target.GetAssessmentResultsList(checklist);
+```
+
+### Select checks by category
+
+SQL Assessment check may be tagged with one or more category names. Checks from default check list always have "DefaultRuleset" tag and at least one area tag. "DefaultRuleset" denotes a check produced by default ruleset supplied with SQL Assessment API. Area tags may be "Performance", "Security", "Memory", "Deprecated", "Storage", etc.
+
+```CSharp
+var checklist = target.GetAssessmentItems("Performance", "Security");
+var results = await target.GetAssessmentResultsList(checklist);
+```
+
+This is equivalent to the following code:
+
+```CSharp
+var results = await target.GetAssessmentResultsList("Performance", "Security");
+```
+
+### Custom rule sets
+
+Checks are generated by a SQL Assessment engine for every target. The engine uses rules from one or more rule sets. Rule sets are collected on a stack. A rule set may override rules from an underlying rule set. A ruleset may be constructed with a C# code, but we recommend using declarative JSON format. For more details on rule set files see [SQL Assessment API GitHub page](https://github.com/microsoft/sql-server-samples/tree/master/samples/manage/sql-assessment-api).
+
+```CSharp
+using (var reader = File.OpenText("my ruleset.json"))
+{
+ SqlAssessmentExtensions.Engine.PushRuleFactoryJson(reader);
+}
+```
+
+## Using SQL Tools Service
+
+[SQL Tools Service](https://github.com/microsoft/sqltoolsservice) is a JSON-RPC service over stdio. SQL assessment takes the same three steps: connect, select checks, run.
+
+_In the following examples adjust `Content-Length` value according to actual JSON length including CR or CRLF line endings._
+
+### Connect with SQL Tools Service
+
+```json
+Content-Length:267
+
+{
+ "jsonrpc": "2.0",
+ "id": "12",
+ "method": "connection/connect",
+ "params": {
+ "ownerUri": "my connection",
+ "connection": {
+ "serverName": "(local)",
+ "authenticationType": "Integrated"
+ }
+ }
+}
+```
+
+See [SQL Tools Service documentation](https://microsoft.github.io/sqltoolssdk/) for more details on connecting to a server or a database.
+
+### Get available checks
+
+Use `targetType` to select target type:
+
+1. SQL Server instance.
+
+2. SQL Server database. In this case provide database name while connecting to the target.
+
+```json
+Content-Length:181
+
+{
+ "jsonrpc": "2.0",
+ "id": "12",
+ "method": "assessment/getAssessmentItems",
+ "params": {
+ "targetType": 1,
+ "ownerUri": "my connection"
+ }
+}
+```
+
+Sample output:
+
+```json
+{
+ "jsonrpc": "2.0",
+ "id": "12",
+ "result": {
+ "success": true,
+ "errorMessage": null,
+ "items": [
+ {
+ "rulesetVersion": "1.0.280",
+ "rulesetName": "Microsoft ruleset",
+ "targetType": 1,
+ "targetName": "MYSERVER",
+ "checkId": "TF174",
+ "tags": [
+ "DefaultRuleset",
+ "TraceFlag",
+ "Memory",
+ "Performance"
+ ],
+ "displayName": "TF 174 increases the plan cache bucket count",
+ "description": "Trace Flag 174 increases the SQL Server ...",
+ "helpLink": "https://docs.microsoft.com/sql/t-sql/ ...",
+ "level": "Information"
+ },
+
+ ...
+
+ ]
+ }
+}
+```
+
+### Invoke SQL Assessment with SQL Tools Service
+
+Use the same `targetType`.
+
+```json
+Content-Length:169
+
+{
+ "jsonrpc": "2.0",
+ "id": "12",
+ "method": "assessment/invoke",
+ "params": {
+ "targetType": 1,
+ "ownerUri": "my connection"
+ }
+}
+```
+
+Sample output:
+
+```json
+{
+ "jsonrpc": "2.0",
+ "id": "12",
+ "result": {
+ "success": true,
+ "errorMessage": null,
+ "items": [
+ {
+ "message": "Enable trace flag 834 to use large-page allocations to improve analytical and data warehousing workloads",
+ "kind": 0,
+ "timestamp": "2020-11-09T22:46:36.5529014+03:00",
+ "rulesetVersion": "1.0.280",
+ "rulesetName": "Microsoft ruleset",
+ "targetType": 1,
+ "targetName": "MYSERVER",
+ "checkId": "TF834",
+ "tags": [
+ "DefaultRuleset",
+ "TraceFlag",
+ "Performance",
+ "Memory",
+ "ColumnStore"
+ ],
+ "displayName": "TF 834 enables large-page allocations",
+ "description": "Trace Flag 834 causes the server ...",
+ "helpLink": "https://support.microsoft.com/kb/3210239",
+ "level": "Information"
+ },
+
+ ...
+ ]
+ }
+}
+```
\ No newline at end of file
diff --git a/samples/tutorials/AzureSqlGettingStartedSamples/csharp/Readme.md b/samples/tutorials/AzureSqlGettingStartedSamples/csharp/Readme.md
new file mode 100644
index 00000000..fdfdebbc
--- /dev/null
+++ b/samples/tutorials/AzureSqlGettingStartedSamples/csharp/Readme.md
@@ -0,0 +1,15 @@
+---
+page_type: sample
+languages:
+- csharp
+products:
+- azure-sql-database
+---
+
+# Developing applications with C# and Azure SQL
+
+Pick a platform below to get started:
+* [unix-based (Includes macOS, RHEL, Ubuntu, SLES](https://github.com/Microsoft/sql-server-samples/tree/master/samples/tutorials/AzureSqlGettingStartedSamples/csharp/Unix-based)
+* [Windows](https://github.com/Microsoft/sql-server-samples/tree/master/samples/tutorials/AzureSqlGettingStartedSamples/csharp/Windows)
+
+Please visit our [getting started tutorials](https://www.microsoft.com/en-us/sql-server/developer-get-started/)
diff --git a/samples/tutorials/AzureSqlGettingStartedSamples/csharp/Unix-based/AzureSqlColumnstoreSample/Program.cs b/samples/tutorials/AzureSqlGettingStartedSamples/csharp/Unix-based/AzureSqlColumnstoreSample/Program.cs
new file mode 100644
index 00000000..fc44147c
--- /dev/null
+++ b/samples/tutorials/AzureSqlGettingStartedSamples/csharp/Unix-based/AzureSqlColumnstoreSample/Program.cs
@@ -0,0 +1,136 @@
+using Microsoft.Azure.KeyVault;
+using Microsoft.Azure.KeyVault.Models;
+using Microsoft.Azure.Services.AppAuthentication;
+using System;
+using System.Data.SqlClient;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace AzureSqlColumnstoreSample
+{
+ class Program
+ {
+ static void Main(string[] args)
+ {
+ System.Threading.Tasks.Task task = Program.DoWork(args);
+ // Becuase this program takes user input, have a long wait.
+ var result = task.Wait(TimeSpan.FromMinutes(30));
+ }
+
+ static async System.Threading.Tasks.Task DoWork(string[] args)
+ {
+
+ Console.WriteLine("*** Azure SQL Columnstore demo ***");
+
+ // Build connection string
+ SqlConnectionStringBuilder builder = new SqlConnectionStringBuilder();
+ builder.DataSource = "your_server.database.windows.net"; // update me
+ builder.UserID = "your_user"; // update me
+ builder.Password = await GetPasswordFromKeyVault();
+ builder.InitialCatalog = "your_database";
+
+ // Connect to Azure SQL
+ Console.Write("Connecting to Azure SQL ... ");
+ using (SqlConnection connection = new SqlConnection(builder.ConnectionString))
+ {
+ string sql;
+ try
+ {
+ connection.Open();
+ string dropTable = "Drop table if exists Table_with_3M_rows";
+ using (SqlCommand command = new SqlCommand(dropTable, connection))
+ {
+ command.ExecuteNonQuery();
+ Console.WriteLine("Table cleaned up.");
+ }
+
+ // Insert 5 million rows into the table 'Table_with_3M_rows'
+ Console.Write("Inserting 3 million rows into table 'Table_with_3M_rows'. This takes ~1 minute, please wait ... ");
+ StringBuilder sb = new StringBuilder();
+ sb.Append("WITH a AS (SELECT * FROM (VALUES(1),(2),(3),(4),(5),(6),(7),(8),(9),(10)) AS a(a))");
+ sb.Append("SELECT TOP(3000000)");
+ sb.Append("ROW_NUMBER() OVER (ORDER BY a.a) AS OrderItemId ");
+ sb.Append(",a.a + b.a + c.a + d.a + e.a + f.a + g.a + h.a AS OrderId ");
+ sb.Append(",a.a * 10 AS Price ");
+ sb.Append(",CONCAT(a.a, N' ', b.a, N' ', c.a, N' ', d.a, N' ', e.a, N' ', f.a, N' ', g.a, N' ', h.a) AS ProductName ");
+ sb.Append("INTO Table_with_3M_rows ");
+ sb.Append("FROM a, a AS b, a AS c, a AS d, a AS e, a AS f, a AS g, a AS h;");
+ sql = sb.ToString();
+ using (SqlCommand command = new SqlCommand(sql, connection))
+ {
+ command.ExecuteNonQuery();
+ Console.WriteLine("Done.");
+ }
+
+ // Execute SQL query without columnstore index
+ double elapsedTimeWithoutIndex = SumPrice(connection);
+ Console.WriteLine("Query time WITHOUT columnstore index: " + elapsedTimeWithoutIndex + "ms");
+
+ // Add a Columnstore Index
+ Console.Write("Adding a columnstore to table 'Table_with_3M_rows' ... ");
+ sql = "CREATE CLUSTERED COLUMNSTORE INDEX columnstoreindex ON Table_with_3M_rows;";
+ using (SqlCommand command = new SqlCommand(sql, connection))
+ {
+ command.ExecuteNonQuery();
+ Console.WriteLine("Done.");
+ }
+
+ // Execute the same SQL query again after columnstore index was added
+ double elapsedTimeWithIndex = SumPrice(connection);
+ Console.WriteLine("Query time WITH columnstore index: " + elapsedTimeWithIndex + "ms");
+
+ // Calculate performance gain from adding columnstore index
+ Console.WriteLine("Performance improvement with columnstore index: "
+ + Math.Round(elapsedTimeWithoutIndex / elapsedTimeWithIndex) + "x!");
+ }
+
+ catch (Exception e)
+ {
+ Console.WriteLine(e.ToString());
+ }
+ finally
+ {
+ string dropTable = "Drop table if exists Table_with_3M_rows";
+ using (SqlCommand command = new SqlCommand(dropTable, connection))
+ {
+ command.ExecuteNonQuery();
+ Console.WriteLine("Table cleaned up.");
+ }
+ }
+ }
+ Console.WriteLine("All done. Press any key to finish...");
+ Console.ReadKey(true);
+ }
+
+ private static async Task GetPasswordFromKeyVault()
+ {
+ Console.WriteLine("Trying to get Password from Key Vault. Press a key to continue...");
+ Console.ReadKey(true);
+ /* The next four lines of code show you how to use AppAuthentication library to fetch secrets from your key vault */
+ AzureServiceTokenProvider azureServiceTokenProvider = new AzureServiceTokenProvider();
+ KeyVaultClient keyVaultClient = new KeyVaultClient(new KeyVaultClient.AuthenticationCallback(azureServiceTokenProvider.KeyVaultTokenCallback));
+ SecretBundle secret = await keyVaultClient.GetSecretAsync("https://your_keyvault_name.vault.azure.net/secrets/AppSecret"); // update me
+ return secret.Value;
+ }
+
+ public static double SumPrice(SqlConnection connection)
+ {
+ String sql = "SELECT SUM(Price) FROM Table_with_3M_rows";
+ long startTicks = DateTime.Now.Ticks;
+ using (SqlCommand command = new SqlCommand(sql, connection))
+ {
+ try
+ {
+ var sum = command.ExecuteScalar();
+ TimeSpan elapsed = TimeSpan.FromTicks(DateTime.Now.Ticks) - TimeSpan.FromTicks(startTicks);
+ return elapsed.TotalMilliseconds;
+ }
+ catch (Exception e)
+ {
+ Console.WriteLine(e.ToString());
+ }
+ }
+ return 0;
+ }
+ }
+}
\ No newline at end of file
diff --git a/samples/tutorials/AzureSqlGettingStartedSamples/csharp/Unix-based/AzureSqlEFSample/EFSampleContext.cs b/samples/tutorials/AzureSqlGettingStartedSamples/csharp/Unix-based/AzureSqlEFSample/EFSampleContext.cs
new file mode 100644
index 00000000..750feaf7
--- /dev/null
+++ b/samples/tutorials/AzureSqlGettingStartedSamples/csharp/Unix-based/AzureSqlEFSample/EFSampleContext.cs
@@ -0,0 +1,22 @@
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.SqlServer;
+
+namespace AzureSqlEFSample
+{
+ public class EFSampleContext : DbContext
+ {
+ string _connectionString;
+ public EFSampleContext(string connectionString)
+ {
+ this._connectionString = connectionString;
+
+ }
+ protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
+ {
+ optionsBuilder.UseSqlServer(this._connectionString);
+ }
+
+ public DbSet Users { get; set; }
+ public DbSet Tasks { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/samples/tutorials/AzureSqlGettingStartedSamples/csharp/Unix-based/AzureSqlEFSample/Program.cs b/samples/tutorials/AzureSqlGettingStartedSamples/csharp/Unix-based/AzureSqlEFSample/Program.cs
new file mode 100644
index 00000000..e2da50da
--- /dev/null
+++ b/samples/tutorials/AzureSqlGettingStartedSamples/csharp/Unix-based/AzureSqlEFSample/Program.cs
@@ -0,0 +1,113 @@
+using System;
+using System.Data.SqlClient;
+using Microsoft.Azure.KeyVault;
+using Microsoft.Azure.KeyVault.Models;
+using Microsoft.Azure.Services.AppAuthentication;
+using System.Threading.Tasks;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace AzureSqlEFSample
+{
+ class Program
+ {
+ static void Main(string[] args)
+ {
+ System.Threading.Tasks.Task task = Program.DoWork(args);
+ // Becuase this program takes user input, have a long wait.
+ var result = task.Wait(TimeSpan.FromMinutes(30));
+ }
+
+ static async System.Threading.Tasks.Task DoWork(string[] args)
+ {
+ Console.WriteLine("** C# CRUD sample with Entity Framework and Azure SQL DB**\n");
+
+ // Build connection string
+ SqlConnectionStringBuilder builder = new SqlConnectionStringBuilder();
+ builder.DataSource = "your_server_name.database.windows.net"; // update me
+ builder.UserID = "your_user"; // update me
+ builder.Password = await GetPasswordFromKeyVault(); // taken from Key Vault
+ builder.InitialCatalog = "your_db_name"; // Update me
+
+ using (EFSampleContext context = new EFSampleContext(builder.ConnectionString))
+ {
+ try
+ {
+ context.Database.EnsureDeleted();
+ context.Database.EnsureCreated();
+ Console.WriteLine("Created database schema from C# classes.");
+
+ // Create demo: Create a Task instance and save it to the database
+ Task newTask = new Task() { Title = "Ship Helsinki", IsComplete = false, DueDate = DateTime.Parse("04-01-2017") };
+ context.Tasks.Add(newTask);
+ context.SaveChanges();
+ Console.WriteLine("\nCreated Task: " + newTask.ToString());
+
+ // Association demo: Assign task to user
+
+ // Read demo: find incomplete tasks assigned to user 'Anna'
+ Console.WriteLine("\nIncomplete tasks assigned to 'Anna':");
+ var query = from t in context.Tasks
+ where t.IsComplete == false &&
+ t.AssignedTo.FirstName.Equals("Anna")
+ select t;
+ foreach (var t in query)
+ {
+ Console.WriteLine(t.ToString());
+ }
+
+ // Update demo: change the 'dueDate' of a task
+ Task taskToUpdate = context.Tasks.First(); // get the first task
+ Console.WriteLine("\nUpdating task: " + taskToUpdate.ToString());
+ taskToUpdate.DueDate = DateTime.Parse("06-30-2016");
+ context.SaveChanges();
+ Console.WriteLine("dueDate changed: " + taskToUpdate.ToString());
+
+ // Delete demo: delete all tasks with a dueDate in 2016
+ Console.WriteLine("\nDeleting all tasks with a dueDate in 2016");
+ DateTime dueDate2016 = DateTime.Parse("12-31-2016");
+ List queryResults = context.Tasks.Where(t => t.DueDate < dueDate2016).ToList();
+ foreach (Task t in queryResults)
+ {
+ Console.WriteLine("Deleting task: " + t.ToString());
+ context.Tasks.Remove(t);
+ }
+ context.SaveChanges();
+
+ // Show tasks after the 'Delete' operation - there should be 0 tasks
+ Console.WriteLine("\nTasks after delete:");
+ List tasksAfterDelete = (from t in context.Tasks select t).ToList();
+ if (tasksAfterDelete.Count == 0)
+ {
+ Console.WriteLine("[None]");
+ }
+ else
+ {
+ foreach (Task t in query)
+ {
+ Console.WriteLine(t.ToString());
+ }
+ }
+ }
+ catch (SqlException e)
+ {
+ Console.WriteLine(e.ToString());
+ }
+ }
+
+ Console.WriteLine("All done. Press any key to finish...");
+ Console.ReadKey(true);
+ }
+
+ private static async Task GetPasswordFromKeyVault()
+ {
+ Console.WriteLine("Trying to get Password from Key Vault. Press a key to continue...");
+ Console.ReadKey(true);
+ /* The next four lines of code show you how to use AppAuthentication library to fetch secrets from your key vault */
+ AzureServiceTokenProvider azureServiceTokenProvider = new AzureServiceTokenProvider();
+ KeyVaultClient keyVaultClient = new KeyVaultClient(new KeyVaultClient.AuthenticationCallback(azureServiceTokenProvider.KeyVaultTokenCallback));
+ SecretBundle secret = await keyVaultClient.GetSecretAsync("https://your_keyvault_name.vault.azure.net/secrets/AppSecret"); // update me
+ return secret.Value;
+ }
+ }
+}
\ No newline at end of file
diff --git a/samples/tutorials/AzureSqlGettingStartedSamples/csharp/Unix-based/AzureSqlEFSample/Task.cs b/samples/tutorials/AzureSqlGettingStartedSamples/csharp/Unix-based/AzureSqlEFSample/Task.cs
new file mode 100644
index 00000000..c9067532
--- /dev/null
+++ b/samples/tutorials/AzureSqlGettingStartedSamples/csharp/Unix-based/AzureSqlEFSample/Task.cs
@@ -0,0 +1,18 @@
+using System;
+
+namespace AzureSqlEFSample
+{
+ public class Task
+ {
+ public int TaskId { get; set; }
+ public string Title { get; set; }
+ public DateTime DueDate { get; set; }
+ public bool IsComplete { get; set; }
+ public virtual User AssignedTo { get; set; }
+
+ public override string ToString()
+ {
+ return "Task [id=" + this.TaskId + ", title=" + this.Title + ", dueDate=" + this.DueDate.ToString() + ", IsComplete=" + this.IsComplete + "]";
+ }
+ }
+}
\ No newline at end of file
diff --git a/samples/tutorials/AzureSqlGettingStartedSamples/csharp/Unix-based/AzureSqlEFSample/User.cs b/samples/tutorials/AzureSqlGettingStartedSamples/csharp/Unix-based/AzureSqlEFSample/User.cs
new file mode 100644
index 00000000..5dfd2930
--- /dev/null
+++ b/samples/tutorials/AzureSqlGettingStartedSamples/csharp/Unix-based/AzureSqlEFSample/User.cs
@@ -0,0 +1,22 @@
+using System;
+using System.Collections.Generic;
+
+namespace AzureSqlEFSample
+{
+ public class User
+ {
+ public int UserId { get; set; }
+ public String FirstName { get; set; }
+ public String LastName { get; set; }
+ public virtual IList