Category Archives: Howto Tutorials (EN)

Knowledge Network for Tutorials, Howto’s, Workaround, DevOps Code for Professionals.

Outlook signature template distribution

How to automatically create Outlook signature with attributes from Active Directory

Within a company it is one of the tasks of system administrators to manage the signatures for the corporate identity. Most companies want to design the entire look and feel of the signature.

Outlook does not offer any direct options for this, as the email signature in Outlook is a client-side application and users can therefore create and change their own signature. However, there is the possibility of preventing access to the signature options using group policies. However, this does not correct the problem that a default signature is first created and generated and made available to the users.

Where a centralized solution at Outlook client level is preferred and you want to do without the Exchange Transport Rules, or no Exchange Server is used to generate the signatures and distribute them via login script or GPOs, this article can be a Provide an approach for centralized solutions.

VBScript Outlook Signature deployment

The following VBScript creates an Outlook signature on the client, while user data (attributes) are read from Active Directory, dsa.msc (Active Directory users and computers) and then inserted into the signature, after which the script inserts the signature in new e- Mails and replies to.

On Error Resume Next

Set objSysInfo = CreateObject("ADSystemInfo")

GetUser = objSysInfo.UserName
Set objUser = GetObject("LDAP://" & GetUser)

GetName = objUser.FullName
GetTitle = objUser.Title
GetDepartment = objUser.Department
GetCompany = objUser.Company
GetPhone = objUser.TelephoneNumber
GetOtherPhone = objUser.otherTelephone
GetMobile = objUser.Mobile
GetEmail = objUser.EmailAddress
GetFax = objUser.FaxNumber
GetStreet = objUser.StreetAddress
GetZip = objUser.PostalCode
GetCity = objUser.l
GetState = objUser.State
GetHomepage = objUser.Homepage
GetNotes = objUser.Info
Appendix = "Feel free to contact us if you have any questions."
Regards = "Best Regards,"

Set objWord = CreateObject("Word.Application")

Set objDoc = objWord.Documents.Add()
Set objSelection = objWord.Selection

Set objEmailOptions = objWord.EmailOptions
Set objSignatureObject = objEmailOptions.EmailSignature

Set objSignatureEntries = objSignatureObject.EmailSignatureEntries

' BOF signature

objSelection.Font.Name = "Calibri"
objSelection.Font.Size = 11
objSelection.TypeText Appendix
objSelection.TypeParagraph()
objSelection.TypeText Regards & Chr(11)
objSelection.TypeText GetName
objSelection.TypeParagraph()
objSelection.TypeText GetTitle & " " & GetDepartment & Chr(11)
objSelection.TypeText "Mobile " & GetMobile
objSelection.TypeParagraph()
objSelection.Font.Name = "Arial Black"
objSelection.Font.Size = 13
objSelection.Font.Bold = True
objSelection.Font.Color = RGB(22,46,106)
objSelection.TypeText GetCompany
objSelection.Font.Name = "Calibri"
objSelection.Font.Size = 11
objSelection.Font.Bold = False
objSelection.Font.Color = RGB(0,0,0)
objSelection.TypeParagraph()
objSelection.TypeText GetStreet & "  " & GetZip & " " & GetCity & "  " & GetNotes & Chr(11)
objSelection.TypeText "Telefon " & GetPhone & "  Fax " & GetFax & "  " & GetEmail & "  " & GetHomepage

' EOF signature

Set objSelection = objDoc.Range()

objSignatureEntries.Add "MySignature", objSelection
objSignatureObject.NewMessageSignature = "MySignature"
objSignatureObject.ReplyMessageSignature = "MySignature"

objDoc.Saved = True
objWord.Quit

The lines of code are copied into an editor, probably Notepad, and saved with the file extension-.vbs.

Adjustments to the signature can be made in the script between BOF signature and EOF signature.

Now execute the script on a workstation with Outlook, there is no output on the screen, then open Outlook will a new e-mail can be created, the signature now appears in the message, which looks similar to the figure below.

Outlook Signature
Outlook Signatur

Outlook Signaturen Client distribution

You can configure scripts for login via GPOs. The settings for login and logout scripts can be found under User Configuration => Policies => Windows Settings => Scripts. The storage location for scripts that are assigned via GPOs is under the path \\FQDN\SYSVOL\FQDN\policies\user\scripts\logon and logoff.

Suggestions and adjustments

Suggestions for this post are desired and welcome; there is a repository referenced for this post on Github. If you like this post, you can also give us a rating there. If you want to contribute to this project, you can fork your own repository, do not hesitate to create your own repository or project with a pull request, it is open source and it is licensed under the MIT license.

Windows DisabledComponents IPv4 Instead of IPv6

How to use IPv4 prefers instead of IPv6 using DisabledComponents in Windows

Windows DisabledComponents IPv4 Instead of IPv6

The affine coexistence of IPv6 and IPv4 for resources in the transition period is not necessarily desirable for network environments with Windows domains, unexpected disruptions in name resolution can occur, connections to network drives can fail, or authentication to the domain is temporarily not possible, often after an IPv6 capable router has been integrated into the network, If clients search in vain for a domain via the AD Domain Services, since IPv6 is preferred, in coexistence with IPv4, the IPv6 protocol must often be configured system-wide.

Introduction

Microsoft Windows Vista, Windows Server 2008, and later versions of Windows use RFC 3484 and a prefix table to determine which address to use when multiple addresses are available for a Domain Name System (DNS) name.

By default, Windows prefers global IPv6 unicast addresses over IPv4 addresses.

Steps to favor IPv4

Internet protocol version 6 (IPv6) is a mandatory component of Windows 10, as well as from Windows Server 2008 and newer. It is recommended to use “Preferably use IPv4 instead of IPv6” in prefix policies instead of disabling IPv6.

REG ADD DisabledComponents

The preference of IPv4 over IPv6 can be enabled by changing the registry key DisabledComponents with the registry value Hex 0x20 (Dec 32).

REG ADD "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters" /v DisabledComponents /t REG_DWORD /d "32" /f

 Copy Paste and run in command prompt as admin.

IPv4 IPv6 Registry Key DisabledComponents
Registry Key DisabledComponents

The registration method to favor Windows IPv4 over IPv6 is a general, but less system-compliant solution. At the end, Windows changes the prefix policy table as shown in the following section.

Using the netsh tool prefixpolicy

When the netsh tool is executed, the policy table shows output with the prefix, the priority and label.

C:\>netsh interface ipv6 show prefixpolicies

The Windows 10 default prefix policy setting is as follows:

C:\>netsh interface ipv6 show prefixpolicies
Querying active state...

Precedence   Label  Prefix
----------  -----  --------------------------------
        50      0  ::1/128
        40      1  ::/0
        30      2  2002::/16
        20      3  ::/96
        10      4  ::ffff:0:0/96
         5      5  2001::/32

Please note that IPv6 addresses (:: / 0) are preferred over IPv4 addresses (:: / 96 and :: ffff: 0: 0/96).

netsh int ipv6 set prefixpolicy

Increasing the priority for the IPv4 prefix with set prefixpolicy.

netsh int ipv6 set prefixpolicy ::ffff:0:0/96 50 0

::ffff:0:0/96 are the IPv4 Prefix, 50 is the Priority (very high) and 0 are the Label.

C:\>netsh interface ipv6 show prefixpolicies
Querying active state...

Precedence   Label  Prefix
----------  -----  --------------------------------
        50      0  ::ffff:0:0/96
        40      1  ::1/128
        30      2  ::/0
        20      3  2002::/16
         5      5  2001::/32
         3     13  fc00::/7
         1     11  fec0::/10
         1     12  3ffe::/16
         1      4  ::/96

Using IPv6 Registry Key DisabledComponents

To configure IPv4 and IPv6 DisabledComponents, change the following registry value based on the following table.

Location:         HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters\
Name:             DisabledComponents
Type:             REG_DWORD
Min Value:        0x00
Max Value:        0xFF (IPv6 disabled)
IPv6-FunctionalityRegistry-key valueComment

Prefer IPv4 over IPv6

Dec 32

 

Hex 0x20

Bin xx1x xxxx

Recommended instead of disabling them.
Disable IPv6Dec 255

 

Hex 0xFF

Bin 1111 1111

For more information, see article KB3014406 if there is a startup delay after disabling IPv6 in Windows 7 SP1 or Windows Server 2008 R2 SP1.

In addition, the system start is delayed by 5 seconds if IPv6 is deactivated by incorrectly setting the DisabledComponents registry setting to the value 0xfffffff. The correct value must be “0xff”.

The registry value “DisabledComponents” does not affect the status of the check box. Even if the DisabledComponents registry key is set to IPv6, the check box on the Network tab can be selected for each interface. This behavior is normal and by design.

Deactivating IPv6 on all non-tunnel interfacesDec 16

 

Hex 0x10

Bin xxx1 xxxx

 
Deactivating IPv6 on all tunnel interfacesDec 1

 

Hex 0x01

Bin xxxx xxx1

 
Deactivate IPv6 on all nontunnel interfaces (except loopback) and on the IPv6 tunnel interfaceDec 17

 

Hex 0x11

Bin xxx1 xxx1

 
Prefer IPv6 over IPv4Bin xx0x xxxx 
Re-enable IPv6 on all non-tunnel interfacesBin xxx0 xxxx 
Re-enable IPv6 on all tunnel interfacesBin xxx xxx0 
Re-enable IPv6 on all non-tunnel interfaces and on IPv6 tunnel interfacesBin xxx0 xxx0 

Source URL: Advanced guide to configuring IPv6 in Windows

The change requires a restart. So that the setting does not have to be carried out manually on every PC, the action can be made using an ADMX file with a group policy setting.

REG ADD Disable IPv6

IPv6 is deactivated with the following REG entry.

REG ADD HKLM\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters /v DisabledComponents /t REG_DWORD /d 255 /f

Whereby IPv6 remains activated for the loopback interface. However, this should not have a negative impact, as it also ensures that IPv4 is preferred.

If IPv6 is to be reactivated, the following key applies.

REG ADD HKLM\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters /v DisabledComponents /t REG_DWORD /d 0 /f

Using IPv6 DisabledComponents in the PowerShell

Checking for existing IPv6 addresses in PowerShell.

ipconfig | Select-String IPv6
Checking DisabledComponents for existing IPv6 addresses in PowerShell

Prefer IPv4 in PowerShell

In PowerShell, IPv4 is preferred by DisabledComponents as follows.

New-ItemProperty "HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters\" -Name "DisabledComponents" -Value 0x20 -PropertyType "Dword"
Set-ItemProperty "HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters\" -Name "DisabledComponents" -Value 0x20

PowerShell must be open with elevated rights. The change requires a restart.

Determine which IP version is being answered.

ping $env:COMPUTERNAME