PRO: Domains

PRO: Domains #

All features described on this page are part of the Professional Edition.

While in beta, you can enable the Professional Edition by creating an account and downloading a license from

The PRO edition will become a paid version. Until then, PRO features expire 60 days after the build date. Please see for updated builds or run sqldsc update.

Domain Targets #

The PRO version can use domain specific target files. If you do nothing different, it will continue to use targets.hcl.

You can create domain specific target files. For example,

  • DOMAIN1.targets.hcl for domain1 (it’s not case-sensitive)
  • DOMAIN2.targets.hcl for domain2

By default, the PRO version will run for the domain specified in the USERDOMAIN environment variable. This variable is automaticallly set by Windows for all domain joined computers. SQLDSC will search for a target file for that domain. If it doesn’t find one it will fall back to targets.hcl. If you’re using domain specific target files, you should probably delete targets.hcl or leave it empty.

To run for a differnt domain than the current one, specify a domain using the the --domain parameter. This parameter only applies to the test and apply commands. For example,

sqldsc test --domain other-domain --verbose 

This will process the targets listed in OTHER-DOMAIN.targets.hcl (or targets.hcl if that file isn’t found). Processing for a separate domain is often used to handle multiple domains where a trust relationship and connectivity are available.

Domain Defaults #

The PRO version also support domain specific defaults. After processing defaults.hcl, it will look for domain specific defaults.

The order of default files processed is

  1. defaults.hcl
  2. DOMAIN_ONE.defaults.hcl
  3. All role files in order (see Roles)
  4. nodes\node.hcl
  5. nodes\node__instance.hcl
  6. nodes\DOMAIN_ONE\node.hcl
  7. nodes\DOMAIN_ONE\node__instance.hcl

Remember that later processed files override values in earlier files.

NOTE: The domain targets aren’t strict. You could put reachable targets in DOMAIN_ONE.defaults.hcl that aren’t actually in the domain. When getting the configuration files, it looks at the server’s domain (using USER_DOMAIN()) to determine which domain default file to use. Be very careful crossing domain lines.