Quantcast
Channel: Azure Active Directory forum
Viewing all articles
Browse latest Browse all 16000

Set-MsolUser -AlternateEmailAddresses issue.

$
0
0

Hi All - Initially I posted my question at http://community.office365.com/en-us/forums/148/p/206113/622010.aspx but was asked to post here.

The question I have is how to manage 'AlternateEmailAddresses' values using Set-MsolUser cmdlet ?

I tried 

1>
$user = get-msoluser -ObjectId e0b1e7sa-dgd0-47he-fgds-84dfdbaa69cc
$user.AlternateEmailAddresses += "test2@yahoo.com"
Set-MsolUser -ObjectId e0b1e7sa-dgd0-47he-fgds-84dfdbaa69cc -AlternateEmailAddresses $user.
lternateEmailAddresses

Set-MsolUser :Invalid value for parameter.  Parameter Name: AlternateEmailAddresses.
At line:1 char:1
+ Set-MsolUser -ObjectId  e0b1e7sa-dgd0-47he-fgds-84dfdbaa69cc -AlternateEmailAddre ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (:) [Set-MsolUser], MicrosoftOnlineException
    + FullyQualifiedErrorId : Microsoft.Online.Administration.Automation.PropertyValidationException,Microsoft.Online.

 

2>

Set-MsolUser -ObjectId  e0b1e7sa-dgd0-47he-fgds-84dfdbaa69cc -AlternateEmailAddresses @{ADD='
test1@yahoo.com','test1@gmail.com'}

Set-MsolUser :Invalid value for parameter.  Parameter Name: OtherMail.
At line:1 char:1
+ Set-MsolUser -ObjectId e0b1e7sa-dgd0-47he-fgds-84dfdbaa69cc -AlternateEmailAddre ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (:) [Set-MsolUser], MicrosoftOnlineException
    + FullyQualifiedErrorId : Microsoft.Online.Administration.Automation.PropertyValidationException,Microsoft.Online.
   Administration.Automation.SetUser

3>

$user = get-msoluser -ObjectId e0b1e7sa-dgd0-47he-fgds-84dfdbaa69cc
$user.AlternateEmailAddresses -= "test1@gmail.com"

Method invocation failed because [System.Collections.Generic.List`1[[System.String, mscorlib, Version=4.0.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089]]] doesn't contain a method named 'op_Subtraction'.

At line:1 char:1
+ $user.AlternateEmailAddresses -= "test1@gmail.com"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (op_Subtraction:String) [], RuntimeException
    + FullyQualifiedErrorId : MethodNotFound

Please help. Thanks.



Viewing all articles
Browse latest Browse all 16000

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>