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

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 to connect to from the task bar you have to choose it again from the windows 10 list of vpn connections.

I also find I have to pick another one and then repick the one I want to get the Connect or Disconnect options.

However this cmd file will log in and create the connection by just running it from a command prompt, it saves the username and password which could be a bit of a security issue.

this one should disconnect it

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

Juniper log analysis – get host names from ip addresses.

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.

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.

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

the cmd file that logs and performs the actual reboot contains this

 

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 other addresses.

List of rights to access of mailboxes

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

WBAdmin – deleting old backups from the catalogue

Cleaning up the windows server backup catalogue database (server 2012r2).

To get a list of backups

wbadmin get versions

pipe that text to a file and then to get all the backups

findstr “identifier”

Put all of that into a CMD file and then replace

“Version identifier: ”

with

“type y.txt | wbadmin delete backup -version:”

the text file y.txt needs to have two lines with just Y on them. Run that command and it will empty the catalogue.

If you just wanted to remove a particular backup device from the list would have to identify it by the guid in the Backup Target line from the versions list.

Once you have the disk id try.

“wbadmin delete backup -backupTarget:”

Posted in System Administration, Uncategorized | Comments Off on WBAdmin – deleting old backups from the catalogue

Exchange server 2007, log file sector size mismatch.

Moving between virtual VHD type disks (old hyperv server ver 6.1.7601) to VHDX formt (hyperv 2012r2 server version 6.3.9600).

Disaster recovery practice session.

After moving an old hyperv server to a new host and restoring Exchange 2007 backup into the VHDX type disk the stores refuse to mount.

Information store doesn’t mount and if you try and mount it using the exchange server console it shows error code: mapiexceptioncallfailed unable to mount database (hr=0x80004005,ec=-550)

server2007-vhd-vhdx-error1

Application event log Event id: 412 source ESE unable to read the header of logfile E00.log Error -546

server2007-vhd-vhdx-error5

Application event log Event id: 9518 from MSExchangeIS

Error 0xfffffdde starting Storage Group /…./ Exchange/CN=…/ on the Microsoft Exchange Information Store. Storage Group – Initialization of Jet failed.

server2007-vhd-vhdx-error6

Application event log shows event id: 9519 from the MSExchangeIS source, Error Database is in inconsistent state starting database “First Storage Group\Mailbox Database” on the Microsoft Exchange Information Store.

server2007-vhd-vhdx-error7

Trying the microsoft exchange server diagnostic tool eseutil gives some more information.

eseutil.exe /r E00

server2007-vhd-vhdx-error3
Which should commit the log files beginning with E00 the database returns “Operation terminated with error -546 (JET_errLogSectorSizeMismatch, the log file sector size does not match the current volume’s sector size)”

Checking the disks doesnt seem to show any difference, at least using the fsutil tool included with Server2008.

fsutil fsinfo ntfsinfo
server2007-vhd-vhdx-error4

Windows 2008 (ver 6.0.6002) shows the same number of Bytes per Sector and Bytes per Cluster for both “machines” (on Hyperv server 2008 with VHD format disks and on Server 2012r2 with VHDX format disks) and doesn’t include the “bytes per physical sector” information in the output.

Using Windows Server 2008r2 (ver 6.1.7601) the fsutil.exe program shows the extra information.

This is a VHD (old format) under server 2008r2,
bytes_per_physical_sector_vhdx

with Bytes per Physical Sector showing 512

this is a VHDX format disk (same size) showing Bytes per Physical Sector 4096

bytes_per_physical_sector_vhd

Exchange seems to be using this Bytes per Physical Sector value and refuses to let the exchange stores mount as the log files were created with a different size. More correctly it refuses to use the log files restored with the backup because the size recorded in the log check files is different to that on the new server.

To move the files accross the best tactic might be to dismount (shutdown information store) and make sure all logs are committed and then switch from VHD to VHDX drive, and then restart services. If they were in clean shutdown we would be able to delete the log files and it will create new log and chk files with the new correct sector size. Using the Exchange console to Move the database, log and system files seems to work OK and it “fixes” the size of the sectors in the log files to match the physical size.

Posted in System Administration | Comments Off on Exchange server 2007, log file sector size mismatch.

Server 2008 restore from backup

After doing a full system state restore from backup you “may” find that the server will boot and then blue screen.

Pressing F8 and setting to not reboot after the blue screen will let you see if it is error C00002E2 Directory Services Could Not Start. And you need to get into directory services maintenance mode.

To do that press F8 and select it (or choose it from the boot menu if you have enabled it previously).

Once you are in DSM you will need to see what is wrong, following the instructions from this article http://itswapshop.com/tutorial/how-fix-c00002e2-directory-services-could-not-start-blue-screen may fix it. Deleting the log files seems to work, but why the backup/restore leaves it in this state is anyones guess.

Posted in System Administration | Comments Off on Server 2008 restore from backup