1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

Add "net sam createdomaingroup"

This commit is contained in:
Volker Lendecke 2009-06-07 23:11:12 +02:00
parent e2611e2b12
commit 4de4c0318d

View File

@ -921,6 +921,34 @@ static int net_sam_unmapunixgroup(struct net_context *c, int argc, const char **
return 0;
}
/*
* Create a domain group
*/
static int net_sam_createdomaingroup(struct net_context *c, int argc,
const char **argv)
{
NTSTATUS status;
uint32 rid;
if (argc != 1 || c->display_usage) {
d_fprintf(stderr, "usage: net sam createdomaingroup <name>\n");
return -1;
}
status = pdb_create_dom_group(talloc_tos(), argv[0], &rid);
if (!NT_STATUS_IS_OK(status)) {
d_fprintf(stderr, "Creating %s failed with %s\n",
argv[0], nt_errstr(status));
return -1;
}
d_printf("Created domain group %s with RID %d\n", argv[0], rid);
return 0;
}
/*
* Create a local group
*/
@ -1829,6 +1857,14 @@ int net_sam(struct net_context *c, int argc, const char **argv)
"net sam createlocalgroup\n"
" Create a new local group"
},
{
"createdomaingroup",
net_sam_createdomaingroup,
NET_TRANSPORT_LOCAL,
"Create a new group",
"net sam createdomaingroup\n"
" Create a new group"
},
{
"deletelocalgroup",
net_sam_deletelocalgroup,