I have written a script that is used for disk cleanup on a file server. The script looks at user shares, checks with AD to see if the account is disabled and if so checks if the user login exists in a text file that indicates who is on litigation hold. If the account is disabled and not on Litigation Hold, the directory is deleted. All of these features are working great.
I am now trying to find a way to encrypt the file and it is driving me nuts. Has anyone had any success with encrypting and decrypting a file?
I tried reading the file with Get-Content and looped through each line and tried to ConvertTo-SecureString and then append that to a new file but that didn't work. Tried downloading a PGP module but that tells me it can't work with the string data. I am at a loss. I would appreciate it if anyone that has pulled this off could point me in the right direction.
Thank you,
Mark
I am now trying to find a way to encrypt the file and it is driving me nuts. Has anyone had any success with encrypting and decrypting a file?
I tried reading the file with Get-Content and looped through each line and tried to ConvertTo-SecureString and then append that to a new file but that didn't work. Tried downloading a PGP module but that tells me it can't work with the string data. I am at a loss. I would appreciate it if anyone that has pulled this off could point me in the right direction.
Thank you,
Mark