Hi guys!
I'm having trouble writing a script in PowerShell. I need a script that reads a CSV with two columns, later I need to filter the field in the first column and apply a value that is inside the other column in the user attributes in AD.
I wrote this script below but it is not working:
Import-Module ActiveDirectory
$Users = "C:\Users\joao.victor\Documents\leiaute.csv"
Import-CSV $Users -Header UserPrincipalName,title | %
Get-ADUser -Filter 'Name -like ""' -SearchBase 'OU=Objetos Arquivados,OU=BHZ,OU=MG,DC=academico,DC=educacao,DC=elv,DC=intranet' -Properties | % {Set-ADUser $ -add @{title=$.title}}
Can anybody help me?


