Select Page

Required Files: None

This checks office activation status for Office 2016 32 and 64 bit


.Creator:  Steven Grabowski - SoHo Integration, LLC
This script will work with 32 or 64 bit Office 2016 to check status of Office Activation.
A ticket is created if it isn't a 'Healthy License' status.
Import-Module $env:SyncroModule
$subdomain = "yoursubdomain"
$tempOutFile = "c:\temp\test.txt"
if(Test-Path -Path "C:\Program Files (x86)\Microsoft Office\Office16"){
    cscript "C:\Program Files (x86)\Microsoft Office\Office16\OSPP.VBS" /dstatus | out-file $tempOutFile
if(Test-Path -Path "C:\Program Files\Microsoft Office\Office16"){
    cscript "C:\Program Files\Microsoft Office\Office16\OSPP.VBS" /dstatus | out-file $tempOutFile
$wholeFile = Get-Content -path $tempOutFile
$results = get-content -path $tempOutFile | Where-Object {$_ -like 'LICENSE STATUS*'}
#write-output $results.Count
for ($i=0; $i -lt $results.count; $i++){
    #write-output $results[$i]
    if ($results[$i] -like "*---LICENSED---*"){
        write-output "Good License"
    } else {
        $varTicket = Create-Syncro-Ticket -Subdomain $subdomain -Subject "Office Licensing Issue on $env:computername" -IssueType "Other" -Status "New"
        $ticket = $varticket.ticket.number
        Create-Syncro-Ticket-Comment -Subdomain $subdomain -TicketIdOrNumber $ticket -Subject "Ticket Update" -Body "$wholeFile" -Hidden $False -DoNotEmail $False
        write-output "There is a potential issue with your Office 365 Licensing - created a ticket"
remove-item $tempOutFile