Thursday, February 21, 2013

Deploying OpenVPN

Problem: When deploying OpenVPN I can use the /S switch to silence the installer but Windows will prompt to trust the driver manufacturer when it attempts to install the TAP interface. I can use a third party tool to turn off Windows drivers signing, or just do the right way.

Solution: Add the OpenVPN certificate to Trusted Publishers before installing OpenVPN.

Install OpenVPN on your test box . When prompted check the box for "Always trust content from this publisher"
Start the Certificate Manager snap-in and export the "OpenVPN Technologies Inc." certificate. I used the .cer format.
Use certutil to install the .cer prior to installing OpenVPN.
certutil -addstore TrustedPublisher openvpn.cer
openvpn-*.*.*.exe /S


Wednesday, February 20, 2013

Allowing Non-Admin users to add printers OS X clients

Problem: I need to allow non-administrator users add printers to Mac OS X.


Add the GeneratedUID from the everyone group (ABCDEFAB-CDEF-ABCD-EFAB-CDEF0000000C) to the NestedGroups attribute of the _lpadmin group.

dscl . -append /Groups/_lpadmin NestedGroups ABCDEFAB-CDEF-ABCD-EFAB-CDEF0000000C 

Set Windows Compatibility Mode from the Command Line

Problem: I need to set an executable to compatibility mode to Windows XP SP3.

reg.exe Add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" /v "C:\Path\To\Executable.exe" /d "WINXPSP3" /f

Allow Non-Administrator Users Add Printer Drivers Windows 7

Problem: I need to Allow non-Administrator users to add print drivers to Windows 7.
Many of the workstations I administrate are located in remote location and end-users or site technicians from other organizations need to install local or network printers on the workstations.


1. Install Administrative Templates (ADMX) for Windows Server 2008.
1. Apply this registry edit:

Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers\PointAndPrint]


Shell Script Find Windows Version and Architecture

Problem: I need to find a script to find version and processor architecture windows in a windows shell script.


Batch/CMD Script
:; Find Windows Version and ArchitectureFOR /F "tokens=*" %%i in ('VER') do SET WinVer=%%i FOR /F "tokens=1-3 delims=]-" %%A IN ("%WinVer%" ) DO ( SET VarString=%%A )
FOR /F "tokens=1-9 delims=n" %%A IN ("%VarString%" ) DO ( SET WinVer=%%C)
FOR /F "tokens=1-8 delims=.- " %%A IN ("%WinVer%" ) DO (SET WinMajor=%%ASET WinMinor=%%B)
:; Set version+archicitecher string. 5.1.x86 is Windows XP x86, 6.1.x86 is Windows 7 x86, & 6.1.AMD64 is Windows 7 x64SET VerArch=%WinMajor%.%WinMinor%.%processor_architecture% 
# Find processor architecture and Windows version$processorArchitecture = (Get-ItemProperty 'HKLM:\SYSTEM\ControlSet001\Control\Session Manager\Environment').PROCESSOR_ARCHITECTURE$windowsVersion = (Get-WmiObject Win32_OperatingSystem).Version | %{$data = $_.split("."); Write-Output "$($data[0]).$($data[1])"}

Tuesday, February 19, 2013

Deploying Adobe Flash 11 Windows 7 64 bit

I kept getting an error when deploying Adobe Flash 11.X to my Windows 7 64 bit workstations.
The error "This file does not have a program associated with it for performing this action. ..." Would pop up at the end of the installation and would cause the deployment task to hang until someone click "OK".

Solution/Deployment Task:
Set compatibility to Windows XP SP3 before installing.

1. Download standalone executables from Adobe.

2. Check if browsers are running.
REM Check if browser is running Exit 1
tasklist|find /i "iexplore.exe"
tasklist|find /i "firefox.exe"
tasklist|find /i "chrome.exe"
tasklist|find /i "Safari.exe"
3. Copy install_flash_player_11_plugin.exe, and install_flash_player_11_active_x.exe executables to "C:\Windows\Temp\".

4. Set compatibility to Windows XP SP3 for the executables.
REM Set compatibility install_flash_player_11_plugin.exe
reg.exe Add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" /v "C:\Windows\Temp\install_flash_player_11_plugin.exe" /d "WINXPSP3" /f
REM Set compatibility install_flash_player_11_active_x.exe
reg.exe Add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" /v "C:\Windows\Temp\install_flash_player_11_active_x.exe" /d "WINXPSP3" /f
5. Execute the installation.
REM Install install_flash_player_11_plugin.exe
C:\windows\temp\install_flash_player_11_plugin.exe /install
REM Install install_flash_player_11_active_x.exe
C:\Windows\Temp\install_flash_player_11_active_x.exe /install
6. Take out the trash.
REM Delete install_flash_player_11_plugin.exe
DEL "C:\windows\temp\install_flash_player_11_plugin.exe"
REM Delete install_flash_player_11_active_x.exe
DEL "C:\Windows\Temp\install_flash_player_11_active_x.exe"

Thursday, December 17, 2009

Gmail as default mail client via Registry Edit

Problem: I need to set Gmail as the default mail client on a windows system without installing a third-party Program.

The fallowing Regestry changes:
Windows Registry Editor Version 5.00 
;Use icon C:\Windows\Web\icons\mail.ico via 
; Setup Gmail mailto client. 
[HKEY_CLASSES_ROOT\Gmail.Url.Mailto]@="URL:Mail Protocol""FriendlyTypeName"="Gmail URL""URL Protocol"=""
[HKEY_CLASSES_ROOT\Gmail.Url.Mailto\shell\open\command]@="rundll32.exe url.dll,FileProtocolHandler" 
; Set Gmail as the default mailto client for the system. 
[HKEY_CLASSES_ROOT\mailto]"URL Protocol"=""
[HKEY_CLASSES_ROOT\mailto\shell\open\command]@="rundll32.exe url.dll,FileProtocolHandler" 
; Set Gmail as the default mail client for the current user. 
; Set Gmail as the default mail client for the system.
; Add Gmail to your mail client list. 
[HKEY_LOCAL_MACHINE\SOFTWARE\Clients\Mail\Gmail\Protocols\mailto]"URL Protocol"=""
[HKEY_LOCAL_MACHINE\SOFTWARE\Clients\Mail\Gmail\Protocols\mailto\shell\open\command]@="rundll32.exe url.dll,FileProtocolHandler"
[HKEY_LOCAL_MACHINE\SOFTWARE\Clients\Mail\Gmail\shell\open\command]@="rundll32.exe url.dll,FileProtocolHandler" 
;Add Gmail to your default programs list