b.wijs;SMTP:[email protected]<\/a><\/p>\nWhen i type something , like enter, the screen disappears.<\/p>","upvoteCount":0,"datePublished":"2019-06-14T09:13:24.000Z","url":"https://community.spiceworks.com/t/error-running-powershell-script/716442/3","author":{"@type":"Person","name":"jordivandenhooven","url":"https://community.spiceworks.com/u/jordivandenhooven"}},{"@type":"Answer","text":"
First try using a delmiiter with the importing of the csv, like this:<\/p>\n
Import-Csv SMTPLIST.csv -Delimiter ';'\n<\/code><\/pre>\nAlso - what is the header in the CSV?<\/p>","upvoteCount":1,"datePublished":"2019-06-14T09:34:08.000Z","url":"https://community.spiceworks.com/t/error-running-powershell-script/716442/4","author":{"@type":"Person","name":"DoctorDNS","url":"https://community.spiceworks.com/u/DoctorDNS"}},{"@type":"Answer","text":"
I have tried with header:<\/p>\n
samaccountname;emailaddress<\/p>\n
But because i get the error i have tread it with and without.<\/p>\n
I will get the following error:<\/p>\n
PS C:\\Users\\beheer> C:\\Users\\beheer\\powershell.ps1\nImport-Csv : Cannot bind parameter 'Delimiter'. Cannot convert value \"; \" to type \"System.Char\". Error: \"String must be exactly one character long.\"\nAt C:\\Users\\beheer\\powershell.ps1:2 char:36\n+ Import-Csv SMTPLIST.csv -Delimiter '; ' | ForEach-Object\n+ ~~~~\n + CategoryInfo : InvalidArgument: (:) [Import-Csv], ParameterBindingException\n + FullyQualifiedErrorId : CannotConvertArgumentNoMessage,Microsoft.PowerShell.Commands.ImportCsvCommand\n \n\n$username = $_.samaccountname\n$userproxy = $_.emailaddress -split ';'\nSet-ADUser -Identity $username -Add @{proxyAddresses= $userproxy}\n<\/code><\/pre>","upvoteCount":0,"datePublished":"2019-06-14T09:51:35.000Z","url":"https://community.spiceworks.com/t/error-running-powershell-script/716442/5","author":{"@type":"Person","name":"jordivandenhooven","url":"https://community.spiceworks.com/u/jordivandenhooven"}},{"@type":"Answer","text":"