I need a help with this script.
$data = Import-CSV C:\temp\import.csv
ForEach ($i in $data){
$pstpath = "\\server\pst$\" + $i.folder + "\"
$user = $i.user
$folder = $i.folder
Get-ChildItem -Recurse -path $pstpath -Filter *.pst | New-MailboxImportRequest -FilePath "$pstpath + $_.name" - Mailbox $user -Name "Import $user $_.name" -BadItemLimit 30 -ConflictResolutionOption KeepAll -TargetRootFolder $_.name -IsArchive -confirm: $false
}
I've got this error for each pst in folder:
The input object cannot be bound to any parameters for the command either because the command does not take pipeline in
put or the input and its properties do not match any of the parameters that take pipeline input.
+ CategoryInfo : InvalidArgument: (archive.pst:PSObject) [New-MailboxImportRequest], ParameterBindingException
+ FullyQualifiedErrorId : InputObjectNotBound,New-MailboxImportRequest