ADScripts/Find-UserOffice.ps1
2023-09-14 11:13:58 -06:00

11 lines
369 B
PowerShell

$data = Import-Csv -Path "C:\Users\eeckert\Downloads\NoteVault licenses.csv"
foreach ($set in $data) {
$userCode = ($set.'Assigned User').Substring(0,($set.'Assigned User').IndexOf(('@')))
$set.Office = $userCode | Get-ADUser -property office | select office
}
$data | Export-Csv -Path "C:\Users\eeckert\Downloads\NoteVault licenses.csv" -NoTypeInformation