Quantcast
Channel: Exchange Server 2013 - Administration, Monitoring, and Performance 论坛
Viewing all articles
Browse latest Browse all 3457

Getting an error in powershell

$
0
0

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))
}


Viewing all articles
Browse latest Browse all 3457

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>