bsharath
asked on
Create a distribution group in the root Domain and add users. I have the group names and user names in 2 diffetent txt files. Any way of doing this.
Hi,
Create a distribution group in the root Domain and add users. I have the group names and user names in 2 diffetent txt files. Any way of doing this.
A script that checkes the "Group.txt" and creates the group and add's the user names that are in the "Users.txt" file
I need to create 40 groups with the similar 100+ users.
Any help....
Reards
Sharath
Create a distribution group in the root Domain and add users. I have the group names and user names in 2 diffetent txt files. Any way of doing this.
A script that checkes the "Group.txt" and creates the group and add's the user names that are in the "Users.txt" file
I need to create 40 groups with the similar 100+ users.
Any help....
Reards
Sharath
can you give example input from both files and the desired result in terms of group and user creation?
ASKER
2 txt files
Groups.txt
Users.txt
When script run has to check the "Groups.txt" create the groups. Should have an option for Universal \ Distribution or Global \Security and add all users in the txt to the group.
If i have 10 group names and run the script create 10 groups and add all users to the 10 groups.
Results file that can show success/failure too..
Groups.txt
Users.txt
When script run has to check the "Groups.txt" create the groups. Should have an option for Universal \ Distribution or Global \Security and add all users in the txt to the group.
If i have 10 group names and run the script create 10 groups and add all users to the 10 groups.
Results file that can show success/failure too..
ASKER
2 txt files
Groups.txt
Users.txt
When script run has to check the "Groups.txt" create the groups. Should have an option for Universal \ Distribution or Global \Security and add all users in the txt to the group.
If i have 10 group names and run the script create 10 groups and add all users to the 10 groups.
Results file that can show success/failure too..
Groups.txt
Users.txt
When script run has to check the "Groups.txt" create the groups. Should have an option for Universal \ Distribution or Global \Security and add all users in the txt to the group.
If i have 10 group names and run the script create 10 groups and add all users to the 10 groups.
Results file that can show success/failure too..
Sharath, there's code to create four types of group definitions described here:
http://www.activexperts.com/activmonitor/windowsmanagement/adminscripts/usersgroups/groups/
Domain Local Distribution
Global Security
Universal Distribution
Universal Security
I'm thinking, in your Groups.txt, if you have
GroupA|Global Security
GroupB|Universal Security
etc, where the group name is separated by a pipe character to the type, we can create the group correctly.....are you able to do that?
Regards,
Rob.
http://www.activexperts.com/activmonitor/windowsmanagement/adminscripts/usersgroups/groups/
Domain Local Distribution
Global Security
Universal Distribution
Universal Security
I'm thinking, in your Groups.txt, if you have
GroupA|Global Security
GroupB|Universal Security
etc, where the group name is separated by a pipe character to the type, we can create the group correctly.....are you able to do that?
Regards,
Rob.
ASKER
Can the group type be mentioned in the script Rob...
So i can have 4 diffirent scripts to do this...
So i can have 4 diffirent scripts to do this...
ASKER
Can the group type be mentioned in the script Rob...
So i can have 4 diffirent scripts to do this...
So i can have 4 diffirent scripts to do this...
Oh, yeah, that's the other option.....you can have one script for each group type......
What if we make just one script, with a message box that says
What group type are you creating from <groups.txt>?
1) Domain Local Distribution
2) Global Security
3) Universal Distribution
4) Universal Security
and you can select a number, then it will create that group type?
Rob.
What if we make just one script, with a message box that says
What group type are you creating from <groups.txt>?
1) Domain Local Distribution
2) Global Security
3) Universal Distribution
4) Universal Security
and you can select a number, then it will create that group type?
Rob.
ASKER
Yes that would be even better...
ASKER
Yes that would be even better...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank Rob where will the group get created. Can i mention the local OU or Root OU path in the script.
ASKER
Thank Rob where will the group get created. Can i mention the local OU or Root OU path in the script.
On this line:
strOU = "CN=Users," & strDomain
and also, when you run it, you will see where the groups will be created in the message box.
Regards,
Rob.
strOU = "CN=Users," & strDomain
and also, when you run it, you will see where the groups will be created in the message box.
Regards,
Rob.
ASKER
Rob it works great when want to create the group in local Domain.
When i enter the OU path as the Root Domain. Just the OU name. I get an error as cannot find the OU...
Is there any thing we need to change for root domain.
When i enter the OU path as the Root Domain. Just the OU name. I get an error as cannot find the OU...
Is there any thing we need to change for root domain.
ASKER
Rob it works great when want to create the group in local Domain.
When i enter the OU path as the Root Domain. Just the OU name. I get an error as cannot find the OU...
Is there any thing we need to change for root domain.
When i enter the OU path as the Root Domain. Just the OU name. I get an error as cannot find the OU...
Is there any thing we need to change for root domain.
Try changing this:
strOU = "CN=Users," & strDomain
to something like
strOU = "rootDC1/CN=Users,DC=root, DC=domain, DC=com"
Regards,
Rob.
strOU = "CN=Users," & strDomain
to something like
strOU = "rootDC1/CN=Users,DC=root,
Regards,
Rob.
ASKER
Rob i think the script by default takes the Domain Name. Now when i change the data as above it even gets the Domain name at the end of this
strOU = "rootDC1/CN=Users,DC=root, DC=domain, DC=com"
strOU = "rootDC1/CN=Users,DC=root,
ASKER
Rob i think the script by default takes the Domain Name. Now when i change the data as above it even gets the Domain name at the end of this
strOU = "rootDC1/CN=Users,DC=root, DC=domain, DC=com"
strOU = "rootDC1/CN=Users,DC=root,
ASKER
Rob i commented this
'& strDomain
I get this
-------------------------- -
Windows Script Host
-------------------------- -
Script: C:\Create groups & add Users.vbs
Line: 26
Char: 1
Error: There is no such object on the server.
Code: 80072030
Source: (null)
-------------------------- -
OK
-------------------------- -
'& strDomain
I get this
--------------------------
Windows Script Host
--------------------------
Script: C:\Create groups & add Users.vbs
Line: 26
Char: 1
Error: There is no such object on the server.
Code: 80072030
Source: (null)
--------------------------
OK
--------------------------
ASKER
Rob i commented this
'& strDomain
I get this
-------------------------- -
Windows Script Host
-------------------------- -
Script: C:\Create groups & add Users.vbs
Line: 26
Char: 1
Error: There is no such object on the server.
Code: 80072030
Source: (null)
-------------------------- -
OK
-------------------------- -
'& strDomain
I get this
--------------------------
Windows Script Host
--------------------------
Script: C:\Create groups & add Users.vbs
Line: 26
Char: 1
Error: There is no such object on the server.
Code: 80072030
Source: (null)
--------------------------
OK
--------------------------
Try
strOU = "CN=Users,DC=root,DC=domai n,DC=com"
without the DC name....it may work....
Rob.
strOU = "CN=Users,DC=root,DC=domai
without the DC name....it may work....
Rob.
ASKER
I tried Rob but did not work
strOU = "CN=All Groups ,DC=root,DC=domain,DC=com"
Is there a problem with a space in the OU name...
strOU = "CN=All Groups ,DC=root,DC=domain,DC=com"
Is there a problem with a space in the OU name...
ASKER
I tried Rob but did not work
strOU = "CN=All Groups ,DC=root,DC=domain,DC=com"
Is there a problem with a space in the OU name...
strOU = "CN=All Groups ,DC=root,DC=domain,DC=com"
Is there a problem with a space in the OU name...
ASKER
I tested Rob it created a group on the root Domain but not in an OU with spaces...
ASKER
I tested Rob it created a group on the root Domain but not in an OU with spaces...
Yes, if the group name does not have the space, that will not work....
ASKER
If the OU name has spaces? it does not create.
Oh, with
strOU = "CN=All Groups,DC=root,DC=domain,D C=com"
that first CN= only works for inbuilt containers, for custom OU's, you need OU instead of CN
strOU = "OU=All Groups,DC=root,DC=domain,D C=com"
Regards,
Rob.
strOU = "CN=All Groups,DC=root,DC=domain,D
that first CN= only works for inbuilt containers, for custom OU's, you need OU instead of CN
strOU = "OU=All Groups,DC=root,DC=domain,D
Regards,
Rob.
ASKER
Thanks a lot Rob worked perfect now...
Any help with these Rob ...
https://www.experts-exchange.com/questions/23774997/Any-script-that-can-query-a-group-on-the-root-Domain-and-get-me-the-results-as-this.html
https://www.experts-exchange.com/questions/23762449/Enable-Disable-all-computers-in-a-file.html
Any help with these Rob ...
https://www.experts-exchange.com/questions/23774997/Any-script-that-can-query-a-group-on-the-root-Domain-and-get-me-the-results-as-this.html
https://www.experts-exchange.com/questions/23762449/Enable-Disable-all-computers-in-a-file.html