Adding Multiple Users to Administrative Units

Hi All, I’d love some direction on how to accomplish what I’m trying to do.

I’m following the instructions here

However, for $User, instead of Get-MsolUser -UserPrincipalName “[](” I’m doing Get-MsolUser -DomainName “” so I can all the members of that domain to the AU. However, I’m getting the following error:

Add-MsolAdministrativeUnitMember : Cannot convert ‘System.Object[]’ to the type ‘System.Nullable`1 [System.Guid]’ required by parameter ‘AdministrativeUnitMemberObjectId’. Specified method is not supported.

At line:1 char:124

  • … d $AdminstrativeUnit.ObjectId -AdministrativeUnitMemberObjectId $User
  • CategoryInfo : InvalidArgument: (:) [Add-MsolAdministrativeUnitMember], ParameterBindingException
  • FullyQualifiedErrorId : CannotConvertArgument,Microsoft.Online.Administration.Automation.AddAdministrativeUnitMember

I’m assuming it’s because the $user variable had more than one objectID associated to it. Any idea how to get around it so I dont have to add them all individually?

submitted by /u/wh15p3r
[link] [comments]

Leave a Reply