Create a new group in Active Directory ?
Hello,
I'd like to create a new group in Active Directory. Can somebody show me a sample code please ?
Thanks.
Someone should show you how to perform a search. There's a sample in this forum.
http://forums.sun.com/thread.jspa?threadID=623860
Similar Messages
-
Need Help creating new user in Active Directory
I am trying to create a new user in active directory via a java application. I have included the code that I am using. I am able to successfully bind to Active Directory. I have been able to change passwords, and delete users, but I have not been able to create a user.
ldapHost : "mta101.DOM101.CEL.ACC.AF.MIL"
domainName: "dc=dom101,dc=cel,dc=acc,dc=af,dc=mil"
existing account: CN=Brett K. Humpherys,OU=Users,OU=CEL
I get the following error on the createSubcontext statement:
javax.naming.directory.InvalidAttributeValueException: [LDAP: error code 21 - 00000057: LdapErr: DSID-0C09098B, comment: Error in attribute conversion operation, data 0, v893 ; remaining name 'CN=test1,OU=Users,OU=CEL'
I have commented out the password portion and change the ObjectCategory to a 32 and get the same error.
public GblStatus createAccount7(DbaDb dbConn,
String jsrcName,
String personName,
String username,
String password)
Hashtable ldapEnv = new Hashtable(11);
ldapEnv.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
ldapEnv.put(Context.PROVIDER_URL, "ldap://" + this.ldapHost + ":636");
ldapEnv.put(Context.SECURITY_AUTHENTICATION, "simple");
ldapEnv.put(Context.SECURITY_PROTOCOL, "ssl");
ldapEnv.put(Context.REFERRAL, "ignore");
ldapEnv.put(Context.SECURITY_PRINCIPAL,"cn=" + this.adminAcct + ",cn=users," + this.domainName);
ldapEnv.put(Context.SECURITY_CREDENTIALS, this.adminPwd);
try
// Create the initial context
DirContext ctx = new InitialDirContext(ldapEnv);
BasicAttributes attrs = new BasicAttributes();
BasicAttribute ocs = new BasicAttribute("objectclass");
ocs.add("top");
ocs.add("person");
ocs.add("organizationalPerson");
ocs.add("user");
attrs.put(ocs);
BasicAttribute gn = new BasicAttribute("givenName", "test1");
attrs.put(gn);
BasicAttribute sn = new BasicAttribute("sn", "");
attrs.put(sn);
BasicAttribute cn = new BasicAttribute("cn", "test1");
attrs.put(cn);
BasicAttribute uac = new BasicAttribute("userAccountControl", "66048");
attrs.put(uac);
BasicAttribute sam = new BasicAttribute("sAMAccountName", "test1");
attrs.put(sam);
BasicAttribute disName = new BasicAttribute("displayName", "test1");
attrs.put(disName);
BasicAttribute userPrincipalName = new BasicAttribute
("userPrincipalName", "[email protected]");
attrs.put(userPrincipalName);
BasicAttribute instanceType = new BasicAttribute("instanceType", "4");
attrs.put(instanceType);
BasicAttribute objectCategory = new BasicAttribute
("objectCategory","CN=User,CN=Schema,CN=Configuration," + domainName);
attrs.put(objectCategory);
String newVal = new String("\"password\"");
byte _bytes[] = newVal.getBytes("Unicode");
byte bytes[] = new byte[_bytes.length - 2];
System.arraycopy(_bytes, 2, bytes, 0, _bytes.length - 2);
BasicAttribute attribute = new BasicAttribute("unicodePwd");
attribute.add((byte[]) bytes);
attrs.put(attribute);
ctx.createSubcontext("CN=test1,OU=Users,OU=CEL", attrs);
ctx.close();
catch (NameAlreadyBoundException nex)
System.out.println("User ID is already in use, please select a different user ID ...");
catch (Exception ex)
System.out.println("Failed to create user account... Please verify the user information...");
ex.printStackTrace();
return new GblStatus();
Any help would be much appreciated.Hi .,
me too got up with same problem., can anyone help me.??
Someone help me to create attributes in AD using LDAP
package LDAPpack;
import javax.naming.*;
import javax.naming.directory.*;
import javax.naming.ldap.InitialLdapContext;
import javax.naming.ldap.LdapContext;
import java.util.Hashtable;
class CreateAttrs {
public static void main(String[] args) {
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory");
env.put(Context.PROVIDER_URL, "ldap://10.242.6.166:389/");
env.put(Context.SECURITY_AUTHENTICATION,"simple");
env.put(Context.SECURITY_PRINCIPAL, "CN=cname,OU=Users,OU=Dealer,OU=Community,DC=test2,DC=org");
env.put(Context.SECURITY_CREDENTIALS, "password-1");
LdapContext ctx =null;
try {
//ctx = new InitialLdapContext(env,null);
try {
ctx = new InitialLdapContext(env,null);
catch(NamingException e) {
System.out.println("Login failed");
System.exit(0);
if(ctx!=null){
System.out.println("Login Successful");
byte[] buf = new byte[] {0, 1, 2, 3, 4, 5, 6, 7}; // same data
// Create a multivalued attribute with 4 String values
BasicAttribute oc = new BasicAttribute("objectClassNew", "topNew");
oc.add("personNew");
oc.add("organizationalPersonNew");
// Create an attribute with a byte array
BasicAttribute photo = new BasicAttribute("jpegPhotoNew", buf);
// Create attribute set
BasicAttributes attrs = new BasicAttributes(true);
attrs.put(oc);
attrs.put(photo);
Attributes attrs1 = ctx.getAttributes("CN=cname,OU=Users,OU=Dealer,OU=Community,DC=test2,DC=org");
System.out.println(attrs1);
Context result = ctx.createSubcontext("CN=cname,OU=Users,OU=Dealer,OU=Community,DC=test2,DC=org", attrs);
//i got error here; i attach the error below.
ctx.close();
System.out.println("close");
catch(NamingException e){
e.printStackTrace();
ERROR:
Login Successful
javax.naming.directory.NoSuchAttributeException: [LDAP: error code 16 - 00000057: LdapErr: DSID-0C090B38, comment: Error in attribute conversion operation, data 0, vece
ANYONE HELP ME PLS.
Edited by: vencer on Jun 19, 2008 12:38 AM -
Create a User account in active directory from SharePoint online 2013 list data
Hello,
I am trying to create a SharePoint list through which i can create a user account into active directory,
1 - HR is sending the detail in the email body to a Specific email address ([email protected]) like below..
First Name: XYZ
Last Name: ABC
Address: ABC 123
Designation: Analyst
Employee ID: 10492
and so on
2 - I need to pickup every new email data of the above section into sharepoint list (in Column)
First Name Last Name Address Designation Employee ID
3 - I want to create a event receiver through which i can go ahead and find the new data in the list and then create a user in the active directory,
I tried very hard and since i dont have much experience in coding part, any help will be highly appreciated
Thank you
Aman1- Configure Incoming Email Setting at your SharePoint Farm -
https://technet.microsoft.com/en-us/library/cc262947.aspx
http://blogs.technet.com/b/harmeetw/archive/2012/12/29/sharepoint-2013-configure-incoming-emails-with-exchange-server-2013.aspx
2- Configure your Sharepoint List Incoming e-mail settings for [email protected] - ListSetting-Communications->Incoming e-mail settings. -
https://support.office.com/en-in/article/Enable-and-configure-e-mail-support-for-a-list-or-library-dcaf44a0-1d9b-451a-84c7-6c52e7db908e
3- Write an Incoming Email Receiver , and Add you Email Body Parsing Code (retrive value of fields , firstname , lastname etc) in
EmailReceived() method. also add the code for adding new user in Active Directory
http://blogs.msdn.com/b/tejasr/archive/2010/03/06/event-handler-code-to-add-incoming-emails-with-subject-discussion-id-as-replies.aspx
https://pholpar.wordpress.com/2010/01/13/creating-a-simple-email-receiver-for-a-document-library/
4- Active Directory Code Help -
http://www.codeproject.com/Articles/18102/Howto-Almost-Everything-In-Active-Directory-via-C
http://www.codeproject.com/Tips/534718/Add-User-to-Active-Directory
Thanks
Ganesh Jat [My Blog |
LinkedIn | Twitter ]
Please click 'Mark As Answer' if a post solves your problem or 'Vote As Helpful' if it was useful. -
Could we have same name's for User and Groups in Active directory
When iam trying to create a user name " Logistics " under a OU, I am getting a error
"The pre-windows 2000 logon name you have chosen is already in use in this domain. Choose aother pre-windows logon name, and then try again"
We already have a group by the name " Logistics "
Could we have same name's for User and Groups in Active directory?
Thanks in AdvancesAMaccountName attribute is unique. So, the short answer is you cannot.
This posting is provided AS IS with no warranties or guarantees , and confers no rights.
Ahmed MALEK
My Website Link
My Linkedin Profile
My MVP Profile -
Creating a new group in LDAP using JLDAP
Can anybody tell me how to creat a new group in LDAP using JLDAP
Hi,
Have a look at the following link. It will surely help you.
<a href="http://help.sap.com/saphelp_crm50/helpdata/en/20/a4ffee7e0fcc4ebb7e5466d3903d38/frameset.htm">http://help.sap.com/saphelp_crm50/helpdata/en/20/a4ffee7e0fcc4ebb7e5466d3903d38/frameset.htm</a>
<b>Please reward points if it helps.</b>
Regards,
Amit Mishra -
Is there an easy way to create a new group in mail (or I guess it's really the Address book) from an email I already sent to a group of people. I don't want to copy each name one by one if it's not necessary. Thanks, Jack
Each email address in the group is put in the To: field automatically when you put them all in the BCC field when composing the email. Nobody sees anything except their own email address.
I think you are mistaken there, Golden. If the To: field is blank the recipients in the Bcc field will see the To: as undisclosed-recipients - if they get anything at all; some ISPs will reject a message with a blank To:. I would agree with putting the target recipients in the Bcc, but when doing this I usually put my own address in the To: field.
AK -
Create a new Grouping in IBY_FD_EXTRACT_EXT_PUB
Hi,
I need to create a new group in IBY_FD_EXTRACT_EXT_PUB like below.
eg:
+*<OutboundPaymentInstruction>*+
---+
+*<OutboundPayment>*+
---+
+*<ExtendValue>*+
-- <Extend>+
---<OUTPUTVALUE>Concatenated Value - 1</OUTPUTVALUE>+
+*</Extend>*+
-- <Extend>+
---<OUTPUTVALUE>Concatenated Value - 2</OUTPUTVALUE>+
+*</Extend>*+
-- <Extend>+
---<OUTPUTVALUE>Concatenated Value - 3</OUTPUTVALUE>+
+*</Extend>*+
*</ExtendValue*
+*<OutboundPayment>*+
---+
+*<ExtendValue>*+
-- <Extend>+
---<OUTPUTVALUE>Concatenated Value - 1</OUTPUTVALUE>+
+*</Extend>*+
-- <Extend>+
---<OUTPUTVALUE>Concatenated Value - 2</OUTPUTVALUE>+
+*</Extend>*+
-- <Extend>+
---<OUTPUTVALUE>Concatenated Value - 3</OUTPUTVALUE>+
+*</Extend>*+
+*</ExtendValue>*+
I have got the Concatenated value inside a loop, but I need to split each of the values into 80 characters and then insert it into <OUTPUTVALUE>+
So, if I have 240 characters, then I need it like+
+*<OutboundPayment>*+
---+
+*<ExtendValue>*+
-- <Extend>+
---<OUTPUTVALUE>Concatenated Value - 80 characters*</OUTPUTVALUE>*+
+*</Extend>*+
-- <Extend>+
---<OUTPUTVALUE>Concatenated Value - 80 characters*</OUTPUTVALUE>*+
+*</Extend>*+
-- <Extend>+
---<OUTPUTVALUE>Concatenated Value - 80 characters*</OUTPUTVALUE>*+
+*</Extend>*+
+*</ExtendValue>*+
What I have tried is
FUNCTION Get_Pmt_Ext_Agg(p_payment_id IN NUMBER)
RETURN XMLTYPE
IS
l_ins_ext_agg XMLTYPE;
CURSOR get_invoices_cur(cp_payment_id in number) is
SELECT IDP.document_payable_id DOCUMENT_PAYABLE_ID
,SUBSTR(IDP.calling_app_doc_ref_number,1,30) REFERENCE_NUMBER
,IDP.payment_amount PAYMENT_AMOUNT
,IDP.document_amount DOCUMENT_AMOUNT
,IDP.payment_curr_discount_taken DISCOUNT_AMOUNT
,SUBSTR(IDP.po_number,1,30) PO_NUMBER
,IPA.payment_amount PAYMENT_AMNT
,IPA.ext_branch_number EXT_BRANCH_NUMBER
,IPA.ext_bank_account_number EXT_BANK_ACCOUNT_NUMBER
,IPA.payee_name PAYEE_NAME
,IPA.int_bank_name INT_BANK_NAME
,IPA.payment_reference_number PAYMENT_REFERENCE_NUMBER
,IPA.creation_date CREATION_DATE
,IPA.payment_instruction_id PAYMENT_INSTRUCTION_ID
FROM iby_docs_payable_all IDP
,ap_invoices_all AIA
,iby_payments_all IPA
WHERE AIA.invoice_id = idp.calling_app_doc_unique_ref2
AND IPA.payment_id = IDP.payment_id
AND IDP.payment_id = cp_payment_id;
BEGIN
<Initialize all valiables>
FOR get_invoices_rec IN get_invoices_cur(p_payment_id)
LOOP
lc_concatenate: = <Get the concanated Value as required>;
lc_split:= < Written some logic to split it into char >
BEGIN
SELECT XMLConcat(
XMLElement("Extend",
XMLElement("lc_value1" lc_split))
INTO lc_extendval
FROM dual
END;
END LOOP;
BEGIN
SELECT XMLConcat(
XMLElement("ExtendVal",lc_extendval),
INTO l_ins_ext_agg
FROM dual;
END;
RETURN l_ins_ext_agg;
EXCEPTION
WHEN OTHERS THEN
RETURN NULL;
END Get_Pmt_Ext_Agg;
Now, my output comes only as the last 80 characters, I do not have the first 80 and second 80 characters.
ANy inputs to achieve all the 240 characters split into 3 rows like described above would be helpful.
Thanks>
Now, my output comes only as the last 80 characters, I do not have the first 80 and second 80 characters.
>
based on
>
lc_split:= < Written some logic to split it into char >
>
so check logic for splitting
i can't test on your data but
>
SELECT XMLConcat(
XMLElement("Extend",
XMLElement("lc_value1" lc_split))
INTO lc_extendval
FROM dual
>
what's code doing?
looks like it's wrong because it create tag "lc_value1"
>
BEGIN
SELECT XMLConcat(
XMLElement("ExtendVal",lc_extendval),
INTO l_ins_ext_agg
FROM dual;
END;
RETURN l_ins_ext_agg;
>
what's code doing?
so try another way
FUNCTION Get_Pmt_Ext_Agg(p_payment_id IN NUMBER)
RETURN XMLTYPE
IS
l_ins_ext_agg XMLTYPE;
CURSOR get_invoices_cur(cp_payment_id in number) is
SELECT IDP.document_payable_id DOCUMENT_PAYABLE_ID
,SUBSTR(IDP.calling_app_doc_ref_number,1,30) REFERENCE_NUMBER
,IDP.payment_amount PAYMENT_AMOUNT
,IDP.document_amount DOCUMENT_AMOUNT
,IDP.payment_curr_discount_taken DISCOUNT_AMOUNT
,SUBSTR(IDP.po_number,1,30) PO_NUMBER
,IPA.payment_amount PAYMENT_AMNT
,IPA.ext_branch_number EXT_BRANCH_NUMBER
,IPA.ext_bank_account_number EXT_BANK_ACCOUNT_NUMBER
,IPA.payee_name PAYEE_NAME
,IPA.int_bank_name INT_BANK_NAME
,IPA.payment_reference_number PAYMENT_REFERENCE_NUMBER
,IPA.creation_date CREATION_DATE
,IPA.payment_instruction_id PAYMENT_INSTRUCTION_ID
FROM iby_docs_payable_all IDP
,ap_invoices_all AIA
,iby_payments_all IPA
WHERE AIA.invoice_id = idp.calling_app_doc_unique_ref2
AND IPA.payment_id = IDP.payment_id
AND IDP.payment_id = cp_payment_id;
BEGIN
<Initialize all valiables>
FOR get_invoices_rec IN get_invoices_cur(p_payment_id)
LOOP
lc_concatenate: = <Get the concanated Value as required>;and add logic for splitting like
select xmlelement("ExtendValue", xmlagg(xmlelement("Extend", substr(lc_concatenate,1+80*(level-1),80) )))
INTO lc_extendval
from dual
connect by level <= ceil(length(lc_concatenate)/80)so example
SQL>
SQL> with t as
2 (
3 select 1 id, lpad('a',80,'a') ||lpad('b',80,'b') ||lpad('c',80,'c') str from dual
4 )
5 --
6 select xmlelement("ExtendValue", xmlagg(xmlelement("Extend", substr(str,1+80*(level-1),80) )))
7 from t
8 connect by level <= ceil(length(str)/80)
9 /
XMLELEMENT("EXTENDVALUE",XMLAG
<ExtendValue><Extend>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
SQL> if you have some problem then plz post test data -
Create a new group in Messaging
How do you create a new group in messaging, I had to select ios4.33 in the Operating system as ios5 is not available yet
Someone should show you how to perform a search. There's a sample in this forum.
http://forums.sun.com/thread.jspa?threadID=623860 -
Runtime Error when creating a new group
I'm getting a runtime error when creating a new group on a site collection?
Thanks in advanceThe most possible reason is if your site collection is reached the maximum site quota limit,then there is chance to get the run time error while creating a new group.
In this case,you will get the error while creating/updating the group or while adding the new user/uploading any content.
Also Ensure the group name is not having any special/unsupported characters.
Feel free to share the error screenshot/entry in the ULS logs.
Please remember to click 'Mark as Answer' on the answer if it helps you
Best Regards,
Pavan Kumar Sapara
s p kumar -
I just got the new Iphone 5 and when I send a message in a group text it keeps sending it as an email and as my phone number. The people in the group text are complaining that it is creating a new group message everytime I text. How do I fix this?
Read http://macmost.com/setting-up-multiple-ios-devices-for-messages-and-facetime.htm l
If you wish to share an Apple ID with family members then read: http://www.macstories.net/stories/ios-5-icloud-tips-sharing-an-apple-id-with-you r-family/ -
All of a sudden, I cannot create any new groups within Address Book! Will not work either from the plus sign at the bottom of the group list or the main menu!
Any advice on how to resolve?quit Address book and delete the file homedirectory/library/application support/address book/AddressBook-v22.abcddb. then start Address Book and see if you can create groups.
-
Hi!!
We are working on a mapping between a Sponsor Group in Cisco ISE and a user group in Active Directory....but the client wants the mapping to be through a RADIUS SERVER, for avoiding ISE querying directly the Active Directory.
I know it is possible to use a RADIUS SERVER as an external identity source for ISE.....but, is it possible to use this RADIUS SERVER for this sponsor group handling?
Thanks and regards!!Yes It is possible to map Sponser group to user group in AD and if you want to know how to do please open the below link and go to Mapping Active Directory Groups to Sponsor Groups heading.
http://www.cisco.com/en/US/docs/security/ise/1.0/user_guide/ise10_guest_pol.html#wp1096365 -
Groups in Address book on iPad will not let me create a new group
My address book on the iPad will not let me create a new group. The red ribbon is there and shows my groups that I already have, but when I click on the ribbon the plus sign does not appear on the group side to let me create one.
Can anyone help me? I have turned it off and back on.You can't create new groups on a mobile device.
-
Nested groups with Active Directory AWS
Hi... am trying to target only specific groups from our AD, but I'd rather not have to use the partial users & groups sync as this would mean re-configuring the auth source for any new group that we want to bring in to the portal (v.5.0.2).
I am able to target a specific part of AD in the following way:
User Query Base : OU=Portal Users,DC=Domain1, DC=DOmain2
User Query Filter: (&(objectclass=user)(memberOf=*))
Group Query Base : OU=Portal Users,DC=Domain1, DC=DOmain2
Group Query Filter: (objectclass=Group)
This works fine, it brings in the groups in the "Portal Users" OU and any users in the OU who have group memberships. However, not all groups and users will exist in a single OU, so we decided to create a global group called "Portal Groups" and tried a similar query as above but with the query base replaced as follows:
VN=Portal Groups,OU=Applications,DC=Domain1, DC=DOmain2
This time... the group is brought in but no nested groups and no users! Has anyone else managed to accomplish an AWS setup of this sort or similar? I'm told that it is possible to sync in nested groups but being unfamiliar with AD I'm not sure if I've gone about it the right way.
thanks in advance
Simon DragicevichHi Simon,
So let me make sure I've got your usecase. You want to only create particular groups in the portal - you don't want all your AD groups in the portal. You DO want all your users imported and to have them in the appropriate groups?
If that's correct - you either want to play with your query bases, or you want to switch to a partial GROUP sync. The former will allow you to automatically bring in new groups as they are added to AD, the later will not.
One thing I was confused about in your original post - did you change both the user query base and the group query base to:
VN=Portal Groups,OU=Applications,DC=Domain1, DC=DOmain2
or just the group query base? Assuming you did the former, that would explain why your users weren't imported. If you did the later - that seems odd. Regardless you don't want to create a global group, you want to create a new OU:
OU=Portal Groups, OU=Applications, DC=Domain1, DC=Domain2
Then set that as your group query base. Assuming you have a bunch of groups scattered around your tree that you want in here, create shadow groups that essentially contain your other groups, e.g.:
CN=GroupA, DC=Plumtree
CN=GroupB, OU=Eng, DC=Plumtree
I want both of those groups to be in my portal groups OU, so I create two new groups in my portal groups OU as follows:
CN=GroupA, OU=Portal Groups, OU=Applications, DC=Domain1, DC=Domain2
CN=GroupB, OU=Portal Groups, OU=Applications, DC=Domain1, DC=Domain2
Both of these groups simply contain one member - the groups I am shadowing. You can also more effectively deal with name clashing if you use this strategy.
Make sense?
-Aki -
How do I copy an existing group in Contacts to create a new group with the same contacts in it?
Hi there,
Unfortunately the use case you describe hasn't been implemented in Firefox. It's not possible to move a tab group out to its own window at this point. Generally the tab groups feature hasn't been worked on much recently, not sure why.
As to TabMixPlus, that's a third-party add-on which Mozilla doesn't directly support. You can find support links from the add-on page: https://addons.mozilla.org/en-us/firefox/addon/tab-mix-plus/
Hope this helps.
Cheers,
David
Maybe you are looking for
-
I have an ipod touch 32gb. Model: MC008BT Version: 5.1.1. 3rd ed. Recently when clicking play on any song the ipod will shuffle through as many songs as there are in the album or playlist until it reaches the end without playing any songs. It also do
-
I purchased Lightroom on my old Macbook but recently updated to a Mac with Retina display. How do I access Lightroom on my new computer without purchasing it again?
-
Where are my backed up apps after upgrade?
I just up graded my I Touch to 4.2 and it said my apps were backed up prior to the upgrade. However, now I cannot find them. When I sync to the store they do not auto load. Any ideas where they are and how I can get my apps back? Many of them were ga
-
Help to find third party plug-ins for Shake please!
Hi! So there is thousands of third party plugs for After Effect. But not for Shake (?) I found just Foundry and GenArts plugins fore Shake. Is there any other t.p. plugins? Thank you!
-
Bonjour services from Snow Leopard
Anyone use iNet? It shows Bonjour services on your network and I'm puzzled looking at one thing: it shows services from my machine to include printer sharing and Windows file sharing. Printer sharing doesn't surprise me as I had that turned on, but