Help Distribution Example

2014w29-GP-PowerShell-Update-Help-exampleEarlier today, I opened the topic of Windows PowerShell Help update distribution. This article continues where that one left off.

Once you have saved help information to a file share, other computers can be updated from that information. Three ways to perform such updates are described herein. They are:

• Manual Update
• Semi-Automatic Updates using a PowerShell Scheduled Job
• Automatic Updates using Active Directory-based Group Policy

The Manual technique simply involves running the Update-Help cmdlet to perform a one-time upon of a machine. The “Semi-Automatic” approach merely creates a new PowerShell scheduled job to periodically run the same update. Finally, the Automatic method uses the Group Policy setting with the path:

‣ Computer Configuration >
‣ Policies >
‣ Administrative Templates >
‣ Windows Components >
‣ Windows PowerShell >
‣ Set the default source path for Update-Help

In all three cases, the source path for the updates need to come from the file share in which you had saved the help information by using Save-Help. When using the Update-Help cmdlet directly for the manual and semi-automatic styles, the -SourthPath parameter is used to provide the appropriate path. For the automatic approach, a Group Policy Object (GPO) could be created with the aforementioned setting enabled and its Default Source Path value assigned the same path. Consider the following snapshot of a script depicting these three techniques, along with the prerequisite creation of the file share and populating it Save-Help.

The comments in the script provide commentary on the different sections and their use relative to the descriptions included above. For your convenience the contents of the script has been retranscribed here with some minor edits. I hope that this helps. Please let me know of any questions or suggestions. Thank you!

# Set up the PowerShell-Help share
New-Item -Path E:PowerShell-Help -ItemType Directory
New-SmbShare -Name PowerShell-Help -Path E:PowerShell-Help

# Update the share. This should be done when additional modules are needed,
# or when new versions are available.
Save-Help -DestinationPath lon-dc1PowerShell-Help

# “MANUAL” method:
# Clients can manually pull down the updates using:
Update-Help -SourcePath lon-dc1PowerShell-Help

# “SEMI-AUTOMATIC” style:
# Clients could alternatively request regularly scheduled updates:
Register-ScheduledJob -Name UpdateHelpJob -Credential ADATUMPSHelpUpdater `
-ScriptBlock { Update-Help -SourcePath lon-dc1PowerShell-Help } `
-Trigger (New-JobTrigger -Daily -At “3 AM”)

# “AUTOMATIC” approach:
# Or, set clients up to get updates via Group Policy
$myGPO = “PowerShell Policy”
$myKey = ‘HKLM:SOFTWAREPoliciesMicrosoftWindowsPowerShellUpdatableHelp’
$myPath = ‘lon-dc1PowerShell-Help’
New-GPO -Name $myGPO
New-GPLink -Name $myGPO -Target “OU=IT,DC=ADatum,DC=com”
Set-GPRegistryValue -Name $myGPO -Key $myKey `
-ValueName ‘EnableUpdateHelpDefaultSourcePath’ -Type DWord -Value 1
Set-GPRegistryValue -Name $myGPO -Key $myKey `
-ValueName DefaultSourcePath -Type String -Value $myPath

Leave a Reply

Your email address will not be published. Required fields are marked *