struct ldb_result *res = NULL;
struct ldb_context *ldb = ldb_module_get_ctx(module);
+ *pso_count = 0;
domain_dn = ldb_get_default_basedn(ldb);
psc_dn = ldb_dn_new_fmt(mem_ctx, ldb,
"CN=Password Settings Container,CN=System,%s",
LDB_SCOPE_ONELEVEL, attrs,
DSDB_FLAG_NEXT_MODULE, parent,
"(objectClass=msDS-PasswordSettings)");
+
+ /*
+ * Just ignore PSOs if the container doesn't exist. This is a weird
+ * corner-case where the AD DB was created from a pre-2008 base schema,
+ * and then the FL was manually upgraded.
+ */
+ if (ret == LDB_ERR_NO_SUCH_OBJECT) {
+ DBG_NOTICE("No Password Settings Container exists\n");
+ return LDB_SUCCESS;
+ }
+
if (ret != LDB_SUCCESS) {
return ret;
}