function Get-SHSUser {

    param (
        [parameter(ValueFromPipeline)]
        [string]$user
    )
    if($null -eq (get-module -ListAvailable -Name 'ActiveDirectory')){
        Write-Warning 'Active Drirectory Thick Client is required for this function'
        return
    }
    Write-Progress -Activity "Getting user data for $name" -Status 'Querying AD for user data' -PercentComplete 30 -ParentId 1
    if($user -match "^[\d\.]+$"){
        $UserInfo = Get-ADUser -Filter { EmployeeID -eq $user } -properties *
        $user = $UserInfo.SamAccountName
    }
    if($user -match "\w \w"){
        $UserInfo = Get-ADUser -Filter { DisplayName -eq $user } -Properties *
        $user = $UserInfo.SamAccountName
    }
    else {
        $UserInfo = Get-ADUser -Identity $user -Properties *
    }
    if($null -eq $UserInfo){
        $props = [ordered]@{
            Name="User does not exist in AD"
            UserName=$null
            EmployeeID=$null
            Title=$null
            Department=$null
            Manager=$null
            Phone=$null
            Email=$null
            Computers=$null
            LastLogon=$null
        }
        $obj = New-Object -TypeName PSObject -Property $props

        return $obj
    }
    $manager = $UserInfo.Manager.Split("=,")[1]

    Write-Progress -Activity "Getting user data for $name" -Status 'Querying SCCM for LastLogon data' -PercentComplete 80 -ParentId 1
    
    $computerSCCM = Get-SCCM_UserLastLoggedOn $user
    $computerList = $computerSCCM -join ", "
    $props = [ordered]@{
                    Name=$UserInfo.DisplayName
                    UserName=$user
                    EmployeeID=$UserInfo.EmployeeID
                    Title=$UserInfo.Title
                    Department=$UserInfo.Department
                    Manager=$manager
                    Phone=$UserInfo.telephoneNumber
                    Email=$UserInfo.EmailAddress
                    Computers=$computerList
                    LastLogon=$UserInfo.LastLogonDate
              }
    
    $obj = New-Object -TypeName PSObject -Property $props

    return $obj
}