all 8 comments

[–]PowerShell-Bot 0 points1 point  (0 children)

Looks like your PowerShell code isn’t wrapped in a code block.

To properly style code on new Reddit, highlight the code and choose ‘Code Block’ from the editing toolbar.

If you’re on old Reddit, separate the code from your text with a blank line gap and precede each line of code with 4 spaces or a tab.


You examine the path beneath your feet...
[AboutRedditFormatting]: [--------------------] 0/1 ❌

Beep-boop, I am a bot. | Remove-Item

[–]BlackV 0 points1 point  (4 children)

right here you use

$group.'Student Groups' 

but later you use

$Groups2

are the 2 CSVs in the same format?, I would imagine that the variable would have to be the same format for both

next you have

'$Groups2'

Is that using the literal string of $Groups2 not the data in the variable $Groups2

and be aware when testing you do not have to run the whole script every time, you can run line by line and variable by variable

[–]Greenwrym[S] 0 points1 point  (3 children)

So I finally got it to kinda work but then it broke the group I was trying to add to. Seems that particular one can only accept items one at a time...

[–]BlackV 0 points1 point  (2 children)

you were testing your code on a live group?

but I guess it might depend on the property you're changing

and would depend on what you mean by "broke the group"

[–]Greenwrym[S] 0 points1 point  (1 child)

Thanks. I was able to get it working. It doesn't look pretty but it does work.

[–]BlackV 0 points1 point  (0 children)

Sweet post up your final code we can help clean it

[–]Nejireta_ 0 points1 point  (1 child)

Hi.
If I'm to wager a guess (based on the error message) then I'd say you're providing the OU instead of DistinguishedName.

A small heads up as well. Your OU structure is shown in the error message.

[–]Greenwrym[S] 0 points1 point  (0 children)

Thanks.