forked from Gerenios/AADInternals
-
Notifications
You must be signed in to change notification settings - Fork 1
/
ClientTools.ps1
61 lines (48 loc) · 1.51 KB
/
ClientTools.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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# This script contains functions for client side
<#
.SYNOPSIS
Gets the Office update branch of the local computer
.DESCRIPTION
Gets the Office update branch of the local computer from the registry
.Example
Get-AADIntOfficeUpdateBranch
Update branch: Current
#>
# Jul 8th 2019
function Get-OfficeUpdateBranch
{
Param(
[ValidateSet('16.0')]
[String]$Version="16.0"
)
Process
{
$reg=Get-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\office\$Version\common\officeupdate\"
Write-Host "Update branch: $($reg.updateBranch)"
#Write-Host "Automatic updates enabled: $($reg.EnableAutomaticUpdates -ne 0)"
}
}
<#
.SYNOPSIS
Sets the Office update branch of the local computer
.DESCRIPTION
Sets the Office update branch of the local computer to the registry. Requires administrator rights!
.Example
Set-AADIntOfficeUpdateBranch -UpdateBranch InsiderFast
Update branch: InsiderFast
#>
# Jul 8th 2019
function Set-OfficeUpdateBranch
{
Param(
[ValidateSet('16.0')]
[String]$Version="16.0",
[ValidateSet('InsiderFast','FirstReleaseCurrent','Current','FirstReleaseDeferred','Deferred','DogFood')]
[String]$UpdateBranch="Current"
)
Process
{
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\office\$Version\common\officeupdate\" -Name "updateBranch" -Value $UpdateBranch
Get-OfficeUpdateBranch -Version $Version
}
}