Friday, April 26, 2024
HomePowershellAutomating with PowerShell: Monitoring Workplace Releases

Automating with PowerShell: Monitoring Workplace Releases


New Web site and upcoming blogs

So I haven’t blogged for the final month, and I’m not gonna let you know that was as a result of I used to be shifting my web site to Azure Static Net Apps, as a result of it was not. I simply couldn’t discover the time or inspiration to put in writing something down that might be helpful to anybody. It occurs generally and a little bit of writers(or bloggers, or PowerShellers) block occurs to anybody. Running a blog and sharing information is likely one of the most satisfying issues I achieve this naturally I acquired somewhat bit irritated at myself.

To get again within the recreation, I’ve determined to maneuver the CyberDrain.com web site from my outdated net host to Azure Static Net Apps. In a “apply what you preach” kind of factor I figured that this transfer makes most sense for me; it offers me a CDN, the aptitude to stay an API behind a few of my stuff, and permit me to edit pages in markdown and never that annoying WordPress editor that at all times acquired me down. 😉

I’ve additionally determined to start out a brand new running a blog collection subsequent to my PowerShell blogs, I need to write down some extra of my experiences as an alternative of simply dropping technical bombs on a regular basis. I’ve usually had folks tweet or discuss my CTF story instances I’ve encountered difficult points in my enterprise and I consider I’ve sufficient enjoyable tales to maintain everybody entertained with these as nicely.

To get began with running a blog once more I’ve determined to launch 3 new blogs within the coming days, of which that is the primary. I hope you’ll all take pleasure in them, and the brand new platform too.

Automating with PowerShell: Monitoring Workplace releases

I’ve blogged about monitoring updates for workplace earlier than however that could be a fairly static method to issues; it’s a must to enter the newest model of Workplace your self and with the now bi-weekly updates within the preview channel that would get annoying, particularly if you wish to maintain your minimal model the identical as the newest launched model.

And that’s the place this weblog enters; Microsoft has a pleasant API obtainable that tells us precisely which newest model is on the market for Workplace, it additionally tells us precisely which variations are now not supported and actually require an replace. This monitoring script tells you which ones model is presently put in, if it’s the newest model, and if not, if the model you’re working continues to be in assist by Microsoft.

 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
$ReportedVersion = Get-ItemPropertyValue -Path "HKLM:SOFTWAREMicrosoftOfficeClickToRunConfiguration" -Title "VersionToReport"
$Channel = Get-ItemPropertyValue -Path "HKLM:SOFTWAREMicrosoftOfficeClickToRunConfiguration" -Title "CDNBaseUrl" | Choose-Object -Final 1
$CloudVersionInfo = Invoke-RestMethod 'https://shoppers.config.workplace.web/releases/v1.0/OfficeReleases'
$UsedChannel = $cloudVersioninfo | The place-Object { $_.OfficeVersions.cdnBaseURL -eq $channel }

if ($UsedChannel.latestversion -eq $ReportedVersion) {
    Write-Host "At present utilizing the newest model of Workplace within the $($UsedChannel.Channel) Channel: $($ReportedVersion)"
    exit 0
}
else {
    Write-Host "Not utilizing the newest model within the $($UsedChannel.Channel) Channel. Verify if model continues to be supported"
    $OurVersion = $CloudVersionInfo.OfficeVersions | The place-Object -Property legacyVersion -EQ $ReportedVersion
    if ($OurVersion.endOfSupportDate -eq "0001-01-01T00:00:00Z") {
        Write-Host "This model doesn't but have an end-of-support date. You're working a present model, however not the newest. Your model is $($ReportedVersion) and the newest model is $($UsedChannel.latestVersion)"
        exit 0
    }
    if ($OurVersion.endOfSupportDate) {
        Write-Host "this model won't be supported at $($OurVersion.endOfSupportDate). Your model is $($ReportedVersion) and the newest model is $($UsedChannel.latestVersion)"
        exit 1
    }
    else {
        Write-Host "Couldn't discover model within the supported variations checklist. This model is almost definitely now not assist. Your model is $($ReportedVersion) and the newest model is $($UsedChannel.latestVersion). For all supported variations, see beneath"
        $CloudVersionInfo.OfficeVersions
        exit 1
    }
}

As at all times, Blissful PowerShelling

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments