I can create the account by this script
$CSVLocation = "C:\temp\RemoteUserMailboxes.csv"
Import-CSV $CSVLocation | ForEach-Object {
New-RemoteMailbox -Name $_.Name -FirstName $_.FirstName -Initials $_.Initials -Lastname $_.LastName -OnPremisesOrganizationalUnit $_.OU -UserPrincipalName $_.UPN -Password (ConvertTo-SecureString $_.password -AsPlainText -Force) -ResetPasswordOnNextLogon:$true }
To add the properties to the user i try this script to run on exchange management shell. but throws the error
The operation couldn't be performed because object 'venky' couldn't be found on 'dc1.ittechsolution.com'
$Contacts = Import-CSV -path "C:\temp\RemoteUserMailboxes.csv"
$contacts | ForEach {Set-contact $_.Name -StreetAddress $_.StreetAddress -City $_.City -StateorProvince $_.StateorProvince -PostalCode $_.PostalCode -Phone $_.Phone -MobilePhone $_.MobilePhone -Pager $_.Pager -HomePhone $_.HomePhone -Company $_.Company -Title $_.Title -OtherTelephone $_.OtherTelephone -Department $_.Department -Fax $_.Fax -Initials $_.Initials -Notes $_.Notes -Office $_.Office }
why does this error occurs?