Skype for Business – Get QoS Configuration with PowerShell

When configuring QoS (Quality of Service) in Microsoft Lync / Skype for Business you need to modify the media port ranges for various Services and Configuration using PowerShell. Pat Richard has made a brilliant QoS calculator for Lync/Skype for Business here http://www.ehloworld.com/2821. The calculator will provide you with the PowerShell commands required to configure QoS port ranges and the GPO’s. The calculator also gives you the commands to verify the Configuration (which this post is based on). ...

26 January 2016 · 3 min · Chris Hayward

SCOM / SCCM – Script install on DMZ or Workgroup Machine

This is a very rough and ready script to install Microsoft SCCM 2012 R2 and SCOM 2012 R2 on a non-domain joined Windows Server 2012 R2 (e.g. DMZ). The script is provided “As is” so please test it thoroughly on your environment. You will need to modify the script to suit your environment, you will notice there are no variables configured etc. On this environment SCOM and SCCM were both configured to use certificates (HTTPS), this script will generate the CSR and uses the same Certificate for SCOM and SCCM. They both require a Client and Server Authentication Certificate where the Subject Name matches the FQDN of the server. You need to configure your server name and DNS suffix before running this script. ...

22 December 2015 · 4 min · Chris Hayward

Skype for Business 2015 – Automated Backup Script

A few years ago I created a Lync 2013 backup script that would backup data from all servers in the Topology. Lync 2013 Automated Backup Script This script also works with Skype for Business 2015 but it specifically backed up Response Group and User data by identifying the pool version. The script below has been updated and tested on SfB 2015. <# Author: Chris Hayward, chrishayward.co.uk Purpose: Centralised script to backup Lync 2013 and SfB 2015 Version: 1.2 Changes: DATE - Change 06/11/2013 - Release 1.1 - Fixed code that deletes old backup directories (CH) 27/11/2015 - 1.2 Updated for Skype for Business (version -gt 7 rather than -eq 6) #> Import-Module Lync # Script Config $BackupPath = "D:\_Backup\" # Backup Path $BackupRetention = -14 # Number of days to keep old backups (Requires a "-", e.g. two weeks would be -14, 5 days would be -5) # *** Start of script *** # Delete old backup directories Get-ChildItem $BackupPath |? {$_.psiscontainer -and $_.lastwritetime -le (get-date).adddays($BackupRetention)} |% {remove-item $_.FullName -recurse -force} # Get date in day-month-year format and set backup path $DateStamp = Get-Date -Format dd-MM-yy $BackupPath = $BackupPath + "LyncBackup_" + $DateStamp +"\" New-Item $BackupPath -type directory -force # Backup the Lync Central Management Store $CMSBackupFile = $BackupPath + "Lync-CMS-Config.zip" Export-CsConfiguration -FileName $CMSBackupFile # Backup Location Information Service data $LISBackupFile = $BackupPath + "Lync-LIS-Config.zip" Export-CsLisConfiguration -FileName $LISBackupFile # Backup User Data (Lync 2013 & SfB 2015 servers only) $UserServer = Get-CsService -UserServer | Where-Object {$_.version -ge 6} ForEach ($Service in $UserServer) { $UserDataBackupFile = $BackupPath + "Lync-User-Config_" + $($Service.PoolFqdn) + ".zip" Export-CsUserData -PoolFQDN $($Service.PoolFqdn) -FileName $UserDataBackupFile } # Backup Response Group Configuration (Lync 2013 & SfB 2015 servers only) $ApplicationServer = Get-CsService -ApplicationServer | Where-Object {$_.version -ge 6} ForEach ($Service in $ApplicationServer) { $RGSBackupFile = $BackupPath + "Lync-RGS-Config_" + $($Service.PoolFqdn) + ".zip" Export-CsRgsConfiguration -Source ApplicationServer:$($Service.PoolFqdn) -FileName $RGSBackupFile } # Backup Voice Configuration $BackupPath = $BackupPath + "Lync-Voice-Config\" New-Item $BackupPath -type directory -force Get-CsDialPlan | Export-Clixml -path $BackupPath\DialPlan.xml Get-CsVoicePolicy | Export-Clixml -path $BackupPath\VoicePolicy.xml Get-CsVoiceRoute | Export-Clixml -path $BackupPath\VoiceRoute.xml Get-CsPstnUsage | Export-Clixml -path $BackupPath\PSTNUsage.xml Get-CsVoiceConfiguration | Export-Clixml -path $BackupPath\VoiceConfiguration.xml Get-CsTrunkConfiguration | Export-Clixml -path $BackupPath\TrunkConfiguration.xml To run the script as a scheduled task: ...

27 November 2015 · 2 min · Chris Hayward

Hyper-V 2012 R2- Replica Email Notification Script

Here is an example Hyper-V replica email notification script. Scenario is Hyper-V cluster replicating business critical VMs to a single Hyper-V host. The script can be ran as a scheduled task on the DR Hyper-V host to send email notifications. The account running the script must have Hyper-V permissions. Script: Hyper-V 2012 Replica Email Script # Created by Chris Hayward # Purpose - To send a daily email displaying Hyper-V Replica status # Version 1.0 # Get date in UK format day/month/year $date = Get-Date -Format dd/MM/yy # Variables $MailFrom = 'hyperv_replica@yourdomain.com' $MailTo = 'you@yourdomain.com' $MailSubject = "Hyper-V Replica Report $date" $MailServer = 'smtp.yourdomain.coml' # Get replication status in HTML format $status = Get-VMReplication | Select-Object Name, State, Health, Mode, FrequencySec, PrimaryServer, ReplicaServer, ReplicaPort | ConvertTo-Html # Send email message Send-MailMessage -From $MailFrom -To $MailTo -Subject $MailSubject -BodyAsHtml -Body "$status" -SmtpServer $MailServer Example output: ...

17 November 2015 · 1 min · Chris Hayward

Lync – Change queue overflow number with PowerShell Script

The scenario is you have created a Response Group (IVR) with an option to call an Out Of Hours engineer. You configure a queue overflow to forward straight to a mobile telephone number outside of your organisation as follows: The out of hours engineer changes on a rota and you want staff to be able to change the queue overflow number without giving them having to access the Lync Control Panel. I have created a PowerShell script that allows users to accomplish this. They can select from a list of names in the menu or manually type a number. Any changes are logged to a text file. ...

12 July 2013 · 3 min · Chris Hayward

Lync 2013 – Automated Backup Script

This script will backup Lync 2013 core data and settings off all servers in the topology as per Technet article: http://technet.microsoft.com/en-us/library/hh202170.aspx The script does the following: Backup the Central Management Store Backup the Location Information Service Data Backup the user data on each Front End pool Backup the Response Group configuration on each Front End pool Backup the Voice Configuration It will create a new folder with a date stamp for each backup. It will also clean up backups older than x days. To use the script: ...

7 July 2013 · 3 min · Chris Hayward

How to Backup Lync Server 2010

It is important to backup your Lync environment so that you can restore service in the event of a disaster. The following Microsoft TechNet articles explain how to backup Lync Server 2010: http://technet.microsoft.com/en-us/library/hh202170 http://technet.microsoft.com/en-us/library/hh202171 In this article I would just like to share how I have simplified this process. Ben Lye at onesimplescript.com has written an excellent script that enumerates your Lync Topology and backs up your Topology Configuration data, Location Information Service data, Response Group configuration data from all pools and persistent user data from all registrars. The script can be found here: http://www.onesimplescript.com/2012/05/automating-backups-of-lync-2010.html ...

22 May 2012 · 2 min · Chris Hayward

Lync Tip: List Lync users with LineURI's to CSV

Using the Get-CsUser cmdlet you can get information about Lync users in your organization. The below powershell command exports Lync users, sip address, Enterprise Voice Enabled and Line URI to a CSV file. Get-Csuser | Select-Object DisplayName, SipAddress, EnterpriseVoiceEnabled, LineUri | Export-Csv -Path c:LyncUsers.csv

29 November 2011 · 1 min · Chris Hayward