Educational ICT Virtualisation Specialist

Twitter LinkedIn E-mail
Precedence Technologies Ltd
Technology House, 36a Union Lane
Cambridge, CB4 1QB, United Kingdom
T: +44 (0)1223 359900
E: sales@precedence.co.uk
Linton-ShowMyHomework

Jump to CustomersLinton > Linton > ShowMyHomework

ShowMyHomework

Add e-mail addresses to existing accounts

Generate a CSV export from ShowMyHomeWork

  1. Go to the address: "https://www.satchelone.com/login".
  2. Login with your school credentials (see this page for more details "https://remote.lvc.org/logins/).
  3. On the left pane under "Admin" click 'Manage Users".
  4. On the right there is a button that says "Update email addresses".
  5. Clicking that will download a .csv file with all the current user information.

Export UPN and Admission Number from SIMS

  1. From the Reports menu choose Design Report
  2. Click the link to Create a new report
  3. For the data area click on Student in the tree view and then click 'Next'
  4. For refining the data area leave the default selection of On roll and then click 'Next'
  5. For data fields expand the node for Registration and add Admission number and UPN by left clicking them then clicking the button labelled with the right facing arrow, then click 'Next' to continue
  6. When prompted to apply a filter just click 'Next' to continue
  7. When prompted to choose fields to sort on just click 'Next' to continue
  8. If looking to run this report for a future date (e.g. to consider students who aren't on-roll now but will be in the future) check the checkbox for Use Effective Date and choose a date from the calendar control, otherwise leave the checkbox unchecked. Click 'Next' to continue
  9. For the presentation click on Text, choose the format Comma separated, and then enter a suitable file name and path (e.g. C:\regmap.csv). Click 'Next' to continue
  10. Click the link Run my report
  11. Click 'OK' on the message box that indicates the report is complete
  12. Click 'Close' to exit the report designer *without* permanently saving the report

Create a new CSV file with additional e-mail addresses

Read the file which was exported from ShowMyHomework, try to insert any missing e-mail addresses, and then save as a new CSV file. Note that line endings in the initial export appear to be Unix style whilst line endings written by Export-Csv will be Windows style.

$ErrorActionPreference = "Stop"
Import-Module ActiveDirectory

# Define filenames
$regmap = "C:\Users\administrator.LINTON\Desktop\smh\regmap.csv"
$in = "C:\Users\administrator.LINTON\Desktop\smh\student-emails-linton-village-college.csv"
$out = "{0}_{1:yyyyMMddHHmmss}.csv" -f $in.Substring(0, $in.Length - 4), (Get-Date)

# Read the CSV file which maps between UPN and admission number and create
# a lookup table which can return the admission number for a given UPN
$lookup_adno = @{}

foreach ($csv in (Import-Csv -Path $regmap))
{
    if ($csv.UPN -eq "" -or $csv.Adno -eq "")
    {
        Write-Warning "Skipping SIMS report input: $csv"
    }
    else
    {
        $lookup_adno.Add($csv.UPN, $csv.Adno)
    }
}

# Read all user objects from AD and create a lookup table which can return
# the e-mail address for a given admission number
$lookup_mail = @{}

foreach ($user in (Get-ADUser -Filter { EmployeeNumber -Like "*" } -Properties EmployeeNumber,Mail))
{
    if (!($user.EmployeeNumber) -or !($user.Mail))
    {
        Write-Warning "Skipping AD user: $user"
    }
    else
    {
        $lookup_mail.Add($user.EmployeeNumber, $user.Mail)
    }
}

# Define a filter to add e-mail addresses where they are missing
Filter AddMail
{
    if ($_.UPN -eq "")
    {
        Write-Warning "Empty UPN in ShowMyHomework data: $_"
    }

    $mail = $null
    $adno = $lookup_adno[$_.UPN]

    if ($adno)
    {
        $mail = $lookup_mail[$adno]
    }

    if ($mail -and $_.EMAIL -ne $mail)
    {
        if ($_.EMAIL -ne "")
        {
            Write-Warning "Wrong e-mail address (not $mail): $_"
        }
        else
        {
            $_.EMAIL = $mail
        }
    }

    $_
}

# Read ShowMyHomework export and generate a new import
Import-Csv -Path $in | AddMail | Export-Csv -Path $out -NoTypeInformation -NoClobber
© Copyright Precedence Technologies 1999-2025
Page last modified on September 13, 2021, at 04:13 PM by dturner