Noob: how can I validate that a CSV came from my source?

Hi All,

I’m quite new to PowerShell, but hey, i’m loving it so far.

I’m writing a scheduler that runs every 15 minutes and receives commands by reading CSV files that I create in another process and drop into an inbox folder. An example command would be to suspend a user account at a specific time.

I want to make sure that the CSV was created by one of my processes and isn’t fake. If I can’t do this then using my above example, it could technically be possible for anyone (with permissions) to drop a CSV into the inbox and suspend an account.

Is there a way that the scheduler can validate the CSV to determine that one of my processes created it?

Many thanks.

Michael D


A few thoughts on what you can do to solve. 1. Set permissions on the directory/file so only the specific account can write to it. 2. Encrypt the file so only an account with access to the private key can read it. 3. Create a hash of the file and check to ensure the hash is correct in your script (against a secure location that stores the hash).

I second Mike R’s suggestions.
You could also consider writing to an Azure Table instead of a CSV file.