GroupOfNames object creation in ad

Ask your PowerShell-related questions, including questions on cmdlet development!
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 9 years and 7 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
User avatar
jrremillard
Posts: 58
Last visit: Sun Aug 08, 2021 7:42 am

GroupOfNames object creation in ad

Post by jrremillard »

Hi

I am using ADSI Edit to create Teradata users in ad. the process is to use ADSI Edit, got to the users branch right click and create new object. I then select GroupOfNames as the class, then I add the common name which is there logon name then I add their distinguishedName. I was wondering where I would start to create a powershell script to do this function? I am only and have only used powershell to modify groups or create new users or add them to global groups.
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: GroupOfNames object creation in ad

Post by jvierra »

You cannot add a distinguished name. This is auto-genertated by AD.

Users are created in AD using the New-AdUser CmdLet. see help for the CmdLet.

http://technet.microsoft.com/en-us/libr ... 17253.aspx

GroupOfNames is only implemented on ADAM and LDS. Are you using
ADAM

http://msdn.microsoft.com/en-us/library/cc221556.aspx
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: GroupOfNames object creation in ad

Post by jvierra »

This is how to create an arbitrary object in ADAM or AD.
PowerShell Code
Double-click the code block to select all.
$dom=[ADSI]"LDAP://CN=Users,dc=NA,dc=fabrikam,dc=com"
$obj = $dom.Create('GroupOfNames', 'CN=SomeName'
$obj.SetInfo()
User avatar
jrremillard
Posts: 58
Last visit: Sun Aug 08, 2021 7:42 am

Re: GroupOfNames object creation in ad

Post by jrremillard »

Thank you I will try this out.
User avatar
jrremillard
Posts: 58
Last visit: Sun Aug 08, 2021 7:42 am

Re: GroupOfNames object creation in ad

Post by jrremillard »

Hi

I get the following error
Exception calling "SetInfo" with "0" argument(s): "The requested operation did
not satisfy one or more constraints associated with the class of the object.


So I am probably doing something wrong.
the following is the path to the OU that the object is going to be created or the DN information of the user/
Mine is also a little different.
$dom=[ADSI]"LDAP://OU=Users,OU=dev,OU=tdev,dc=acme,dc=com"
$obj = $dom.Create('GroupOfNames', 'CN=ASmith')
$obj.SetInfo()


Where do I put the DN of the user?

Sorry if this is confusing.
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: GroupOfNames object creation in ad

Post by jvierra »

Are you sure that "GroupOfNames" is creatable in that context?

I would post in the ADAM forum or in the vendor forum for Teradata.
This topic is 9 years and 7 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked