Posted On May 22, 2020

How to Enable GPUPDATE When Connected via OpenVPN Client

kimconnect 0 comments
blog.KimConnect.com >> Codes , Networking >> How to Enable GPUPDATE When Connected via OpenVPN Client
// Explanation: to prevent locking of processes, we set a proxy batch file (on_connect.bat) to call gpupdate (gpupdate.bat)
// add this line to the ovpn-File:
up 'C:\\Users\\%USERNAME%\\OpenVPN\\config\\on_connect.bat'

// on_connect.bat:
start .\gpupdate.bat

// gpupdate.bat:
:gpupdate
echo trigger gpupdate ...
c:\windows\system32\gpupdate.exe /force
if errorlevel 0 goto exit
goto gpupdate
:exit

Leave a Reply

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

Related Post

Invoke Commands on Remote Computers [To Install Applications]

$computers=@( 'pc1', 'pc2' ) $commandString="choco install pgadmin4 -y --ignore-checksums" function invokeCommand{ param( $computers, $commandString, $credentials…

Quick 1-Liner to List Domain Controllers and ReadOnly Statuses

PS C:\WINDOWS> Get-ADDomainController -Filter * | select Name,IsReadOnlyName       IsReadOnly----       ----------MONKEY       FalseBABOON       FalseGIRAFFE      FalseLION   FALSEKIMCONNECT   TrueKIMDISCONNECT TrueWHAT        TrueNOWAY        TrueWEBDC01      TrueWEBDC02      TrueSSO01        True

PowerShell: Generate Random Password

Previous version that does not require System.Web assembly: https://blog.kimconnect.com/powershell-randompassword-function/ # This function will quickly generate…