Hi all,
I'm looking for some help with a PS script I'm using to import users from CSV.
The script works fine if I remote the company and department aspects.
I get the error
The breakdown of the CSV is fine.
When I try and add the details manually, then Get-MailContact, I still don't see any parameters for company, department, job title etc. This must be possible somehow.
Please help, it's driving me mad.
Much appreciated.
Neil
I'm looking for some help with a PS script I'm using to import users from CSV.
Code:
Import-Csv "C:\PSScripts\MailContact.csv" | ForEach-Object { New-MailContact -Name $_.Name -ExternalEmailAddress $_.Email -FirstName $_.FirstName -LastName $_.LastName -Company $_.Company -Department $_.Department -OrganizationalUnit "domain/Contacts" -Alias $_.Alias }
The script works fine if I remote the company and department aspects.
I get the error
PowerShell Error said:A positional parameter cannot be found that accepts argument '-Company'.
+ CategoryInfo : InvalidArgument: ) [New-MailContact], ParameterBindingException
+ FullyQualifiedErrorId : PositionalParameterNotFound,New-MailContact
The breakdown of the CSV is fine.
When I try and add the details manually, then Get-MailContact, I still don't see any parameters for company, department, job title etc. This must be possible somehow.
Please help, it's driving me mad.
Much appreciated.
Neil