none
i need a simple script to apply siganture through group policy RRS feed

  • Question

  • hi ,

    i m not good at scripts at all so i need a simple one that will grab the users data from active directory

    First Name , last name , ext. , email ,

    and add it to a the word document that contains our signature template

    i downloaded alot of scripts but i cant find one that is simple enough to be used .

    hope you can help

    Thursday, November 29, 2018 9:31 AM

All replies

  • Hi Fady,

    Thanks for visiting the Outlook forum. Then here we mainly focus on general issues about Outlook desktop client. Since your query is related to scripts involved Word, I'll move your thread to the dedicated MSDN forum for Word for a better response:

    https://social.msdn.microsoft.com/Forums/office/en-US/home?forum=worddev

    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us. Thank you for your understanding.

    Regards,

    Yuki Sun


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnsf@microsoft.com.

    Click here to learn more. Visit the dedicated forum to share, explore and talk to experts about Microsoft Teams.

    Friday, November 30, 2018 5:22 AM
  • Hi Fady,

    You can use PowerShell to export Active Directory users to CSV. 

    Please refer to the following code:

    PROCESS #This is where the script executes 
    { 
        $path = Split-Path -parent "$CSVReportPath\*.*" 
        $pathexist = Test-Path -Path $path 
        If ($pathexist -eq $false) 
        {New-Item -type directory -Path $path} 
         
        $reportdate = Get-Date -Format ssddmmyyyy 
     
        $csvreportfile = $path + "\ALLADUsers_$reportdate.csv" 
         
        #import the ActiveDirectory Module 
        Import-Module ActiveDirectory 
         
        #Perform AD search. The quotes "" used in $SearchLoc is essential 
        #Without it, Export-ADUsers returuned error 
                      Get-ADUser -server $ADServer -searchbase "$SearchLoc" -Properties * -Filter * |  
                      Select-Object @{Label = "First Name";Expression = {$_.GivenName}},  
                      @{Label = "Last Name";Expression = {$_.Surname}}, 
                      @{Label = "Display Name";Expression = {$_.DisplayName}}, 
                      @{Label = "Logon Name";Expression = {$_.sAMAccountName}}, 
                      @{Label = "Full address";Expression = {$_.StreetAddress}}, 
                      @{Label = "City";Expression = {$_.City}}, 
                      @{Label = "State";Expression = {$_.st}}, 
                      @{Label = "Post Code";Expression = {$_.PostalCode}}, 
                      @{Label = "Country/Region";Expression = {if (($_.Country -eq 'GB')  ) {'United Kingdom'} Else {''}}}, 
                      @{Label = "Job Title";Expression = {$_.Title}}, 
                      @{Label = "Company";Expression = {$_.Company}}, 
                      @{Label = "Description";Expression = {$_.Description}}, 
                      @{Label = "Department";Expression = {$_.Department}}, 
                      @{Label = "Office";Expression = {$_.OfficeName}}, 
                      @{Label = "Phone";Expression = {$_.telephoneNumber}}, 
                      @{Label = "Email";Expression = {$_.Mail}}, 
                      @{Label = "Manager";Expression = {%{(Get-AdUser $_.Manager -server $ADServer -Properties DisplayName).DisplayName}}}, 
                      @{Label = "Account Status";Expression = {if (($_.Enabled -eq 'TRUE')  ) {'Enabled'} Else {'Disabled'}}}, # the 'if statement# replaces $_.Enabled 
                      @{Label = "Last LogOn Date";Expression = {$_.lastlogondate}} |  
                       
                      #Export CSV report 
                      Export-Csv -Path $csvreportfile -NoTypeInformation     
    }

    Please refer to the following link:

    Powershell Script to export Active Directory users to CSV

    Get-ADUser: Getting Active Directory Users Data via Powershell

    Best Regards,

    Bruce



    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread.

    Friday, November 30, 2018 8:52 AM
    Moderator
  • thanks but how do i put the data it gets into my signature template which is a word file .
    Sunday, December 2, 2018 1:24 PM
  • Hi Fady,

    You could refer to the following link:

    How to import a CSV file into a word document

    Best Regards,

    Bruce


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread.

    Tuesday, December 4, 2018 2:44 AM
    Moderator