none
why PS can't work with encrypted folders/files? RRS feed

  • Question

  • I recently moved all my work files inside an encrypted folder. so far, all MS Office modules can work fine with the files inside this encrypted folder. except PowerShell. fyi, the encrypted folder is available and open as the decryption works on the fly.

    i have PS script that reads in a CSV file to be processed and upload to Active Directory. when i moved the CSV outside of the encrypted folder, the scripts works fine.

    part of the script is this:

    Import-CSV 'x:\Outlook_address_updat_11May2017.csv' | foreach-object {

    $hash = @{

    and it fails in this part of the script:

    try {
        Set-ADuser -Identity $_.ID -Replace $hash

    where it throws an error regarding "Identity" not found or something. i lost the exact error message.

    however, when i moved the csv file outside the encrypted folder, the script works fine. seems to me PowerShell have some issues working with encrypted folders (even though the contents are decrypted on the fly)?

    Thursday, May 11, 2017 7:38 AM

Answers

  • hi,

    yes you are right. actually it's more of a "have you been in this situation" type of question. especially since some folks are using encryption now. as I tested more, I found that my other scripts work fine out of the encrypted folder and they all read in CSV files from the same encrypted folder. only this particular script won't regardless of whatever the script's purpose is.

    so to me, and to anyone into encryption, there could be something going on here with this command (Set-ADuser -Identity $_.ID -Replace $hash).

    anyway, i'm checking further. thanks.

    • Marked as answer by Reno Mardo Thursday, May 11, 2017 2:54 PM
    Thursday, May 11, 2017 2:53 PM

All replies

  • when i moved the CSV outside of the encrypted folder, the scripts works fine.

    Then you don't have a scripting question, per se. There is not sufficient information in your question for us to guess why what you are doing "doesn't work" (whatever that means, because you didn't post the error message).

    For anyone to help, we would have to reproduce your environment, which we don't have the resources to do (this is a peer-to-peer support forum, not an official support channel, and there's no SLA).


    -- Bill Stewart [Bill_Stewart]

    Thursday, May 11, 2017 2:29 PM
    Moderator
  • hi,

    yes you are right. actually it's more of a "have you been in this situation" type of question. especially since some folks are using encryption now. as I tested more, I found that my other scripts work fine out of the encrypted folder and they all read in CSV files from the same encrypted folder. only this particular script won't regardless of whatever the script's purpose is.

    so to me, and to anyone into encryption, there could be something going on here with this command (Set-ADuser -Identity $_.ID -Replace $hash).

    anyway, i'm checking further. thanks.

    • Marked as answer by Reno Mardo Thursday, May 11, 2017 2:54 PM
    Thursday, May 11, 2017 2:53 PM