Sylver SCHORGEN Blog's

Articles, astuces et news sur les technologies Microsoft et plus particulièrement tournant autour de Powershell
    • 17/8/2018

    [POWERSHELL] Configure Exchange Online email forwarding

    Hi everyone,

    I've created a PowerShell script to add an email forwarding rule on a mailbox for Exchange Online. What this script does is :

    • Connect to Exchange Online : You will be prompt for an admin credentials
    • Verifying that the source email address does not already have a forwarding rule
    • If your source email address does not have a forwarding rule, the script creates the one your want to configure
    • By default, the script keeps a copy of every email in the source mailbox and forward the email. If you don't want to keep a copy in the source mailbox, you can add the parameter -KeepACopyAndForward with the value $false

    I've added some verbose log in order to know what the script is doing :)

    How to use the script :

    .\New-O365EmailForwardingRule.ps1 -sourceEmailAddress "john.doe@mail.com" -DestinationEmailAddress "jean.dupont@mail.com"
    .\New-O365EmailForwardingRule.ps1 -sourceEmailAddress "john.doe@mail.com" -DestinationEmailAddress "jean.dupont@mail.com"
    -KeepACopyAndForward $false

    The Link of my script : https://github.com/sschorgen/PowerShell/blob/master/O365_New-O365EmailForwardingRule/New-O365EmailForwardingRule.ps1 

    • 16/8/2018

    [POWERSHELL] Add a Mail Contact in Exchange Online

    Hi everyone,

    I've created a PowerShell script to add a Mail Contact in an Exchange Online. What this script does is :

    • Connect to Exchange Online : You will be prompt for an admin credentials
    • Verifying that the contact does not already exist
    • If your contact does not exist, the script creates it
    • If you added the parameter to hide your contact from the GAL, the script hides it

    I've added some verbose log in order to know what the script is doing :)

    How to use the script :

    .\New-O365MailContact.ps1 -ContactEmailAddress "john.doe@mail.com" -UserFullName "John DOE"
    .\New-O365MailContact.ps1 -ContactEmailAddress "john.doe@mail.com" -UserFullName "John DOE"
    -HideFromGAL $True

    The Link of my script : https://github.com/sschorgen/PowerShell/blob/master/O365_New-O365MailContact/New-O365MailContact.ps1

    • 15/8/2018

    [POWERSHELL] Add a user to a distribution group

    Hello everybody,

    I created a script to add a user in an Exchange Online distribution group. What this script does is :

    • Connect to Exchange Online : You will be prompt for an admin credentials
    • Verifying that your user is not in the distribution group
    • If your user is not in the DG, he or she will be added to the DG

    I've added some verbose log in order to know what the script is doing :)

    How to use the script :

    Add-UserToO365DistributionGroup.ps1 -DistributionGoupName "Marketing Team" -Member "john.doe@mail.com"

    The Link of my script : https://github.com/sschorgen/PowerShell/blob/master/O365_Add-UserToO365DistributionGoup/Add-UserToO365DistributionGoup.ps1

    • 3/8/2018

    [POWERSHELL] DSC Resource Kit Release July 2018

    Hi everyone,

    Microsoft released the July update of the DSC Resource Kit. 12 modules have been updated :

    • ComputerManagementDsc
    • SecurityPolicyDsc
    • SharePointDsc
    • SqlServerDsc
    • xActiveDirectory
    • xDhcpServer
    • xDscResourceDesigner
    • xExchange
    • xPowerShellExecutionPolicy (now deprecated since now in ComputerManagementDsc)
    • xPSDesiredStateConfiguration
    • xRemoteDesktopSessionHost
    • xWebAdministration



    For more details => https://blogs.msdn.microsoft.com/powershell/2018/07/25/dsc-resource-kit-release-july-2018/

    • 2/8/2018

    [POWERSHELL] Let's automate my computer configuration :)

    Hello,

    In my obsession about automation, I never took the time to automate my own laptop reconfiguration (yeah I know, poor me ...). I have my up to date Windows 10 image with my drivers, but that's all. I never automated my software reinstallation or my Windows 10 configuration as I like it :)

    So the last couple of days, I've decided to do so :)

    You'll find in my GitHub repo a script doing these steps :

    1. Check if chocolatey is installed, if not, install it
    2. Install some softwares
      • Foxit Reader
      • Flash Player
      • Google Chrome
      • Firefox
      • VLC
      • Silverlight
      • Handbrake
      • Sonos Controller
      • iTunes
      • qBittorent
      • Git
      • GitHub
      • Visual Studio Code
      • Kitty
      • Remote Desktop Manager
      • FileZilla
      • Teamviewer
      • Keepass
      • Winscp
      • WinMerge
      • 7zip
      • Lightshot
      • Evernote
      • Dropbox
      • Microsoft Office 365 Pro Plus
      • Microsoft Teams
      • Slack
      • Rufus
      • Grisbi
      • Toggl
      • Listary
      • JRE 8
      • NuGet
      • AzureAD PowerShell module
      • MSOnline PowerShell module
      • SharePoint PnP for SharePoint Online module
    3. Configuring Windows as I want it to be configured
      • Install Hyper-V
      • Disable Windows 10 hibernation
      • Unpin start menu tiles
      • Remove Windows 10 Fax
      • Uninstall Windows XPS printer
      • Uninstall Microsoft Windows 10 preinstalled softwares
      • Show "This PC" desktop shortcut
      • Show hidden files in Windows explorer
      • Show well known extension in Windows explorer
      • Hide search taskbar
      • Configure Windows explorer to open at "This PC" location
      • Configure Control Panel view to "Categories"
      • Hide frequently and recently used item from Windows explorer

    For the configuration functions, I used some functions developped by Ali Robertson in its script reclaimWindows10.ps1

    You'll find my script on my GitHub repository : Direct Link to the script

    • 31/7/2018

    [SHAREPOINT 2013 - SP DESIGNER] Error were found when compiling the workflow. The workflow files were saved but cannot be run

    Hello everyone,

    Yesterday I was helping a customer on the creation of a particular workflow and when we published it we had this error : Error were found when compiling the workflow. The workflow files were saved but cannot be run.

    The detailed message on SharePoint ULS was :

    Microsoft.Workflow.Client.WorkflowCommunicationException: The request was aborted: The request was canceled. Client ActivityId : 7a290e9c-0917-7088-afc4-e65fd25c5c0b. ---> System.Net.WebException: The request was aborted: The request was canceled. ---> System.ServiceModel.ServiceActivationException: The requested service, 'net.pipe://localhost/SecurityTokenServiceApplication/appsts.svc' could not be activated. See the server's diagnostic trace logs for more information

    After searching on the web and trying some well documented solutions, I finally found what was the cause of our issue. The service Net.Pipe Listener Adapter wasn't started on the SharePoint web server. After I started it, I was able to publish the workflow.