Running Get and Set command to set the value

AMaDAC 81 Reputation points
2021-03-31T05:37:24.85+00:00

For Example I run:

Get-CsTeamsMeetingPolicy -Identity Global
with return value of (sample only)

AllowMeetNow : True
MeetingChatEnabledType : Disabled

And for every value should be equal to set command

Set-CsTeamsMeetingPolicy -AllowMeetNow $False -MeetingChatEnabledType Disabled

How do I write if and else statement with parameters to set the -AllowMeetnow to $false and -MeetingChatEnabledType

Please advise or walk through me to forum or link.

Windows for business | Windows Server | User experience | PowerShell
Microsoft Teams | Microsoft Teams for business | Other
0 comments No comments
{count} votes

Accepted answer
  1. Anonymous
    2021-03-31T07:48:52.803+00:00

    Hi,

    Why do you want an if statement since only the set command is needed to be executed?

    $global = Get-CsTeamsMeetingPolicy -Identity Global  
    Set-CsTeamsMeetingPolicy -AllowMeetNow $global.AllowMeetNow -MeetingChatEnabledType $global.MeetingChatEnabledType   
    

    Best Regards,
    Ian Xue

    ============================================

    If the Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.