-
Notifications
You must be signed in to change notification settings - Fork 0
/
check_sfb_sync.ps1
28 lines (25 loc) · 960 Bytes
/
check_sfb_sync.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<#
.SYNOPSIS
This script checks the replication state of a Skype for Business server.
.DESCRIPTION
This script checks the replication state of the local Skype for Business server services.
.NOTES
File Name : check_sfb_sync.ps1
Author : Christian Stankowic - info@stankowic-development.net
.EXAMPLE
check_sfb_sync.ps1
OK: Skype for Business services are synchronized
.LINK
https://www.github.com/stdevel/check_sfb_sync
#>
#############################################################################################
#get state
$state = (Get-CsManagementStoreReplicationStatus -ReplicaFqdn ((Get-WmiObject win32_computersystem).DNSHostName+"."+(Get-WmiObject win32_computersystem).Domain)).uptodate
#return code based on result
if($state -eq $true) {
Write-Host "OK: Skype for Business services are synchronized"
exit 0
} else {
Write-Host "CRITICAL: Skype for Business services are NOT synchronized"
exit 2
}