Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Pipleline into Set-CASMail box

$
0
0

I am new to power shell and am probably missing a trick. We use Power shell to administer Office 365 Exchange.

We currently disable access to MAPI protocol to disable access to the desktop version of outlook, via script that runs every evening to ensure any new accounts have the it disable as well.

We would however like to like to enable MAPI for a small groups of users.

So create a security group called 'outlook enabled' and added a few test users to it.

Then tried the following where -GroupObjectId 89b3872e-2ff9-4bd3-b268-e40e8731c29b = 'outlook enabled' group

foreach($userID in Get-MsolGroupMember -All -GroupObjectId 89b3872e-2ff9-4bd3-b268-e40e8731c29b ) {$userID.EmailAddress|Set-CASMailbox -Identity -mapienabled $true}

which gives the error

Set-CASMailbox : Missing an argument for parameter 'Identity'. Specify a parameter of type 'System.Object' and try again.
At line:1 char:136
+ ... Set-CASMailbox -Identity -mapienabled $true}
+                    ~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Set-CASMailbox], ParameterBindingException
    + FullyQualifiedErrorId : MissingArgument,Set-CASMailbox
 
Set-CASMailbox : Missing an argument for parameter 'Identity'. Specify a parameter of type 'System.Object' and try again.
At line:1 char:136
+ ... Set-CASMailbox -Identity -mapienabled $true}
+                    ~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Set-CASMailbox], ParameterBindingException
    + FullyQualifiedErrorId : MissingArgument,Set-CASMailbox
 
Set-CASMailbox : Missing an argument for parameter 'Identity'. Specify a parameter of type 'System.Object' and try again.
At line:1 char:136
+ ... Set-CASMailbox -Identity -mapienabled $true}
+                    ~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Set-CASMailbox], ParameterBindingException
    + FullyQualifiedErrorId : MissingArgument,Set-CASMailbox

Any help would be greatly appreciated

Tim


Viewing all articles
Browse latest Browse all 15028

Trending Articles