Good Morning All,
Apologies to create another account as im unable to login to earlier one. As mentioned in my earlier mail am new to this forum and exchange too. Last time i got an wonderful response for my issue and it worked well too.
Am trying to upload multiple pics in exchange server which will reflect in Outlook. Earlier it worked but some how today am getting below error.
Error:
Cannot bind argument to parameter 'Identity' because it is null. + CategoryInfo : InvalidData: (:) [Import-RecipientDataProperty], ParameterBindingValidationE + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Import-RecipientDataProperty
CODE AM USING:
$PhotoPath = "C:\Photos\*.*"
ForEach ($PhotoFile in gci $PhotoPath)
{
$User = '' + $PhotoFile.Name.substring(0, $PhotoFile.Name.Length - 4) + ''
Import-RecipientDataProperty -Identity $User -Picture -FileData ([Byte[]]$(Get-Content -Path $PhotoFile.Fullname -Encoding Byte -ReadCount 0))
}