New-ADGroup -Name 'mygroup1' -GroupScope 0 -OtherAttributes '@{'AttributeLDAPDisplayName'=value}'
I have tried using above command in powershell but returns following exception :
At line:1 char:45
+ New-ADGroup -Name 'mygroup1' -GroupScope 0 -OtherAttributes -Replace ...
+ ~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [New-ADGroup], ParameterBindingException
+ FullyQualifiedErrorId : CannotConvertArgumentNoMessage,Microsoft.ActiveDirectory.Management.Commands.NewADGroup```
As suggested by Santiago Squarzon posting it as answer to help other community members.
If you use quotes in arguments, it will be treated as String. This is not valid for
-OtherAttributesas the type of it is hashtable.So, remove the quotes and include your values to the attribute by replacing
value.For suppose, if you are trying to create an Active Directory group based on Email address your cmdlet should be something like this:
If you are trying to create AD group based on displayName, please check below cmdlet
(NOTE: You can also give the values directly like this):
Make sure whether you are giving correct path or not.
Please check the below references if they are helpful.
References:
https://ss64.com/ps/new-adgroup.html
https://learn.microsoft.com/en-us/powershell/module/activedirectory/new-adgroup?view=windowsserver2022-ps#parameters