return snapin_guid_string_to_name(guid, gpo_cse_snapin_extensions);
}
-void dump_gp_ext(struct GP_EXT *gp_ext)
+void dump_gp_ext(struct GP_EXT *gp_ext, int debuglevel)
{
- int lvl = 10;
+ int lvl = debuglevel;
int i;
if (gp_ext == NULL) {
return;
}
- DEBUG(lvl,("---------------------\n\n"));
- DEBUGADD(lvl,("name:\t\t\t%s\n", gp_ext->gp_extension));
+ DEBUG(lvl,("\t---------------------\n\n"));
+ DEBUGADD(lvl,("\tname:\t\t\t%s\n", gp_ext->gp_extension));
for (i=0; i< gp_ext->num_exts; i++) {
- DEBUGADD(lvl,("extension:\t\t\t%s\n", gp_ext->extensions_guid[i]));
- DEBUGADD(lvl,("extension (name):\t\t\t%s\n", gp_ext->extensions[i]));
+ DEBUGADD(lvl,("\textension:\t\t\t%s\n", gp_ext->extensions_guid[i]));
+ DEBUGADD(lvl,("\textension (name):\t\t\t%s\n", gp_ext->extensions[i]));
- DEBUGADD(lvl,("snapin:\t\t\t%s\n", gp_ext->snapins_guid[i]));
- DEBUGADD(lvl,("snapin (name):\t\t\t%s\n", gp_ext->snapins[i]));
+ DEBUGADD(lvl,("\tsnapin:\t\t\t%s\n", gp_ext->snapins_guid[i]));
+ DEBUGADD(lvl,("\tsnapin (name):\t\t\t%s\n", gp_ext->snapins[i]));
}
}
-void dump_gpo(TALLOC_CTX *mem_ctx, struct GROUP_POLICY_OBJECT *gpo)
+void dump_gpo(TALLOC_CTX *mem_ctx, struct GROUP_POLICY_OBJECT *gpo, int debuglevel)
{
- int lvl = 1;
+ int lvl = debuglevel;
if (gpo == NULL) {
return;
if (!ADS_ERR_OK(status)) {
return;
}
- dump_gp_ext(&gp_ext);
+ dump_gp_ext(&gp_ext, lvl);
}
if (gpo->user_extensions) {
if (!ADS_ERR_OK(status)) {
return;
}
- dump_gp_ext(&gp_ext);
+ dump_gp_ext(&gp_ext, lvl);
}
};
DEBUG(lvl,("get gpo for %s failed: %s\n", gp_link->link_names[i], ads_errstr(status)));
return;
}
- dump_gpo(mem_ctx, &gpo);
+ dump_gpo(mem_ctx, &gpo, lvl);
}
}
}
"net ads gpo <COMMAND>\n"\
"<COMMAND> can be either:\n"\
" ADDLINK Link a container to a GPO\n"\
-" APPLY Apply all GPOs\n"\
-" DELETELINK Delete a gPLink from a container\n"\
-" EFFECTIVE Lists all GPOs assigned to a machine\n"\
+/* " APPLY Apply all GPOs\n"\ */
+/* " DELETELINK Delete a gPLink from a container\n"\ */
+" REFRESH Lists all GPOs assigned to an account and downloads them\n"\
" GETGPO Lists specified GPO\n"\
" GETLINK Lists gPLink of a containter\n"\
" HELP Prints this help message\n"\
return -1;
}
-static int net_ads_gpo_effective(int argc, const char **argv)
+static int net_ads_gpo_refresh(int argc, const char **argv)
{
TALLOC_CTX *mem_ctx;
ADS_STRUCT *ads;
NTSTATUS result;
if (argc < 1) {
- printf("usage: net ads gpo effective <username|machinename>\n");
+ printf("usage: net ads gpo refresh <username|machinename>\n");
return -1;
}
- mem_ctx = talloc_init("net_ads_gpo_effective");
+ mem_ctx = talloc_init("net_ads_gpo_refresh");
if (mem_ctx == NULL) {
return -1;
}
goto out;
}
- dump_gpo(mem_ctx, &gpo);
+ dump_gpo(mem_ctx, &gpo, 1);
ads_memfree(ads, dn);
}
return 0;
}
+#if 0 /* not yet */
+
static int net_ads_gpo_apply(int argc, const char **argv)
{
TALLOC_CTX *mem_ctx;
return 0;
}
+#endif
static int net_ads_gpo_get_link(int argc, const char **argv)
{
return 0;
}
+#if 0 /* broken */
+
static int net_ads_gpo_delete_link(int argc, const char **argv)
{
ADS_STRUCT *ads;
return 0;
}
+#endif
+
static int net_ads_gpo_get_gpo(int argc, const char **argv)
{
ADS_STRUCT *ads;
ADS_STATUS status;
TALLOC_CTX *mem_ctx;
struct GROUP_POLICY_OBJECT gpo;
- uint32 sysvol_gpt_version;
- char *display_name;
if (argc < 1) {
+ printf("usage: net ads gpo getgpo <gpo>\n");
return -1;
}
goto out;
}
- dump_gpo(mem_ctx, &gpo);
-
- status = ADS_ERROR_NT(ads_gpo_get_sysvol_gpt_version(ads, mem_ctx,
- gpo.file_sys_path,
- &sysvol_gpt_version,
- &display_name));
- if (!ADS_ERR_OK(status)) {
- goto out;
- }
-
- printf("sysvol GPT version: %d\n", sysvol_gpt_version);
+ dump_gpo(mem_ctx, &gpo, 1);
out:
talloc_destroy(mem_ctx);
{
struct functable func[] = {
{"LIST", net_ads_gpo_list},
- {"EFFECTIVE", net_ads_gpo_effective},
+ {"REFRESH", net_ads_gpo_refresh},
{"ADDLINK", net_ads_gpo_add_link},
- {"DELETELINK", net_ads_gpo_delete_link},
+ /* {"DELETELINK", net_ads_gpo_delete_link}, */
{"GETLINK", net_ads_gpo_get_link},
{"GETGPO", net_ads_gpo_get_gpo},
{"HELP", net_ads_gpo_usage},
- {"APPLY", net_ads_gpo_apply},
+ /* {"APPLY", net_ads_gpo_apply}, */
{NULL, NULL}
};