PowerShell Updates to Retrieve Distribution Groups, Update User Addresses, and More

Written by Divya Gunasekaran, Microsoft Online Services PM The latest release of the Microsoft Online Services Migration Tools includes two new cmdlets and an update to Get-MSOnlineUser . The new Get-MSOnlineDistributionGroup cmdlet allows admins to retrieve properties of distribution groups through PowerShell, and a user’s UPN, primary SMTP address, and SIP address can now be managed using the Update-MSOnlineUserAddresses cmdlet. 1.  Get-MSOnlineUser : This cmdlet retrieves the properties of a specified user in Microsoft Online Services.  The following property has been added to the output of this cmdlet: RulesQuota : Returns the limit in KB for the size of rules for the user’s mailbox. This property will return 0 for users that do not have mailboxes. 2. Get-MSOnlineDistributionGroup : This cmdlet retrieves the properties of a specified distribution group.  The following properties are output: Identity : Primary SMTP address of the group. DisplayName : The display name of the group. Type: The group type. AcceptMessagesOnlyFrom: Returns a string array containing the users and contacts allowed to send email to the retrieved distribution group.  An empty array indicates the distribution group accepts messages from all senders. Members : Returns a string array containing the members of the distribution group. 3.  Update-MSOnlineUserAddresses : This cmdlet can be used to update a user’s primary SMTP address and SIP address to match their existing UPN or a new UPN.  For mailbox users, if an existing SMTP address matches the UPN, Update-MSOnlineUserAddresses will set it as the primary SMTP. Otherwise, the cmdlet will add a new SMTP address as the primary email address. Note that this cmdlet does not remove or replace a user’s existing SMTP addresses. For users with an existing SIP address, Update-MSOnlineUserAddresses will update the SIP address to match the UPN. Let’s run through a few scenarios to get started. I want to ensure my users’ UPN, primary SMTP address, and SIP address are aligned.  After running the Get-MSOnlineUser cmdlet, I notice that the addresses for karthik@fineartschool.net are not the same as his UPN. C:PS> Get-MSOnlineUser -Identity karthik@fineartschool.net - Credential $companyAdminCred                                                                                                                                                                     Identity                : karthik@fineartschool.net                                                                                                                                                   ProxyAddresses     : SMTP:k@fineartschool.net,                         smtp:karthik@fineartschool.net, sip:ka@fineartschool.net      To update the primary SMTP address and SIP address to equal my user’s current UPN, karthik@fineartschool.net, I run the following command: C:PS> Update-MSOnlineUserAddresses -Identity                      karthik@fineartschool.net -Credential $companyAdminCred  When I check the user’s address list again, I see that the SIP address was updated and the SMTP address that matched the UPN is now set as the primary SMTP address. No SMTP addresses were removed or replaced. Identity                : karthik@fineartschool.net                               ProxyAddresses     : smtp:k@fineartschool.net,                      SMTP:karthik@fineartschool.net, sip:karthik@fineartschool.net My user has recently undergone a name change from Chris to Christine. Her UPN, SMTP address, and SIP address are Chris@fineartschool.net, and I need to update them accordingly. Identity                : Chris@fineartschool.net                                                                          ProxyAddresses     : SMTP:Chris@fineartschool.net, sip:Chris@fineartschool.net I can do this from the command line, but I can also import information from a csv file since the Update-MSOnlineUserAddresses cmdlet accepts some input from the pipeline by property name.  I save the below csv file as “NameChange.csv” and run the following command:      Identity NewUpn Chris@fineartschool.net Christine@fineartschool.net C:PS> Import-Csv –path C:NameChange.csv | Update-         MSOnlineUserAddresses -Credential $companyAdminCred  My user’s UPN, primary SMTP address, and SIP address are now updated to Christine@fineartschool.net. The old SMTP address Chris@fineartschool.net is still an alternate email address because the Update-MSOnlineUserAddresses cmdlet does not remove or replace SMTP addresses.  That means Christine will still receive mail sent to Chris@fineartschool.net, which is useful because her contacts might not know she has a new primary email address. Identity                : Christine@fineartschool.net                                   ProxyAddresses     : {SMTP:Christine@fineartschool.net,               smtp:Chris@fineartschool.net, sip:Christine@fineartschool.net  To use the updated cmdlets, admins must download the latest 32-bit or 64-bit version of the Microsoft Online Services Migration Tools.

Go here to see the original:
PowerShell Updates to Retrieve Distribution Groups, Update User Addresses, and More


Leave a comment!

You must be logged in to post a comment.

PowerShell Updates to Retrieve Distribution Groups, Update User Addresses, and More

Written by Divya Gunasekaran, Microsoft Online Services PM The latest release of the Microsoft Online Services Migration Tools includes two new cmdlets and an update to Get-MSOnlineUser . The new Get-MSOnlineDistributionGroup cmdlet allows admins to retrieve properties of distribution groups through PowerShell, and a user’s UPN, primary SMTP address, and SIP address can now be managed using the Update-MSOnlineUserAddresses cmdlet. 1.  Get-MSOnlineUser : This cmdlet retrieves the properties of a specified user in Microsoft Online Services.  The following property has been added to the output of this cmdlet: RulesQuota : Returns the limit in KB for the size of rules for the user’s mailbox. This property will return 0 for users that do not have mailboxes. 2. Get-MSOnlineDistributionGroup : This cmdlet retrieves the properties of a specified distribution group.  The following properties are output: Identity : Primary SMTP address of the group. DisplayName : The display name of the group. Type: The group type. AcceptMessagesOnlyFrom: Returns a string array containing the users and contacts allowed to send email to the retrieved distribution group.  An empty array indicates the distribution group accepts messages from all senders. Members : Returns a string array containing the members of the distribution group. 3.  Update-MSOnlineUserAddresses : This cmdlet can be used to update a user’s primary SMTP address and SIP address to match their existing UPN or a new UPN.  For mailbox users, if an existing SMTP address matches the UPN, Update-MSOnlineUserAddresses will set it as the primary SMTP. Otherwise, the cmdlet will add a new SMTP address as the primary email address. Note that this cmdlet does not remove or replace a user’s existing SMTP addresses. For users with an existing SIP address, Update-MSOnlineUserAddresses will update the SIP address to match the UPN. Let’s run through a few scenarios to get started. I want to ensure my users’ UPN, primary SMTP address, and SIP address are aligned.  After running the Get-MSOnlineUser cmdlet, I notice that the addresses for karthik@fineartschool.net are not the same as his UPN. C:PS> Get-MSOnlineUser -Identity karthik@fineartschool.net - Credential $companyAdminCred                                                                                                                                                                     Identity                : karthik@fineartschool.net                                                                                                                                                   ProxyAddresses     : SMTP:k@fineartschool.net,                         smtp:karthik@fineartschool.net, sip:ka@fineartschool.net      To update the primary SMTP address and SIP address to equal my user’s current UPN, karthik@fineartschool.net, I run the following command: C:PS> Update-MSOnlineUserAddresses -Identity                      karthik@fineartschool.net -Credential $companyAdminCred  When I check the user’s address list again, I see that the SIP address was updated and the SMTP address that matched the UPN is now set as the primary SMTP address. No SMTP addresses were removed or replaced. Identity                : karthik@fineartschool.net                               ProxyAddresses     : smtp:k@fineartschool.net,                      SMTP:karthik@fineartschool.net, sip:karthik@fineartschool.net My user has recently undergone a name change from Chris to Christine. Her UPN, SMTP address, and SIP address are Chris@fineartschool.net, and I need to update them accordingly. Identity                : Chris@fineartschool.net                                                                          ProxyAddresses     : SMTP:Chris@fineartschool.net, sip:Chris@fineartschool.net I can do this from the command line, but I can also import information from a csv file since the Update-MSOnlineUserAddresses cmdlet accepts some input from the pipeline by property name.  I save the below csv file as “NameChange.csv” and run the following command:      Identity NewUpn Chris@fineartschool.net Christine@fineartschool.net C:PS> Import-Csv –path C:NameChange.csv | Update-         MSOnlineUserAddresses -Credential $companyAdminCred  My user’s UPN, primary SMTP address, and SIP address are now updated to Christine@fineartschool.net. The old SMTP address Chris@fineartschool.net is still an alternate email address because the Update-MSOnlineUserAddresses cmdlet does not remove or replace SMTP addresses.  That means Christine will still receive mail sent to Chris@fineartschool.net, which is useful because her contacts might not know she has a new primary email address. Identity                : Christine@fineartschool.net                                   ProxyAddresses     : {SMTP:Christine@fineartschool.net,               smtp:Chris@fineartschool.net, sip:Christine@fineartschool.net  To use the updated cmdlets, admins must download the latest 32-bit or 64-bit version of the Microsoft Online Services Migration Tools.

Go here to see the original:
PowerShell Updates to Retrieve Distribution Groups, Update User Addresses, and More


Leave a comment!

You must be logged in to post a comment.