Install Notepad++ with GPO

For a different company I needed to install Notepad++ on some systems.

Created AD group. Created a Share. Give rights to the AD group.
In the ad Group place the computers.

Created GPO and rights to the AD group only.
Added the script in startup scripts in the computer configuration.

@echo off
REM #########################################
REM ##### Created by Daag van der Meer #####
REM ##### Blog.van-daag.nl             #####
REM ##### Filename NPPInstall.cmd      #####
REM #########################################
PING 1.1.1.1 -n 1 -w 900 >NUL

SET LOGLOC=%Systemdrive%\logs


REM ############### Create Log Dir ###################
mkdir %LOGLOC%
attrib +s +h %Systemdrive%\logs
GOTO INSTALL

:INSTALL
REM ######## Check NPP Installed #############
set Logfile=%LOGLOC%\NPPfile.log
if not exist "%Logfile%" (
echo NPP is Installed on %date% at %time% >> %LogFile%
GOTO NPPSTART)

GOTO END

:NPPSTART

if exist "%programfiles%\Notepad++\uninstall.exe" GOTO END

if exist "%programfiles(x86)%\ Notepad++\uninstall.exe" GOTO END

start /wait \\<SERVER>\<SHARE>\npp.7.4.2.Installer.exe /S



:END

 

Export & Import Wireless Network Info on Windows machines

https://community.spiceworks.com/how_to/24989-export-import-wireless-network-info-on-windows-machines

Create a batch file and add it to the GPO.
This Batch file checks if the name exist. If not, WLAN will be created.

@echo off
netsh wlan show profiles | find /i "<Wifi-Name>" 
if errorlevel 1 ( 
netsh wlan add profile filename="\\<DOMAIN>\NETLOGON\<XMLNAME>" user=all
) 

 

Add SSTP VPN connection via Powershell

At the custommer I needed to add SSTP VPN to all the laptops via GPO. But SSTP vpn profile can’t  be created in GPO. So I looked further and found this at Microsoft https://technet.microsoft.com/itpro/powershell/windows/vpnclient/add-vpnconnection

Now I created this powershell script

Add-VpnConnection -Name "<CONNECTION NAME>" -ServerAddress "<SERVER OR PUBLIC IP>" -TunnelType "Sstp" -EncryptionLevel "Required" -AuthenticationMethod MSChapv2 -UseWinlogonCredential -AllUserConnection -RememberCredential -PassThru

Add it to a GPO and the SSTP VPN connection is created.

Install WordPress on raspberry

Login with putty

Go to the directory where you want to install wordpress.

cd /var/recepten.van-daag.nl
sudo chown pi: .
rm *
wget http://wordpress.org/latest.tar.gz
tar xzf latest.tar.gz
mv wordpress/* .
rm -rf wordpress latest.tar.gz

Now login into MySQL and create database and user.

mysql -uroot -p[Password]
create database recepten;

GRANT ALL PRIVILEGES ON `recepten`.* TO `recepten_user`@`localhost` IDENTIFIED BY '[Password]';

Type Ctrl +D to close

Now browse to the website and run the setup.