Its important to have a backup copy of your password vault. An easy and robust solution is to use the Windows Task Scheduler program to schedule a regular backup.
To start, create a folder to hold the script and the backup. For example C:\Temp\Backup\.
Next, create and test a command that copies your keepass file to the backup location EG: “XCOPY C:\Users\88776655\Downloads\Database.kdbx C:\Temp\Backup\ /Y” and save it in a text document within the backup folder. EG: “C:\Temp\Backup\BackupKeePass”.
Change the properties of the “Backup” folder so you can see the file extensions IE: BackupKeePass.txt” …
Then change the extension from txt to bat and test it works (right-click, open).
- Start up the Task Scheduler by typing it into the Windows search bar.
- Right-click on “Task Scheduler Library” and create a new folder “My Tasks”.
- Right-click on “My Tasks” and choose “Create Task”. Give it a name like “Backup KeePass” and click the radio-button “Run whether a user is logged in or not”
- On the Triggers tab, schedule it or set it to run every log on.
- On the Actions tab create a new action to start a program and browse to the bat file.
- On the Settings tab, select “Stop task if runs longer than 1 Hour”, and click OK.
To test make a change in KeePass and save it. The reboot , login and examine the date the backup was created.
Here is a handy command to run in a Windows command prompt. I use it for housekeeping space issues.
DIR /O-S /A-D /S >> DirBySize.txt
Which lists all the files on a drive – with the biggest first.
I wanted to find out who made a change on a server – on a known day at a known time. Looking through event-viewer on the server all I could find was an irrelevent “TerminalServices-Printers” error. However within this error – by clicking the Details tab and expanding the ‘system’ paragraph I saw a USERID, which was a long string of numbers and dashes.
To resolve this userid I opened regedit and expanded HKEY_USERS. I located the userID in question and right-clicked it. Examininmg the ‘permissions’ configuration the username was listed.
The reason for error 1909 was because it’s access token had expired (an Active Directory replication problem).
The workaround was …
net use \somebackupserversomebackupshare /user:domainsqlagentloginaccount
I cobbled together this script which sits on my desktop called ‘ssms.vbs’. The disadvantage is you need to hard-code your password into the script and keep it upto date.
set WshShell = WScript.CreateObject("WScript.Shell")
'build runas command
WshShell.run "runas /user:DOMAINUSERNAME %comspec%"
WshShell.SendKeys "PASSWORD" 'send password
WshShell.SendKeys Chr(34) + "C:Program FilesMicrosoft SQL Server100ToolsBinnVSShellCommon7IDEssms.exe" + Chr(34)
'Close command prompt
set wshshell = nothing
When was the last time this Windows 2003 server was rebooted?
Simple … start/run/eventvwr/system/view/filter/event-id=6005.