I have prepared Outlook signature template in html
Can anyone help me writing powershell script, that replace 3 strings: NAME, WORKPLACE and PHONENUMBER taking it from ActiveDirectory user properties, while lanched under logged on user.
This forum is for scripting questions rather than script requests. We do not write customized and ready to use scripts or solutions on request.
We actually expect you to make an own attempt to get your task done or to solve your problem in the first place.
Regardless of that - in most of the cases you’re not the first one with a given task. So you will probably find something online already what can be adapted to your particular needs.
If you already have code you just got stuck with you should share this code here (formatted as code) and we will be happy to try to help you further.
I’m sorry you took my post as a request. I changed it.
I don’t know powershell. I was looking for information but did not find it.
maybe someone had a similar problem and can help me.
OK, what information do you need? There are actually thousands of sample scripts out there already you can easily adapt. And you don’t need to know a lot of PowerShell … but a little.
What kind of help do you expect? You should ask a specific question.
First of all … When you post code, sample data, console output or error messages please format it as code using the preformatted text button ( </> ). Simply place your cursor on an empty line, click the button and paste your code.
I’d recommend to set up the replacement ancors in a special way. For example instead of michal i’d use something like ###_firstName_###. This way it would be pretty unlikely to mismatch while replacing it.
You can use
to query the AD for the needed information.
Then you use for example
to process all found users inside the script block of Foreach-Object.
Please always read the help for the cmdlets you’re about to use completely including the exaples to learn how to use them.
And I’d recommend as well to search for sample scripts. I’m sure you will find some dealing with a similar or even the same requirement.
Hi,
Why do you want to replace html content?
From my point better is to generate personalized html signature, save it in e.g. user appdata and change outlook mailsettings that will point to signature file.
Becouse someone from marketing prepared signature… and we want to prepare script in GPO that
will copy it to C:\Users\username\AppData\Roaming\Microsoft\Signatures and modify strings .