Code Monkey home page Code Monkey logo

automatedoutlooksignature's Introduction

Contributors Forks Stargazers Issues MIT License

Automated Outlook Signature Script

The script retrieves user details from Active Directory, generates a new signature file, and sets it as the default Outlook signature. It ensures that any changes in user details, such as job title, are reflected in the signature during the next logon.

"Buy Me A Coffee"

Table of Contents

Features

  • Supports multiple versions of Outlook.
  • Retrieves user details from Active Directory.
  • Generates HTML and plain text signatures.
  • Sets registry keys to configure the default Outlook signature.
  • Supports verbose output for detailed execution.

Usage

I recommend using the script in Group Policy as a logon script. During the user's logon process, the script runs in the background, retrieves the necessary user details, generates a new signature file, and replaces the existing one.

For detailed instructions on configuring logon scripts with Group Policy, refer to this article: Configuring Logon PowerShell Scripts with Group Policy - 4Sysops.

Dynamic User Details

The script retrieves various user details from Active Directory to dynamically generate the signature. The following properties from the UserAccount class can be used within the signature:

  • Name: Full name of the user.
  • DistinguishedName: Distinguished name in Active Directory.
  • UserPrincipalName: User's principal name (UPN).
  • DisplayName: Display name of the user.
  • GivenName: Given (first) name.
  • Initials: User's initials.
  • Surname: User's surname (last name).
  • Description: Description of the user.
  • JobTitle: Job title of the user.
  • Department: Department the user belongs to.
  • Company: Company name.
  • EmailAddress: Email address of the user.
  • StreetAddress: Street address.
  • City: City of the user.
  • State: State or province.
  • PostalCode: Postal code.
  • Country: Country or region.
  • TelephoneNumber: Primary telephone number.
  • Mobile: Mobile phone number.
  • Pager: Pager number.
  • Fax: Fax number.
  • HomePhoneNumber: Home phone number.
  • OtherHomePhoneNumber: Additional home phone number.
  • HomeFax: Home fax number.
  • OtherFax: Additional fax number.
  • IPPhone: IP phone number.
  • OtherIPPhone: Additional IP phone number.
  • WebPage: Web page URL.
  • ExtensionAttribute1: Custom extension attribute 1.
  • ExtensionAttribute2: Custom extension attribute 2.
  • ExtensionAttribute3: Custom extension attribute 3.
  • ExtensionAttribute4: Custom extension attribute 4.
  • ExtensionAttribute5: Custom extension attribute 5.
  • ExtensionAttribute6: Custom extension attribute 6.
  • ExtensionAttribute7: Custom extension attribute 7.
  • ExtensionAttribute8: Custom extension attribute 8.
  • ExtensionAttribute9: Custom extension attribute 9.
  • ExtensionAttribute10: Custom extension attribute 10.
  • ExtensionAttribute11: Custom extension attribute 11.
  • ExtensionAttribute12: Custom extension attribute 12.
  • ExtensionAttribute13: Custom extension attribute 13.
  • ExtensionAttribute14: Custom extension attribute 14.
  • ExtensionAttribute15: Custom extension attribute 15.

These details can be customised and included in the signature template to ensure that each user's signature is personalised and up-to-date with the latest information from Active Directory.

Parameters

  • Verbose: Enables verbose output.
  • CompanyName: Overwrite / specifies the company name to use in the signature.
  • Website: Overwrite / specifies the company website to include in the signature.

Example

# Normal Execution
.\AutomatedOutlookSignature.ps1 

Example

# Normal Execution with alternative encoding. Default is Unicode.
.\AutomatedOutlookSignature.ps1 -encoding ascii

Example

# Execution with verbose output
.\AutomatedOutlookSignature.ps1 -Verbose

Example

# Execution but statically forcing the company name and website URL
.\AutomatedOutlookSignature.ps1 -CompanyName "YourCompany" -Website "www.yourcompany.com"

Installation - Group Policy

  1. Download the latest version of the script from the GitHub repository.
  2. Edit the script and update the value of $logo to your publically available logo image.
  3. Place the script in a location accessible to your users, such as a network share or GPO script folder.
  4. Configure Group Policy to run the script at logon. Refer to the provided Configuring Logon PowerShell Scripts with Group Policy - 4Sysops article for guidance. You can also watch this YouTube Video Guide.

Contributing

Contributions are welcome! Please visit the GitHub repository to open an issue or submit a pull request.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Acknowledgements

Changelog

[5.0.0] - 20/05/2024

  • New script layout utilising functions to enhance readability.
  • Added support for verbose output.
  • Introduced parameters for script execiton. Website and CompanyName can be statically set as parameters.
  • Refactored code to use a class for better structure and readability.
  • Improved compatibility with more versions of Office.
  • Removed group check example to reduce script run time.
  • Added a parameter to easily switch encoding.

automatedoutlooksignature's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

automatedoutlooksignature's Issues

Forcing Signature in Outlook Desktop (don't allow changes)

I 'think' i read that this scripts intended design was to lock the signature settings for the users with this script in the youtube video. For me, it looks like it locks users out of making any changes in the Outlook desktop app signature settings right after the script runs, but after closing and reopening outlook or rebooting, they are able to update the signature. Have you seen this behavior? Is there any gpo or reg setting that can lock the signature settings down so changes can't be made?

Arabic Text Encoding in Signature Generation

Problem:

The Set-OutlookSignature.ps1 script encounters difficulties in handling Arabic names and titles during the signature generation process. When users with Arabic names or titles log in, the script saves the Arabic text as "?" in the generated signature file.

Issue Details:

Character Encoding: The script appears to struggle with proper character encoding for Arabic text, resulting in the substitution of Arabic characters with "?" in the signature.
User Impact: Users with Arabic names or titles may experience inaccurate representation of their information in the generated signature, leading to a lack of personalization and potential miscommunication.

Offline

What happens to the signature if the user is offline? Litterally just thought of this so will give this ago.

Easy solution will be to check for connectivity to active directory and if there is none to not continue executing the rest of the script.

Add Company from AD

Rather than rely on Company being filled out use the Company field from AD.

special characters are not displayed correctly in out-file

The script doesn't genereate the correctly encoded specials characters like german umlauts.
I already tried to set the encoding for out-file to utf8, but that does only work for values from active directory. If I output some static values directly within the script (because they are not all defined in active directory), they are not displayed as they should.

I could use ü and so on, but this only works for the html-signature, not for the text-version.

New Outlook (Microsoft Store)

Hi,

has anyone found a solution for the new version of outlook from the microsoft store? The signature doesn't even show up in the available ones. For version 16 everything works fine so I think it's a regedit issue

Make changes based on groups

$Group = [ADSI]"LDAP://cn=IT Staff,OU=Staff,DC=Example,DC=co,DC=uk"
$ITMember = $false
$Group.Member | ForEach-Object {
if ($user.distinguishedname -match $_) {
$ITMember = $true
}
}

$(if($ITMember){"IT Helpdesk: xxxxx
"})

department

Hello,

is it possible to insert "department", what i have to insert? Thanks for your help!

Multiple Accounts in Desktop Outlook Client

Problem:

The current Set-OutlookSignature.ps1 script generates a single signature file based on the Active Directory details of the user who is logged in. However, many users have multiple accounts configured in their desktop Outlook client.

Issue Details:

Scenario: When a user has multiple email accounts in Outlook, the script only considers the Active Directory details of the account used during login.
Impact: This results in a uniform signature across all accounts, which may not accurately represent the information associated with each specific email account.
User Experience: Users with distinct roles or responsibilities across different accounts may find that the generated signature doesn't reflect the appropriate information for each account.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.