Category Archives: Powershell, VBS, VBA and other scripting.

connect to online exchange

Lots of places explaining how to do this but in summary you may have to change your execution policy settings ( Set-ExecutionPolicy bypass ) also remember if you have MFA enabled you will need to make an app password or … Continue reading

Posted in Powershell, VBS, VBA and other scripting. | Comments Off on connect to online exchange

creating log files with date and time in their names.

Often want to create a log file from a cmd batch script which is unique for each day for /F “tokens=1-6 delims=/ ” %%A in (‘date /t’) do ( set dt=%%D_%%C_%%B_) for /F “tokens=1-6 delims=: ” %%A in (‘time /t’) … Continue reading

Posted in Powershell, VBS, VBA and other scripting. | Tagged | Comments Off on creating log files with date and time in their names.

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.

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

Customising office interface with XML

By adding an XML file (and related entries) to a word document you can add or remove menu items. This includes the backstage as well as the ribbon interface. The objects in the interface need to be addressed using the … Continue reading

Posted in Powershell, VBS, VBA and other scripting., System Administration | Comments Off on Customising office interface with XML

Scheduling printing to keep a plotter functioning.

Anyone who has a large format inkjet plotter (HP A0 etc…) knows that if they sit idle for a long time the ink will dry up and clog the print heads. This can be an expensive repair so it is … Continue reading

Posted in Powershell, VBS, VBA and other scripting., System Administration | Comments Off on Scheduling printing to keep a plotter functioning.

Get list of Active directory groups and members

$allgroups=get-adgroups $t = foreach ($g in $allgroups) { $m = get-adgroupmember $g foreach ( $me in $m ) { $me | add-member -membertype noteproperty -name “groupname1” -value $g.name -force } $m | select } $t | select *groupname, name | … Continue reading

Posted in Powershell, VBS, VBA and other scripting., System Administration | Comments Off on Get list of Active directory groups and members