Skip to content

Instantly share code, notes, and snippets.

@jhamilton09
Created June 13, 2016 21:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jhamilton09/58fda5b893daea3dce5570603887054c to your computer and use it in GitHub Desktop.
Save jhamilton09/58fda5b893daea3dce5570603887054c to your computer and use it in GitHub Desktop.
Update Sophos policies at startup
<#
Name of the script: SophosPolicyUpdate
Author of the script: Jason Hamilton
Version of the script: 0.1
Where you got the idea: Needed to force VDI clients to check for new policy information from Sophos
Version of PowerShell required: 3.0
If Elevated permissions required: Yes, assigned as Startup script, so runs as SYSTEM
If specific modules are required: No
Comments about new types of constructions: N/A
Comments about specific cmdlets: N/A
Ideas for future improvement: Verify service is started, verify policy is updated?
Known errors: None
#>
Stop-Service -Name 'Sophos Agent'
# "\ProgramData\Sophos\Remote Management System\3\Agent\AdapterStorage \
$pd = "$env:ProgramData"+"\Sophos\Remote Management System\3\Agent\AdapterStorage\"
Remove-Item $pd -Recurse
Start-Service -Name 'Sophos Agent'
#To see current service status
#Get-Service -Name 'Sophos Agent'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment