Using in built exchange scripts with import-csv switch
Hi All, I am trying to run the below command i get the error in bold. Though the command is not complete i should still get a different error. Import-Csv "C:\PF1.CSV" | replaceuserwithuseronPFrecursive.ps1 -toppublicfolder "$_.Identity"Import-Csv : Cannot process argument because the value of argument "name" is invalid. Change the value of the "name" argument and run the operation again.At line:1 char:11+ Import-Csv <<<< "C:\PF1.CSV" | replaceuserwithuseronPFrecursive.ps1 -toppublicfolder "$_.Identity"I have Dynamic Values which will be inputs for -toppublicfolder -olduser and -newuser respectively. All these three values should be called from the CSV file. This is what i am looking to accomplish. Can i use in built scripts with import-csv ? Thanks Shiv
June 3rd, 2009 7:49am

Hi All, After pipe i also triedforeach-object { replaceuserwithuseronPFrecursive -toppublicfolder $_.Identity -olduser $_.oldusername -newuser $_.newusername } Even this gave the same error as above. I think i missing on something. Thanks Shiv
Free Windows Admin Tool Kit Click here and download it now
June 3rd, 2009 7:53am

Hi,If you get this error it means there is some problem with your csv file. Make sure:- Ifit exists- You have permission to read it- It's not open in an other application for exclusive read- It has correct format (as I remember it should be UTF-8 with CRLF line ends)Regards,Zoltnhttp://www.clamagent.org - Free Antivirus for Exchange http://www.it-pro.hu http://emaildetektiv.hu
June 3rd, 2009 8:54am

No this file was not opened while running the command. The second time i tried this its stil the same. Thanks Shiv
Free Windows Admin Tool Kit Click here and download it now
June 3rd, 2009 6:12pm

Do you get content with below cmdlet? Get-Content "C:\PF1.CSV" This might be dumb suggestion but you might have "Hide Extension for known file types" selected in Tools -> Folder Options -> View which would be causing problem to show correct extension... :) Also can you post the content of file here in exact format? Do you have first line with "Identity" in the CSV file? Identity header should require in the CSV... :) Amit Tank | MVP Exchange Server | MCITP: EMA | MCSA: M | http://ExchangeShare.WordPress.com
June 3rd, 2009 6:28pm

HI Amit, Ok, file extensions are not hidden. should this cause an issue at any given point of time if not in this instance? I tried the below command error in bold.Get-content "c:\pf1.csv" | replaceuserwithuseronpfrecursive.ps1 -toppublicfolder "$_.Identity"ValidateParams :Missing parameter: The -TopPublicFolder parameter is required. Please pass in avalid Public Folder path, name, or entryID.Missing parameter: The -UserOld parameter is required. Please pass in a valid user name, email address or GUIDMissing parameter: The -UserNew parameter is required. Please pass in a valid user name, email address or GUIDAt D:\spf\Scripts\ReplaceUserWithUserOnPFRecursive.ps1:115 char:32+ $ifValidParams = ValidateParams; <<<<Thanks Shiv
Free Windows Admin Tool Kit Click here and download it now
June 3rd, 2009 7:28pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics