0

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?

BastianW
  • 2,868
  • 4
  • 20
  • 34
Venky
  • 31
  • 1
  • 4
  • How about run "Get-Contact venky" to view contact settings first? If you create it by New-RemoteMailbox, it should be a remote mailbox instead of contact. Thus, run "Get-RemoteMailbox venky" to check. If so, we need run the script with Set-RemoteMailbox. – Jianfei Wang Dec 05 '17 at 08:09
  • Get-Contact -identity venky The operation couldn't be performed because object 'venky' couldn't be found on 'dc1.ittechsolution.com' if only command Get-contact given it list of users but could not find venky in it. – Venky Dec 06 '17 at 09:29

0 Answers0