Created
June 15, 2022 13:36
-
-
Save IT-Delinquent/337e57f1a0a75b94ad759a204817a4d7 to your computer and use it in GitHub Desktop.
powerShellAliasImportScript.ps1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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