QwertyMash Posted May 18, 2020 Author Posted May 18, 2020 For those trying to use the script themselves I have created a video to help: I am also working on a little update that sorts a few things out. 2
QwertyMash Posted May 19, 2020 Author Posted May 19, 2020 Version 3 released: https://github.com/captainqwerty/AutomatedOutlookSignature/releases/tag/v3.0 This has some neater parts and a fix for when the user's device is not currently on the domain it doesn't blank their signature.
QwertyMash Posted August 26, 2020 Author Posted August 26, 2020 Would this version work on Server 2016????? Yes it should work fine with server 2016
smithson83 Posted October 5, 2020 Posted October 5, 2020 Hi, I've got this working on a test machine. It's simple once someone has done all the work for you [emoji846]. But I was wondering, is it possible to do this with AAD as we are looking at moving our Staff devices over to Intune.
QwertyMash Posted October 5, 2020 Author Posted October 5, 2020 Hi, I've got this working on a test machine. It's simple once someone has done all the work for you [emoji846]. But I was wondering, is it possible to do this with AAD as we are looking at moving our Staff devices over to Intune. Hello there, Are you keeping your on premise AD or moving purely to AAD? Thank you
smithson83 Posted October 5, 2020 Posted October 5, 2020 Hi @qweetyMash, for the foreseeable, we'd be keeping on prem AD, but the devices wouldn't be domain joined.
QwertyMash Posted October 5, 2020 Author Posted October 5, 2020 Hi @qweetyMash, for the foreseeable, we'd be keeping on prem AD, but the devices wouldn't be domain joined. Hmm not sure what the best way to go about it would be as to get the details from azure AD they would need powershell modules and stuff.
QwertyMash Posted December 10, 2020 Author Posted December 10, 2020 Been doing more work this project. Coming this weekend if time permits. A second script which can be used to set Outlook Web Signatures that also use the information from active directory etc. Is it possible for me to edit my first post to update it? Or can Admins help me edit the first post? The script and output has been updated many times since my original post and it would be nice if I could update the original post with more up to date information such as a link to the YouTube video I made helping with the setup of this script etc.
peterdigby Posted May 28, 2021 Posted May 28, 2021 Thank you so much for sharing this script. I have modified it and it is working well; but I was wondering if there was a way of adding the fax number to the output. I have tried adding an extra line for if($user.fax.count -gt 0){$fax = $user.faxnumber[0]} using both ‘fax’ and ‘facsimileTelephoneNumber’ as listed using an get-aduser lookup; but the there is nothing in the output to the signature. Can a fax number be added, and do you know what I am missing? Thanks again.
Steve21 Posted May 28, 2021 Posted May 28, 2021 Thank you so much for sharing this script. I have modified it and it is working well; but I was wondering if there was a way of adding the fax number to the output. I have tried adding an extra line for if($user.fax.count -gt 0){$fax = $user.faxnumber[0]} using both ‘fax’ and ‘facsimileTelephoneNumber’ as listed using an get-aduser lookup; but the there is nothing in the output to the signature. Can a fax number be added, and do you know what I am missing? Thanks again. That code you posted wouldn't be right. The count should be the same item as the [0] So if you're using fax as an example@ if($user.fax.count -gt 0){$faxnumber = $user.fax[0]} As you're checking if fax exists and if so assigned fax to your variable (or same with facsimile etc) Steve 1
peterdigby Posted May 29, 2021 Posted May 29, 2021 Thanks for the reply, and sorry I copied the incorrect code. Please put it down to frustration and lack of sleep. The code i am currently running is if($user.Fax.count -gt 0){$faxnumber = $user.Fax[0]} and $(if($faxnumber){"F: $($faxnumber)"}) I have removed the 'if' statement from the Building HTML section and the text shows; but not the fax number. Thanks again, Peter Digby
Steve21 Posted May 29, 2021 Posted May 29, 2021 Just tested that on some actual live data, and seems the code works but it has to use the full name version (It doesn't return data under Fax for me, only facsimiletelephonenumber): $user = (([adsisearcher]"(&(objectCategory=User)(samaccountname=$env:username))").FindOne().Properties) if($user.facsimiletelephonenumber.count -gt 0){$faxnumber = $user.facsimiletelephonenumber[0]} $(if($faxnumber){"F: $($faxnumber)"}) Returns data for me: F: FaxTest123456 Steve 1
peterdigby Posted May 29, 2021 Posted May 29, 2021 Copied your code and worked perfectly. Thanks again for your help on this. Regards, Peter Digby
peterdigby Posted June 8, 2021 Posted June 8, 2021 (Hopefully) one final question. Is it possible to have more than one 'Group Check' for different departments? Currently using the Group Check for the IT Department with the modified code of $Group = [ADSI]"LDAP://OU=Information Technology,OU=domain" $Group.Member | ForEach-Object { if ($user.distinguishedname -match $_) { $ItStaff = $true } } and $(if($ITStaff){"IT Helpdesk"+" |"}) and it is working as expected. I have tried setting up a second Group Check with the following; but it includes both the IT and HR details. $Group2 = [ADSI]"LDAP://cn=HR,OU=domain" $Group2.Member | ForEach-Object { if ($user.distinguishedname -match $_) { $HRStaff = $true } } and $(if($HRStaff){"Human Resources"+" |"}) Is there a way to have the script check multiple departments; but only add the specific info for each department? Thanks again, Peter Digby
fordea Posted June 8, 2021 Posted June 8, 2021 That should be straightforward to do, quick question - are you checking the Parent OU of the user for the IT Staff but checking if the user is in a security group for the HR staff? 1
DaveTheTech Posted June 8, 2021 Posted June 8, 2021 (edited) $list = @{ "GDPR.Champions" = "[email protected]" "Staff" = "[email protected]" } $email=@() $user = Get-ADUser test.user -pro MemberOf $group = $user.MemberOf -replace '^CN=([^,]+),OU=.+$','$1' $group | %{$email += $list[$_]} $dn = $user.DistinguishedName.Split(",")[2] -replace "OU=" $email += $list[$dn]$email Get the user and their groups. Get the name of the groups using rexexp to get the text between CN= and ,OU= For each of the groups the user is a member of add the value of the hashtable to the email array Then do the same thing, but with the first OU that they are part of. GDPR.Champ is the name of a group Staff is the name of an OU Edited June 8, 2021 by DaveTheTech 1
peterdigby Posted June 9, 2021 Posted June 9, 2021 Thank you for pointing me in the right direction of checking for the AD group. The AD group i was using had been moved into a sub-OU, causing the issue. Once i had the correct path to the security group, everything worked as required. If anyone else needs the full code, it is # Group Check $Group = [ADSI]"LDAP://cn=IT Alerts,OU=Groups,OU=domain" $Group.Member | ForEach-Object { if ($user.distinguishedname -match $_) { $ItStaff = $true } } $Group = [ADSI]"LDAP://cn=Human Resources,OU=Groups,OU=domain" $Group.Member | ForEach-Object { if ($user.distinguishedname -match $_) { $HRStaff = $true } } and in the signature generation area $(if($ITStaff){"IT Helpdesk"+" |"}) $(if($HRStaff){"Human Resources"+" |"}) Thanks again. Peter Digby 1
RobFuller Posted October 1, 2021 Posted October 1, 2021 Hi @QwertyMash, firstly excellent work with the scripts! I don't know if you could help, I'm trying to add a font reference and stylesheet reference for social media icons above the Is this support in Outlook as other sources seem to suggest it should be possible? Also I'm trying to pull in the display name AD attribute , is this the correct reference as its not returning anything. if($user.displayName.count -gt 0){$displayName = $user.displayName[0]}
QwertyMash Posted October 3, 2021 Author Posted October 3, 2021 Hello, Sorry the delay, for some reason the email about the response went into my junk. When I get back home I will take a look at your post properly and hopefully be able to help Just running a few errands first. Thank you.
RobFuller Posted October 4, 2021 Posted October 4, 2021 (edited) Hello, Sorry the delay, for some reason the email about the response went into my junk. When I get back home I will take a look at your post properly and hopefully be able to help Just running a few errands first. Thank you. No worry @QwertyMash I think I have answered my first question as a flat no its not supported looking at a couple of sources. Also fixed my second issues, cAse sEnsitive Edited October 4, 2021 by RobFuller 1
QwertyMash Posted October 4, 2021 Author Posted October 4, 2021 No worry @QwertyMash I think I have answered my first question as a flat no its not supported looking at a couple of sources. Also fixed my second issues, cAse sEnsitive I am glad to hear you fixed your issue, I was just typing that it is case sensitive when I saw that you had posted again haha. 1
Kevin120481 Posted February 17, 2022 Posted February 17, 2022 Can I ask a question about this script, I have 99% of it working the way I want to, but adjusting the plain text, How can I get it to show no-standard txt? IE, in the HTML Code I have: Mit freundlichen Grüßen - Best Regards - which comes out as Mit freundlichen Grüßen - Best Regards This is perfect, but when I try putting this into plain text, I get Mit freundlichen Gr??en - Best Regards - I have tried copying the correct code (Grüßen) and just the Grüßen but it still shows as ??
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now