Solved

Need help creating an encrypted string

Posted on 2013-06-02
3
358 Views
Last Modified: 2013-06-03
I created a script to get fields using read-host, there are 5 fields, all of the fields are to be encrypted and saved to a config file.  2 of the five are not saved as encrypted strings, the from and To address, all other fields are encrypted.  I've included a copy of the Config file.

I'm sure its something simple but I don't see what I am doing wrong, need some help

Thanks
from.txt
sendfile.txt
0
Comment
Question by:c7c4c7
3 Comments
 
LVL 25

Accepted Solution

by:
clockwatcher earned 500 total points
Comment Utility
You're missing the $ in front of your variable names in those two cases.  Change this:

out-file -filepath C:\bat\sendfile.config -inputobject encrypted_fromAddress_string -append
out-file -filepath C:\bat\sendfile.config -inputobject encrypted_toAddress_string -append

Open in new window


to
out-file -filepath C:\bat\sendfile.config -inputobject $encrypted_fromAddress_string -append
out-file -filepath C:\bat\sendfile.config -inputobject $encrypted_toAddress_string -append

Open in new window

0
 
LVL 42

Expert Comment

by:sedgwick
Comment Utility
in from.txt:
you forgot the $ sign for encrypted_fromAddress_string and encrypted_toAddress_string when u use out-file.
0
 

Author Closing Comment

by:c7c4c7
Comment Utility
Thanks, I new it would be simple I just couldn't see it
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

The article will show you how you can maintain a simple logfile of all Startup and Shutdown events on Windows servers and desktops with PowerShell. The script can be easily adapted into doing more like gracefully silencing/updating your monitoring s…
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now