Skip to content

Commit

Permalink
Merge pull request #70 from SignorelliDenis/Development
Browse files Browse the repository at this point in the history
## 2.1.7 (2021-07-24)
  • Loading branch information
SignorelliDenis committed Jul 24, 2021
2 parents 8c2250d + 8fc1be2 commit 9fe8a06
Show file tree
Hide file tree
Showing 10 changed files with 48 additions and 39 deletions.
Binary file modified .vs/T2TScripts/v16/.suo
Binary file not shown.
2 changes: 1 addition & 1 deletion .vs/VSWorkspaceState.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
"\\T2TScripts\\tests",
"\\T2TScripts\\tests\\general"
],
"SelectedNode": "\\T2TScripts\\functions\\Export-T2TAttributes.ps1",
"SelectedNode": "\\T2TScripts\\internal\\functions\\Import-ADPersonalAttribute.ps1",
"PreviewInSolutionExplorer": false
}
Binary file modified .vs/slnx.sqlite
Binary file not shown.
2 changes: 1 addition & 1 deletion T2TScripts/T2Tscripts.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
RootModule = 'T2Tscripts.psm1'

# Version number of this module.
ModuleVersion = '2.1.6'
ModuleVersion = '2.1.7'

# ID used to uniquely identify this module
GUID = '2725e92d-30e7-475f-b4d7-edd47e81f9b3'
Expand Down
5 changes: 5 additions & 0 deletions T2TScripts/changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## 2.1.7 (2021-07-24)
- Fix: [[Import-T2TAttributes] Splatting New-MailUser cmdlet](https://github.com/SignorelliDenis/T2TScripts/issues/68)
- Fix: [[Move-Contacts] Splatting New-MailContact cmdlet](https://github.com/SignorelliDenis/T2TScripts/issues/69)


## 2.1.6 (2021-07-18)
- Fix: [Export-T2TAttributes.md] Documentation improvement
- Fix: [Export-T2TAttributes.ps1] Code adjustment to reduce few unnecessary lines
Expand Down
11 changes: 3 additions & 8 deletions T2TScripts/functions/Export-T2TAttributes.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
.NOTES
Title: Export-T2TAttributes.ps1
Version: 2.1.6
Version: 2.1.7
Date: 2021.02.04
Authors: Denis Vilaca Signorelli (denis.signorelli@microsoft.com)
Contributors: Agustin Gallegos (agustin.gallegos@microsoft.com)
Expand Down Expand Up @@ -157,8 +157,7 @@
[Parameter(Mandatory=$false,
HelpMessage="SwitchParameter which indicates that the function
must export all attributes in the Address tab such as: street,
P.O. Box, City, State/Province, ZIP Code and Country
")]
P.O. Box, City, State/Province, ZIP Code and Country")]
[switch]$IncludeAddress,

[Parameter(Mandatory=$false,
Expand Down Expand Up @@ -290,7 +289,6 @@
if ( $PreferredDC )
{
try

{
Set-AdServerSettings -ViewEntireForest $true -PreferredServer $PreferredDC -ErrorAction Stop
}
Expand Down Expand Up @@ -437,10 +435,7 @@
{
$ELCValue = $ELCValue + 16
}
if ($ELCValue -ge 0)
{
[void]$object.Add("ELCValue",$ELCValue)
}
[void]$object.Add("ELCValue",$ELCValue)

# Get the ArchiveGuid from EXO if it exist. The reason that we don't rely on
# "-ArchiveStatus" parameter is that may not be trustable in certain scenarios
Expand Down
34 changes: 20 additions & 14 deletions T2TScripts/functions/Import-T2TAttributes.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
.NOTES
Title: Import-T2TAttributes.ps1
Version: 2.1.6
Version: 2.1.7
Date: 2021.01.03
Author: Denis Vilaca Signorelli (denis.signorelli@microsoft.com)
Contributors: Agustin Gallegos (agustin.gallegos@microsoft.com)
Expand Down Expand Up @@ -164,7 +164,6 @@
$CheckOrganization = ($ImportUserList[0].psobject.Properties).Where({$_.Name -eq "title"})
$CheckManager = ($ImportUserList[0].psobject.Properties).Where({$_.Name -eq "Manager"})
$CheckCustomAttributes = ($ImportUserList[0].psobject.Properties).Where({$_.Name -eq "extensionAttribute1"})

if ($Password)
{
$pwstr = $Password
Expand Down Expand Up @@ -243,22 +242,29 @@
$tmpUser = $null
$UPN = $user.Alias+$UPNSuffix

# If OU was passed through param, honor it.
# Otherwise create the MEU without OU specification
if ($OU)
{
$tmpUser = New-MailUser -UserPrincipalName $upn -ExternalEmailAddress $user.ExternalEmailAddress `
-FirstName $user.FirstName -LastName $user.LastName -SamAccountName $user.SamAccountName -Alias `
$user.alias -PrimarySmtpAddress $upn -Name $User.Name -DisplayName $user.DisplayName -Password `
$pw -ResetPasswordOnNextLogon $resetpwrd -OrganizationalUnit $OU
# region splatting params to be used with New-MailUser
# PrimarySmtpAddress will be set properly down the road
$param = @{
UserPrincipalName=$upn
ExternalEmailAddress=$user.ExternalEmailAddress
FirstName=$user.FirstName
LastName=$user.LastName
SamAccountName=$user.SamAccountName
Alias=$user.alias
PrimarySmtpAddress=$upn
Name=$User.Name
DisplayName=$user.DisplayName
Password=$pw
ResetPasswordOnNextLogon=$resetpwrd
}
else
if ($OU)
{
$tmpUser = New-MailUser -UserPrincipalName $upn -ExternalEmailAddress $user.ExternalEmailAddress -FirstName `
$user.FirstName -LastName $user.LastName -SamAccountName $user.SamAccountName -Alias $user.alias -PrimarySmtpAddress `
$upn -Name $User.Name -DisplayName $user.DisplayName -Password $pw -ResetPasswordOnNextLogon $resetpwrd
[void]$param.Add("OrganizationalUnit",$OU)
}

# MEU creation
$tmpUser = New-MailUser @param

# Convert legacyDN to X500 and add all proxyAddresses to array
$x500 = "x500:" + $user.legacyExchangeDN
$proxy = $user.EmailAddresses.Replace(";",",")
Expand Down
2 changes: 1 addition & 1 deletion T2TScripts/functions/Update-T2TPostMigration.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
.NOTES
Title: Update-T2TPostMigration.ps1
Version: 2.1.6
Version: 2.1.7
Date: 2021.04.21
Author: Denis Vilaca Signorelli (denis.signorelli@microsoft.com)
Expand Down
29 changes: 16 additions & 13 deletions T2TScripts/internal/functions/Move-Contact.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -145,23 +145,26 @@
$Replace = @{}
$tmpContact = $null

# If OU was passed through param, honor it.
# Otherwise create the MEU without OU specification
if ($OUContacts)
{
$tmpContact = New-MailContact -ExternalEmailAddress $user.ExternalEmailAddress -PrimarySmtpAddress `
$user.PrimarySMTPAddress -FirstName $user.FirstName -LastName $user.LastName -Alias $user.alias -Name `
$user.Name -DisplayName $user.DisplayName -OrganizationalUnit $OUContacts
# region splatting paramd to be used with New-MailContact
# PrimarySmtpAddress will be set properly down the road
$contactparam = @{
ExternalEmailAddress=$user.ExternalEmailAddress
PrimarySmtpAddress=$user.PrimarySMTPAddress
FirstName=$user.FirstName
LastName=$user.LastName
Alias=$user.alias
Name=$user.Name
DisplayName=$user.DisplayName
}
else
if ($OUContacts)
{
$tmpContact = New-MailContact -ExternalEmailAddress $user.ExternalEmailAddress -PrimarySmtpAddress `
$user.PrimarySMTPAddress -FirstName $user.FirstName -LastName $user.LastName -Alias $user.alias -Name `
$user.Name -DisplayName $user.DisplayName
$contactparam.Add("OrganizationalUnit",$OUContacts)
}

# region create mail-contact
$tmpContact = New-MailContact @contactparam

# we must resolve the GUID in order to
# use Set-ADObject cmdlet down the road
# we must resolve the GUID to use Set-ADObject cmdlet further
$ResolvedGUID = Get-MailContact -Identity $user.Alias | Select-Object GUID

# Convert legacyDN to X500 and add all EmailAddresses to array
Expand Down
2 changes: 1 addition & 1 deletion T2TScripts/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Refer to the following links to review the parameters, requirements and instruct

5 - Start the migration batch to move the mailboxes refered in the last steps.

7 - Once the migration batch reaches 95% as Synced status, run the `Update-T2TAttributes -Destination` in the destination environment. You will be required to provide the same CSV used in the step 3 and 4. Once the functions finishes, it will export a new CSV called MigratedUsers.csv containing the results.
7 - Once the migration batch reaches 95% as Synced status, run the `Update-T2TAttributes -Destination` in the destination environment and then complete the batch. You will be required to provide the same CSV used in the step 3 and 4. Once the functions finishes, it will export a new CSV called MigratedUsers.csv containing the results.

8 - From the source environment, run the `Update-T2TAttributes -Source`. The function will require the MigratedUsers.csv generated in the step 7.

Expand Down

0 comments on commit 9fe8a06

Please sign in to comment.