<# Script tp update the user manager field based on a CSV / Output from somewhere. Erik Eckert - MPE Engineering - 2022 Modules: - ActiveDirectory - ImportExcel - As Admin - Install-Module -Name ImportExcel -force #> Import-Module ImportExcel Import-Module ActiveDirectory $users = get-aduser -Filter 'mail -like "*@mpe.ca" -and Enabled -eq $true' -SearchBase 'OU=MPEUsers,DC=mpe,DC=ca' -Properties manager,company,department,title,Office,extensionAttribute1 $MPEData = Import-Excel -Path 'I:\Admin\Employee Designation & Title Listing\MPE Staff Info.All Offices.xlsx' -WorksheetName 'Sheet1' -StartColumn 2 -EndColumn 7 | where 'Last Name' -NE $null # Org Chart is full of "dotted line" or "Contextual" reporting structures. # Should probably default to office Manager for the office, then tier down for people with a clear path in the existing Org Chart. # need to come up with a CSV format to import.