Forum Discussion

ShawnEG's avatar
ShawnEG
Copper Contributor
Mar 23, 2022
Solved

Use cmdlet output as variables for next cmdlet

I am trying to assign users a customattribute in Exchange for use in a Dynamic Distribution List. We are pure Azure AD (no on-prem or Hybrid); therefore, my DDL options are limited).   I cannot get...
  • Harm_Veenstra's avatar
    Mar 23, 2022
    I think the "| ft -hidetableheaders UserPrincipalName" is something you shouldn't use. Run it without that and try

    $Var1 | foreach-object {
    set-mailbox -identity $_.UserPrincipalName -customattribute1 "Some_Text"
    }

    If that doesn't work, just run $var1 to show us the contents of that

Resources