I am trying to write a script to add a group to an OU, I've stripped out the script and am using the command line to find the error and it looks like -path is incorrect, how do I use powershell to create a group in the specific OU without using -path.
Command
New-ADGroup -name _AB_Read -GroupCategory Security -GroupScope Global -Path OU=TEST,OU=NEW_Groups,DC=Corp1,DC=net
Error
New-ADGroup : Cannot convert 'System.Object[]' to the type 'System.String' required by parameter 'Path'. Specified method is not supported.
At line:1 char:77
New-ADGroup -name _PL_Read -GroupCategory Security -GroupScope Global -Path OU=V ...
~~~~
CategoryInfo : InvalidArgument: (:) [New-ADGroup], ParameterBindingException
FullyQualifiedErrorId : CannotConvertArgument,Microsoft.ActiveDirectory.Management.Commands.NewADGroup
Your -Path should look like this -path "OU=TEST,OU=NEW_Groups,DC=Corp1,DC=net". You need " enclosing your path.
Without quotes, it will fail.
So, a new AD group in your desired OU should look like this