Hello Everyone,
I’m stuck as to why this script works if I work through it with all hard-coded text but stalls and does not complete when I use variables.
So I wrote the ForEach first, and it hung, but in the other code block, where I have everything explicitly written out, it works; that’s the extent of my troubleshooting so far.
I’m unsure if I’m correctly passing the variable to the Set-Distribution Group for the identity.
Looking at the documentation from Microsoft, I shouldn’t even have to do the whole $NewManagedBySorted dance; I should be able to say:
Set-DistributionGroup -Identity $Something -ManagedBy @{Add=$Users} but that fails as well. It just hangs, no error code; I can’t even ctrl-c out of the command.
Hmmm … you told your code hangs with a blinky cursor. I’d try to figure out what command exactly is blocking. So I’d output all variables directly after I set them. Set the $VerbosePreference to Continue and run this:
I emailed the EXO team at Microsoft, and they told me there’s a known bug.
Hi Martin,
We recently identified a bug in this particular scenario and are working on the fix. The fix should be >available in a couple of weeks. There is a workaround to read content from a file still and pass the >values as Identity by typecasting the object returned by Get-Content to a string array, as shown below –
[string[ ] ] $mailboxes = Get-Content “”
Please let us know if this does not work for you, and we can help find a way to work around this >issue.