Hello.
I hope I found the right place to put this thread. I'm not used to the new forums setup yet.
I am running this command to add a user to an AAD group:
Add-AzureADGroupMember -ObjectID $RetGroup.ObjectID -RefObjectID $RetUser.ObjectID
It adds the user just fine. No issues there. But I have this in a script and I don't want the output from adding the user. I just want the cmd to run and not give me the details (I'm pulling the information later in the script and the output from this just clogs up the screen).
I've tried:
- Add-AzureADGroupMember -ObjectID $RetGroup.ObjectID -RefObjectID $RetUser.ObjectID | Out-Null
- $Null = Add-AzureADGroupMember -ObjectID $RetGroup.ObjectID -RefObjectID $RetUser.ObjectID
- Add-AzureADGroupMember -ObjectID $RetGroup.ObjectID -RefObjectID $RetUser.ObjectID > $null
- and even: [void] Add-AzureADGroupMember -ObjectID $RetGroup.ObjectID -RefObjectID $RetUser.ObjectID
It still outputs the information.
Is there a way to make it not dump the info to the screen?
Thanks!