Skip to content

Instantly share code, notes, and snippets.

@IT-Delinquent
Created June 15, 2022 13:36
Show Gist options
  • Select an option

  • Save IT-Delinquent/337e57f1a0a75b94ad759a204817a4d7 to your computer and use it in GitHub Desktop.

Select an option

Save IT-Delinquent/337e57f1a0a75b94ad759a204817a4d7 to your computer and use it in GitHub Desktop.
powerShellAliasImportScript.ps1
Import-Csv "path\to\csv" | ForEach-Object {
try{
Set-ADUser -Identity $_.samaccountname -add @{Proxyaddresses=$_.Proxyaddresses -split ";"} -ErrorAction Stop
Write-Host $_.samaccountname complete! -ForegroundColor Green
}catch{
Write-Host 'Failed : ' -NoNewline
Write-Host $_.samaccountname -ForegroundColor Red
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment