There used to be an auto logoff screensaver (winExit.scr) in the Windows 2000/2003 resource kit, although it doesn’t appear to play too well with Windows 7/Vista. I needed the functionality that this provided for the systems in our meeting rooms, as people have a habit of leaving the systems logged on in there then leaving the room!
As I couldn’t find anything (for free!) that did this, I thought it was time for a bit of D.I.Y! So here we have my AutoLogoff Screensaver for Windows 7/Vista. Dead simple, drop in your C:\Windows\System32 folder, then probably use group policy to force it onto certain machines, or the local policy with gpedit.msc! Dims the screen like a UAC prompt in order to try and get the users attention a bit more, there’s no configurable options at the moment, just 60 seconds warning until logoff. If I get alot of requests I might add some additional funtionality, but it’s serving my requirements now, so I’m happy ;)
Update 06/09/10: I’ve now added the ability to change the amount of time the warning lasts for, you can either leave as the default 60 sec, or create a reg key in HKLM to set your own – see readme file for key name!
Update 03/12/10: Added the force option for the logoff as per requests!
Update 26/05/11: Fixed a rather major bug – the logoff button didn’t work! Also made the escape key cancel the screensaver/countdown.
Download – AutoLogoff_v2.3.zip (146KB)
Posted in Apps, OS, Tools
Need to accuracy find out when the OS was installed on a Windows system? Try the following command:
> WMIC OS GET InstallDate
Should return you a date in the following format: 20100202101833.000000+000
Posted in Uncategorized
The default forms based login for OWA (Outlook Web Access) on Exchange 2010 requires users to login with the username in ‘DOMAIN\Username’ format. Show stopper for most of our users – they just type thier username on its own every morning, and won’t read the instructions. If you’re running in a single domain, you can set the default domain using the Exchange Management Console.
Navigate to ‘Server Configuration’ > ‘Client Access’, select your client access server, then the OWA tab below, right click on your OWA entry then view the properties. In the authentication tab of this window, you can select the logon format… Select username only, specify your domain, click ok – you’ll need to restart IIS for the change to come into operation.
Or you can do it even more quickly with the Exchange PowerShell:
Set-owavirtualdirectory -identity “owa (default web site)” -Sign-inFormat UserName -DefaultDomain “Home.local”
Posted in Apps, Tips
Super quick way to move DHCP onto a new server…
On the old server:
netsh dhcp server export \\server\share\dhcpConfig.dat all
net stop “dhcp server”
sc config dhcpserver start=disabled
On the new server:
Install DHCP role
netsh dhcp server import \\server\share\dhcpConfig.dat all
net stop “dhcp server”
net start “dhcp server”
Goto DHCP management tool on the new server and double check the new server is authorised, right click and authorise if it isn’t! Also, don’t forget to properly uninstall the old DHCP server service using add remove windows components, so that it cleans up active directory and it doesn’t remain as an authorised server when the box is fully decomissioned!
Posted in Networking, OS
Prerequisites for this upgrade/migration are that the SBS 2003 server must be at SP2, with Exchange 2003 also at SP2. In addition to this both your domain functional level AND forest functional level must be running at 2003 native (This is the highest available on SBS 2003 SP2). Finally, your Exchange organisation must be running in 2003 native mode. Read the rest of this entry »
Posted in Networking, OS
While trying to deploy the WPKG client onto newly built systems, I kept encountering the following error:
“There is a problem with
this Windows Installer Package. A program run as part of the setup did
not finish as expected. Contagt your support personnel or package
vendor.”
I was trying to install using the MSI with a specified settings.xml file using the following command:
msiexec /qb! /i wpkgclient1-3-6.msi SETTINGSFILE=\\server\wpkg\settings.xml
Looking at the windows installer logs, it appeared that the problem was with the settings file, after checking it was valid XML, I found out that if full paths with drive letters were specified (Z:\settings.xml) it installed fine!
Odd.
Posted in Uncategorized
When using Windows SIM (System Image Manager), which is part of the Windows AIK (Automated Installation Kit) you might run inthe the the following error when you try and load a .WIM image…
“Windows sim was unable to generate a catalog”
Chances are that you are trying to open a .WIM image from the $RemoteInstall share. In this folder structure the WIM’s are slightly different as they incorporate metadata and a .RWM that contains the image data. The easy way around this is to fire up the Windows Deployment Services MMC, then find the image, right click and export to somewhere else. You should then be able to create a catalog using the newly exported .WIM.
Posted in Tips, Uncategorized
I have been looking at getting a script together for a while to mass change some shortcuts we have on our file server to point to a different location. After some research, and some playing around I found a really easy way to do this in Powershell:
# Call wscript com object
$shell = new-object -com wscript.shell
# Recurse through directories for .lnk files
dir "I:\" -filter *.lnk -recurse | foreach {
$lnk = $shell.createShortcut($_.fullname)
$oldPath= $lnk.targetPath
# If match text, perform operation
if($oldpath -match "\\serverold\share1")
{
write-host "Match: " + $_.fullname
remove-item $_.fullname
$lnknew = $shell.createShortcut($_.fullname)
$lnknew.targetPath = "`"\\newserver\share1`""
$lnknew.IconLocation = "%SystemRoot%\system32\SHELL32.dll,4"
$lnknew.Save()
}
}
Write-Host "End..."
Posted in Programming, Scripting
I came accross some directories today on our NAS that couldn’t be deleted – I really needed to get rid of them as they were causing backups to fail! Every time I tried to delete, I got the following windows error:
“cannot delete file: cannot read from source or disk”
The solution to this, was to fire up a command prompt, and locate the directory in question (Map a network drive if it’s a UNC path!), then run:
dir /x /a
This should give you the directory name, along with its shortname (e.g. AEU8P3~P). You can then either delete the folder (rd /?) or rename it (ren /?) by using the shortname!
Posted in Uncategorized
If you want to setup a Windows SVN server, it’s easy as pie! I set one up for the company I work for as the Linux SVN Server was getting too difficult to manage. I would highly recommend using the free version of VisualSVN server for Windows for your code repository: VisualSVN Server.
It’s a ~4MB msi installer, and it’s a doddle to add new repositories and manage them. There is also an Enterprise version of the software should you need any extra features but we have found that the free one does everything we need and more.
Once you have installed the VisualSVN Server, download and install Tortoise SVN onto your computer: Tortoise Download.
You can then use Tortoise to update and commit code to your repository!
Posted in Uncategorized