Skip to content

Commit 65707c3

Browse files
final touches
1 parent 0dc03d1 commit 65707c3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Modules/CippExtensions/Public/Sherweb/Test-SherwebMigrationAccounts.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ function Test-SherwebMigrationAccounts {
77
$Table = Get-CIPPTable -TableName Extensionsconfig
88
$Config = ((Get-CIPPAzDataTableEntity @Table).config | ConvertFrom-Json).Sherweb
99
#First get a list of all subscribed skus for this tenant, that are in the transfer window.
10-
$Licenses = (Get-CIPPLicenseOverview -TenantFilter $TenantFilter) | ForEach-Object { $_.terminfo = ($_.terminfo | ConvertFrom-Json -ErrorAction SilentlyContinue) ; $_ } | Where-Object { $_.terminfo -ne $null -and $_.terminfo.TransferWindow -LE 78 }
10+
$Licenses = (Get-CIPPLicenseOverview -TenantFilter $TenantFilter) | ForEach-Object { $_.terminfo = ($_.terminfo | ConvertFrom-Json -ErrorAction SilentlyContinue) ; $_ } | Where-Object { $_.terminfo -ne $null -and $_.terminfo.TransferWindow -LE 7 }
1111

1212
#now check if this exact count of licenses is available at Sherweb, if not, we need to migrate them.
1313
$SherwebLicenses = Get-SherwebCurrentSubscription -TenantFilter $TenantFilter
1414
$LicencesToMigrate = foreach ($License in $Licenses) {
1515
foreach ($termInfo in $License.terminfo) {
16-
$matchedSherweb = $SherwebLicenses | Where-Object { $_.quantity -eq 3 -and $_.commitmentTerm.termEndDate -eq $termInfo.NextLifecycle }
16+
$matchedSherweb = $SherwebLicenses | Where-Object { $_.quantity -eq $termInfo.TotalLicenses -and $_.commitmentTerm.termEndDate -eq $termInfo.NextLifecycle }
1717
if (-not $matchedSherweb) {
1818
[PSCustomObject]@{
1919
LicenseName = ($Licenses | Where-Object { $_.skuId -eq $License.skuId }).license

0 commit comments

Comments
 (0)