summaryrefslogtreecommitdiff
path: root/source3/utils
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2009-06-07 23:11:12 +0200
committerVolker Lendecke <vl@samba.org>2009-06-07 23:14:40 +0200
commit4de4c0318d0730fb1c3434fe0ab282cf8fb67f65 (patch)
tree365cbbc3345293c32790ed390b1df437f2798437 /source3/utils
parente2611e2b12d201bfbdcb0aa1b9d8d5e865c82ec1 (diff)
downloadsamba-4de4c0318d0730fb1c3434fe0ab282cf8fb67f65.tar.gz
samba-4de4c0318d0730fb1c3434fe0ab282cf8fb67f65.tar.bz2
samba-4de4c0318d0730fb1c3434fe0ab282cf8fb67f65.zip
Add "net sam createdomaingroup"
Diffstat (limited to 'source3/utils')
-rw-r--r--source3/utils/net_sam.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/source3/utils/net_sam.c b/source3/utils/net_sam.c
index 6b3f5e5721..45dfb61cef 100644
--- a/source3/utils/net_sam.c
+++ b/source3/utils/net_sam.c
@@ -922,6 +922,34 @@ static int net_sam_unmapunixgroup(struct net_context *c, int argc, const char **
}
/*
+ * 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
*/
@@ -1830,6 +1858,14 @@ int net_sam(struct net_context *c, int argc, const char **argv)
" 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,
NET_TRANSPORT_LOCAL,