How do I change this script to run recursively in an OU instead of passing a CSV?

Import-Module ActiveDirectory Import-Csv -path “C:scriptsbook1.csv” | ForEach-Object { $First = $_.GivenName $Last = $_.Surname $UPN = $_.UserPrincipalName $Sam = $_.SamAccountName $NewSam = “$First.$Last” $Newupn = “$First.$Last@domain.com” $UPN = Get-ADUser -Filter {UserPrincipalName -Eq $UPN} | Set-AdUser -samaccountname $newsam -userprincipalname $Newupn} ​ submitted by /u/maddog1404 [link] [comments]