関数 | |
static NTSTATUS | cmd_ds_dsrole_getprimarydominfo (struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, int argc, const char **argv) |
static NTSTATUS | cmd_ds_enum_domain_trusts (struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, int argc, const char **argv) |
変数 | |
cmd_set | ds_commands [] |
static NTSTATUS cmd_ds_dsrole_getprimarydominfo | ( | struct rpc_pipe_client * | cli, | |
TALLOC_CTX * | mem_ctx, | |||
int | argc, | |||
const char ** | argv | |||
) | [static] |
参照先 DS_DOMINFO_CTR::basic・cli・DSROLE_PRIMARY_DOMAIN_INFO_BASIC::flags・DSROLE_PRIMARY_DOMAIN_INFO_BASIC::machine_role・printf()・result・rpccli_ds_getprimarydominfo().
00030 { 00031 NTSTATUS result; 00032 DS_DOMINFO_CTR ctr; 00033 00034 result = rpccli_ds_getprimarydominfo( cli, mem_ctx, DsRolePrimaryDomainInfoBasic, &ctr ); 00035 if ( NT_STATUS_IS_OK(result) ) 00036 { 00037 printf ("Machine Role = [%d]\n", ctr.basic->machine_role); 00038 00039 if ( ctr.basic->flags & DSROLE_PRIMARY_DS_RUNNING ) { 00040 printf( "Directory Service is running.\n"); 00041 printf( "Domain is in %s mode.\n", (ctr.basic->flags & DSROLE_PRIMARY_DS_MIXED_MODE) ? "mixed" : "native" ); 00042 } 00043 else 00044 printf( "Directory Service not running on server\n"); 00045 } 00046 00047 return result; 00048 }
static NTSTATUS cmd_ds_enum_domain_trusts | ( | struct rpc_pipe_client * | cli, | |
TALLOC_CTX * | mem_ctx, | |||
int | argc, | |||
const char ** | argv | |||
) | [static] |
参照先 cli・cli_state::desthost・ds_domain_trust::dns_domain・flags・ds_domain_trust::netbios_domain・num_domains・printf()・result・rpccli_ds_enum_domain_trusts().
00053 { 00054 NTSTATUS result; 00055 uint32 flags = DS_DOMAIN_IN_FOREST; 00056 struct ds_domain_trust *trusts = NULL; 00057 unsigned int num_domains = 0; 00058 int i; 00059 00060 if (argc > 1) { 00061 flags = atoi(argv[1]); 00062 } 00063 00064 result = rpccli_ds_enum_domain_trusts( cli, mem_ctx, cli->cli->desthost, flags, 00065 &trusts, &num_domains ); 00066 00067 printf( "%d domains returned\n", num_domains ); 00068 00069 for (i=0; i<num_domains; i++ ) 00070 printf("%s (%s)\n", trusts[i].dns_domain, trusts[i].netbios_domain); 00071 00072 return result; 00073 }
struct cmd_set ds_commands[] |
初期値:
{ { "LSARPC-DS" }, { "dsroledominfo", RPC_RTYPE_NTSTATUS, cmd_ds_dsrole_getprimarydominfo, NULL, PI_LSARPC_DS, NULL, "Get Primary Domain Information", "" }, { "dsenumdomtrusts", RPC_RTYPE_NTSTATUS, cmd_ds_enum_domain_trusts, NULL, PI_NETLOGON, NULL, "Enumerate all trusted domains in an AD forest", "" }, { NULL } }