Scripts

August 14th, 2019 Leave a comment Go to comments

Here is a list of all of my scripts I’ve posted about on this blog. I’ll try to keep this page current.

Lync Server/Skype for Business Server scripts, functions, and tools

Get-CsMaliciousCalls (01-25-2018)
Retrieve data about calls reported as malicious in Skype for Business.

Get-CsPhoneNumberAssignment (01-22-2018)
Find Where a Number is Assigned in Skype for Business.

The Case of the Missing Skype for Business Presence Options in the Taskbar (01-08-2018)
Restore the missing presence options when hovering over the Skype for Business taskbar icon.

Test-InvalidCerts 1.2 (03-17-2017)
Checks root and intermediate certificate stores for certificates in the wrong store & moves them to the correct store.

QoS Calculator v1.7 (02-28-2017)
Calculate all necessary group policies and settings to successfully deploy Quality of Service (QoS) in a Lync/Skype for Business environment.

Get-CsFederatedConversationDetails.ps1 v1.0 (05-13-2014)
See time & date info about conversations with specific federated domains.

Get-CsUpdateVersion.ps1 v3.9 (03-08-2017)
See installed Cumulative Update version for all Lync & Skype for Business servers.

Get-CsDatabaseUpdateStatus.ps1 v1.2 (02-24-2018)
Shows database version info, and indicates if database updates are needed as a result of installation of a Cumulative Update.

New-CsLyncRoomSystem.ps1 v1.2 (06-10-2014)
Easily deploy this exciting feature in Lync Server 2013. Creates & configures mailbox, meeting room, etc.

New-CsClonedPolicy.ps1 v1.3 (02-03-2017)
Clones an existing Lync/Skype for Business Server 2015 policy to a new policy. Includes support for user and site level policies.

Set-CsFeatures.ps1 5.5 (08-12-2019)
Install the prerequisites and many additional features, configurations, and add-ons for Lync Server 2013 and Skype for Business Server 2015/2019 on Windows Server 2012, 2012R2, 2016, and 2019.

Set-Cs2013Features.ps1 v3.8 (03-25-2015)
Install the prerequisites and many additional features, configurations, and add-ons for Lync Server 2013.

Set-Lync2010Features.ps1 v5.3 (12-23-2011)
Install the prerequisites and many additional features, configurations, and add-ons for Lync Server 2010.

Get-CsConnections.ps1 v3.5 (08-14-2019)
Lists connections per Lync and Skype for Business Server Front End server in a pool, load balancing distribution, and per user connections.

Get-CsVoiceCalls.ps1 v1.4 (06-12-2012)
View basic information about current voice calls in Lync Server 2010.

New-CsFirmware.ps1 v2.1 (02-08-2017)
Import single or multiple Lync Phone Edition firmware updates to single or multiple pools. Includes support for Polycom VVX and Snom firmware, too.

Grant-CsPolicyByADGroup.ps1 v1.7 (02-03-2017)
Assign Lync/Skype for Business Server policies to users based on Active Directory group membership.

Automatically Installing and Configuring WireShark for Skype for Business 2.2.12 (01-19-2018)
Install WireShark and configure the common settings for Skype for Business Server.

Lync Server/Skype for Business Server/Office 365/Teams one liners

  1. One-Liner: Get Your Office 365 Tenant ID
  2. One Liner: See Number Of Connected Users, Endpoints On A Lync Front End Server
  3. One Liner: Finding out which Lync/Skype for Business pool servers a user is associated with, and the preferred connection order
  4. One Liner: Finding AD disabled accounts who are still Lync enabled
  5. One Liner: Setting recovery option to ‘restart’ for Lync/Skype for Business services
  6. One Liner: Find Users Whose SMTP Address Doesn’t Match Their SIP Address
  7. One Liner: Finding Elevated Accounts That Are Enabled For Lync/Skype for Business
  8. One Liner: Add Trusted Root Cert Authorities to Edge Servers
  9. One Liner: See Who You’re Openly Federating With

Exchange Server scripts, functions, and modules

ExchangeServices v1.1 (01-26-2015)
Module with several functions to stop/start/query/configure Exchange services

Set-Exchange2010Features.ps1 v3.3 (12-29-2011)
Install the prerequisites for Exchange 2010 on Windows 2008 R2.

Set-Exchange2010FilterConfig.ps1 v2.0
Configure the Filter Pack for Exchange 2010

Set-Exchange2010RedirectSSL.ps1 v1.5 (04-29-2014)
Configure SSL settings and folder redirection for Exchange 2010

Add-BadWordsFromFile.ps1 v1.0 (10-08-2009)
Import a list of bad words from a file for the Exchange 2010 content filter.

Hide-InternetNewsgroups.ps1
Hide the Internet Newsgroups folder from appearing in the Public Folder list of Exchange Server.

Add-Cmdlets2Dictionary.ps1
Add Exchange 2007 and/or 2010 cmdlets to the Microsoft Word dictionary

DAG-InstallRollup.ps1
Script for installing update roll-ups on DAG servers

New-WelcomeEmail.ps1 v1.3 (02-24-2013)
Automatically sends an informative, HTML formatted email to a user once their mailbox is created.

AutoApplyMRMPolicy.ps1
Automatically apply an MRM policy to mailboxes upon creation

Update-MobileNumber.ps1
Update the Global Address Book when a user adds a new ActiveSync device

New-DirectoryUpdateReminder.ps1 v1.7 (01-27-2014)
Remind users to update their Active Directory information

New-ADPasswordReminder.ps1 v2.9 (09-13-2013)
Sends an informative, HTML formatted email to users whose password is soon expiring. This is useful for those users who are mobile only and don’t get the conventional notices.

Function: New-LocalExchangeConnection
Establishes a connection to Exchange 2010 on the local server

Exchange Server one liners

  1. One Liner: Finding users with forwarding addresses set
  2. One Liner: See failed inbound messages for the past few days
  3. One Liner: Restarting stopped services
  4. One Liner: Finding users who have Send-As or Full Access permissions to mailboxes
  5. One Liner: Setting the default language and time zone for OWA
  6. One Liner: Exporting distribution list membership to Excel
  7. One Liner: Get All Exchange Users Who Are Configured For Forwarding
  8. One Liner: List All Users Who Have Send-As Access To Other Mailboxes

Misc scripts

Function: Test-InvalidCerts v1.0 (03-17-2017)
Ensuring Certificates Are In The Correct Certificate Store

Function: Remove-IisLogFiles v1.0 (11-21-2016)
Purging Old IIS Log Files with PowerShell

Function: Get-UpdateInfo v1.0 (10-10-2016)
Making It Easy for Your Users to Get the Latest Version of Your Scripts

Install-OWASLanguagePacks v1.0 (03-07-2015)
Easily download and install any of the 49 available Office Web Apps Server 2013 language packs.

Function: Set-PowerPlan v1.0 (02-25-2014)
Set the power plan of a server for better performance.

Function: Set-AdminUser v1.0 (10-22-2012)
Clear AdminCount and set security inheritance on a specified user account

Function: New-PSUpdateHelpScheduledTask v1.5 (01-10-2015)
Automatically create a scheduled task to update PowerShell v3 help files

Function: Set-Timezone v1.0 (03-04-2013)
Easily define the desired timezone when building servers

Function: New-SignedScript v1.4 (09-08-2017)
Sign one or many PowerShell scripts with your code signing certificate

New-ExpiringCertificatesReminder.ps1 v1.3 (02-13-2017)
Receive a Reminder When Certificates Have Expired/Are Expiring

Function: New-FirewallRule v1.0 (09-14-2012)
Create Windows Firewall rules with PowerShell

Set-WindowsEmailAddress.ps1 v1.2 (01-27-2014)
Update the WindowsEmailAddress field of users in environments WITHOUT Exchange server.

Function: New-LoopbackAdapter.ps1 v1.0
Create and configure a loopback adapter for use with Direct Server Return hardware load balancing.

New-HandBrakeConversion.ps1 v1.3 (10-04-2011)
Process entire folders of video files through HandBrake to convert them to iTunes format.

Function: Remove-NicGateway v1.0 (03-13-2012)
Removes the default gateway on selected network interfaces

Function: Set-DriveLabel v1.0 (03-06-2012)
Set the label of a selected drive

Function: New-BalloonTip v1.3 (07-05-2016)
Show a Windows system tray balloon tip

Functions: Get-UACStatus and Set-UACStatus v1.0 (02-20-2012)
Functions for displaying and settings Windows User Access Control

Function: Set-ModuleStatus v1.2 (02-07-2014)
Load PowerShell modules with error checking

Function: New-Password v1.3 07-07-2016
Quickly and easily generate passwords, complete with phonetic pronunciation that also copies to the clipboard.

Functions: Get-LocalAdminGroupMembership and Set-LocalAdminGroupMembership v1.0 (12-22-2011)
Get and set local admin group membership on remote computers.

Function: New-Pause v1.0 (12-21-2011)
A graceful way to pause your PowerShell scripts

Function: New-Sleep v1.0 (12-20-2011)
A more graphical way to introduce delay in PowerShell scripts

Function: New-Share v1.0 (07-13-2011)
Programmatically create file shares

Function: Remove-ScriptVariables v1.0 (07-08-2011)
Remove all variables from a script from memory

Function: New-PSUpdateHelpScheduledTask v1.1 (02-07-2014)
Creates scheduled task that automatically updates PowerShell help files everyday.

Misc One Liners

One Liner: Enabling Mapped Drives in Elevated PowerShell Sessions

One Liner: Getting Your Public IP Address With PowerShell

One-Liner: Getting the Top 5 Errors In an Event Log

  1. Huseyin Unal
    March 4th, 2012 at 15:43 | #1

    Hi Pat, I’ d like to say thank you so much indeed for your amazing scripts. There’s no doubt that exchange server administrators deeply grateful to you! Cheers

  2. U. P. B. Michael
    May 7th, 2012 at 06:10 | #2

    Many thanks for your script which make things easier and saves time as well.
    Thanks again, great work.

  3. June 9th, 2015 at 07:37 | #3

    Hi, When do you think the Set-Cs2015Features.ps1 (Skype for Business 2015) will be ready? Awesome Scrips!
    Stefan

    • Pat Richard
      June 9th, 2015 at 08:39 | #4

      Soon

  4. suchi
    July 7th, 2015 at 12:47 | #5

    Can anybody has script to find out who else have access to abc mailbox

  5. anders
    September 17th, 2015 at 08:37 | #6

    @Pat Richard
    Hi! Any update on when the Set-Cs2015Features.ps1 (Skype for Business 2015) would be ready?

    The Set-Cs2013Features.ps1 is a solid piece of work, and really looking forward to the Skype version!

  6. Matt
    March 23rd, 2016 at 12:01 | #7

    Hello. Any update on the release of Set-Cs2015Features.ps1 for Skype for Business? Looking forward to new release to simplify our deployments.

    • Pat Richard
      March 23rd, 2016 at 12:12 | #8

      As soon as I finish writing the last chapter of Skype for Business Unleashed, I’ll get this out. I have some more tweaks to complete on it.

  7. Davide
    July 4th, 2016 at 07:41 | #9

    Hi Pat, any news on Set-Cs2015Features.ps1 ?

  8. Wolfgang
    September 20th, 2016 at 06:53 | #10

    hi, anyone got a script (oneliner maybe) to compare Lync/Skype4B Extension and Exchange UM (EUM) Extension? Usually its a good idea to match both extensions but sometimes only the LineURI Extension is changed, but People forgot to Change EUM Extension as well. Would be great if someone could code a powershell check

  9. Louise
    August 29th, 2018 at 19:38 | #11

    Is there a script to see users presence so I can clean up/delete from Lync users that have been offline for more than 30 days? I can do it manually if I look thru the users using my Lync client but I have 3000 users so it’s very time consuming

    • August 29th, 2018 at 19:40 | #12

      While you can query SQL to see the current presence (it’s returned as part of a big blob of data), there’s no timestamp on it.

  10. Navneet Luhar
    May 10th, 2019 at 14:49 | #13

    We have monitor server, Is there any way to get details of User’s Last Login Device details with SIP address? Thanks in advance.

  11. Freddy Corell
    October 8th, 2019 at 07:20 | #14

    Hi
    Have a issue/problem we have bumped into is related to some queries using PowerShell against the SQL database for Skype.
    Since the SQL database does not reside on the Skype server where the PowerShell components is installed it fails.
    The SQL database for Skype resides on a SQL Active/Passive cluster and is used for other applications I have to take care what to install.
    I have checked how to solve this, but have not yet found a solution for this.
    To get this fixed I have to install IIS with the OCSPowershell aka Skype for Business Server 2015 Web Components, Ocs Remote Powershell , it seems to only be a file called WsmanPlugin.dll.
    I suppose it also could be other components also.

    If you have any idea how to solve this, I would be really happy to know

  1. November 8th, 2016 at 18:16 | #1