Author Archives: Jeff Turner

About Jeff Turner

Technical director of Nano Tera Network Solutions.

Robocopy Scripts with logging.

Always struggle to remember this so put it here: Point is to create logfile with todays date in the name so we get a new file each day echo on for /F “tokens=1-6 delims=/ ” %%A in (‘date /t’) do … Continue reading

Posted in Hints and Tips, System Administration | Comments Off on Robocopy Scripts with logging.

Azure VMs to improve performance between sites.

Had a problem where the network access from a site in Africa to an Australian (Azure) based web site was very slow. Instead created IPSEC links to a virtual Fortigate appliance in azure which was in a “close” geographic site … Continue reading

Posted in System Administration | Tagged , , | Comments Off on Azure VMs to improve performance between sites.

VMWARE – esx standalone create new machines

Script to copy one VM and create new ones that are “similar” <code> newvm=PV009 cd /vmfs/volumes/p9-storage mkdir $newvm cd $newvm cat ../PV004/PV004.vmx | sed “s/PV004/$newvm/g” | grep -v uuid > $newvm.vmx vmkfstools -d thin -c 128g $newvm.vmdk id=`vim-cmd solo/registervm /vmfs/volumes/p9-storage/$newvm/$newvm.vmx` … Continue reading

Posted in Powershell, VBS, VBA and other scripting., System Administration | Comments Off on VMWARE – esx standalone create new machines

WordPress not allowing FILE links.

To allow you to use FILE:// Links in a wordpress menu you need to add the protocol to the wp_allowed_protocols function in wp_includes/functions.php function wp_allowed_protocols() { static $protocols = array(); if ( empty( $protocols ) ) { $protocols = array( … Continue reading

Posted in Hints and Tips, Powershell, VBS, VBA and other scripting. | Comments Off on WordPress not allowing FILE links.

Windows 10 and VPN connections.

Update coming but a lot of this has been fixed in windows 10 creator update But the other issue where it tries to use the vpn username for all credentials after connecting isnt fixed. no matter which vpn you choose … Continue reading

Posted in Hints and Tips, System Administration | Comments Off on Windows 10 and VPN connections.

Juniper log analysis – get host names from ip addresses.

import os import re from pprint import pprint import socket import M2Crypto import ssl ipsourcetable={} iptargettable={} ipsourcetargetcounttable={} myfilename=”192.168_logs_2017_05/192.168.96.43_log.txt” myfilename=”examine.log” print myfilename myipnames={”: ”} for line in open(myfilename).readlines(): parts=line.split(“,”) mytarget=parts[3] mytargetname=myipnames.get(mytarget,’notfound’) mytargetcert='””,””‘ if mytargetname == ‘notfound’: print ‘looking up ‘ + … Continue reading

Posted in Uncategorized | Comments Off on Juniper log analysis – get host names from ip addresses.

Python script to analyse Juniper firewall logs

Juniper firewalls create large syslog files showing all connections between internal/external hosts. import os import re from pprint import pprint import socket # IP Addresses rip=re.compile(“([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)/([0-9]+)[- ]”) #date time 2017-05-06 23:59:59\t rdt=re.compile(“^([0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]) ([0-9][0-9]:[0-9][0-9]:[0-9][0-9])\t”) # description ?? JuniperSRX1500Perth RT_FLOW: RT_FLOW_SESSION_CLOSE: session … Continue reading

Posted in Uncategorized | Comments Off on Python script to analyse Juniper firewall logs

Powershell mailboxexportrequest creation and management.

To minimise impact on the server do mailboxexportrequests one at a time and move the completed PST files to a final location as each one is created. # csv containing alias for each mailbox $a = import-csv exports.csv foreach ( … Continue reading

Posted in Powershell, VBS, VBA and other scripting., System Administration | Comments Off on Powershell mailboxexportrequest creation and management.

Scheduling a reboot of a server

Store this cmd file script somewhere and schedule it using the system task schedule, it will need to have administrator and “run when user not logged in” rights. The exported XML file from the scheduled task contains this <?xml version=”1.0″ … Continue reading

Posted in Powershell, VBS, VBA and other scripting., System Administration | Comments Off on Scheduling a reboot of a server

Updated powershell exchange reporting

based on sendstats.ps1 , all the various reports as HTML formatted tables. List mailboxes sorted by size List mailboxes sorted by date last accessed. List all email addresses assigned to mailboxes and public folders. List of mailboxes being forwarded to … Continue reading

Posted in Powershell, VBS, VBA and other scripting., System Administration | Comments Off on Updated powershell exchange reporting