Thursday, September 07, 2006

AD last login time

Nice script to find a user's last logon time from AD. It even converts the time result to human readable format.

' This VBScript code prints the last logon timestamp for a user.
' ---------------------------------------------------------------
' From the book "Active Directory Cookbook" by Robbie Allen
' Publisher: O'Reilly and Associates
' ISBN: 0-596-00466-4
' Book web site: http://rallenhome.com/books/adcookbook/code.html
' ---------------------------------------------------------------
' ------ SCRIPT CONFIGURATION ------
'strUserDN = "" ' e.g. cn=rallen,ou=Sales,dc=rallencorp,dc=com
strUserDN = "cn=Web Maxtor,ou=MyOffice,ou=MyOrganization,dc=MyDomain,dc=com"
' ------ END CONFIGURATION ---------
set objUser = GetObject("LDAP://" & strUserDN)
set objLogon = objUser.Get("lastLogonTimestamp")
intLogonTime = objLogon.HighPart * (2^32) + objLogon.LowPart
intLogonTime = intLogonTime / (60 * 10000000)
intLogonTime = intLogonTime / 1440
WScript.Echo "Approx last logon timestamp: " & intLogonTime + #1/1/1601#

Monday, September 04, 2006

PIX 501 install the easy way

Having found an old NFR PIX 501 from a previous employer in my basement, I decided the WPA-PSK encrypted WLAN I had based out of my home office just wasn't secure enough to hide my daughter's Barbie video games and my surfing history from the rest of the world. Of course I could spend $50.00 on a Linksys jobby running WPA2-AES, but that costs $50.00. I was going to make my measely little Netgear WGR614 responsible for my new DMZ, serving my work laptop on my couch. Everything else would sit behind the PIX, behind the Netgear.

Cisco was kind enough to include a browser based GUI in their PIX 501 firewalls, and you can typically reach it at https://192.168.1.1. I figured it would be helpful for a quick config, given my few demands. Wrong. Stay away.

Here's the network:

Cable based ISP DHCPing me one address ---> Netgear WGR614 at 10.10.10.1 broadcasting "SuperCrapNet" on b/g channel 1 ---> PIX501 at 10.10.10.2 (outside) and 192.168.1.1 (inside) ---> Me.

Here's my major changes via console, coutesy of Cisco.com with my site specific additions and changes:

!--- Enable error and more severe syslog messages
!--- to be saved to the local buffer.


logging buffered errors

!--- Send syslog messages to a syslog server
!--- on the inside interface if you want.


logging host inside 192.168.1.220

!--- define the interface addresses

ip address outside 10.10.10.2 255.255.255.0
ip address inside 192.168.1.1 255.255.255.0

!--- Using Pix version 5.2 or higher allows for a single
!--- outside IP address to be used the PIX and for PAT


global (outside) 1 interface

!--- If USING OLDER SOFTWARE:
!--- Define a Network Address Translation (NAT) pool that
!--- internal hosts use when going out to the Internet.

global (outside) 1 10.10.10.3-10.10.10.9
!--- Define a Port Address Translation (PAT) address that
!--- is used once the NAT pool is exhausted.

global (outside) 1 10.10.10.10
!--- END IF

!--- Allow all internal hosts to use
!--- the NAT or PAT addresses specified above.


nat (inside) 1 0.0.0.0 0.0.0.0 0 0

!--- Apply access list 100 to the outside interface.

access-group 100 in interface outside

!--- Define a default route to the ISP's router,
!--- or in my case, the next router in line


route outside 0.0.0.0 0.0.0.0 10.10.10.1 1

!--- Allow the hosts on the 192.168.1.0 network
!--- to be able to Telnet to the inside of the PIX.


telnet 192.168.1.0 255.255.255.0 inside

!--- Setup DHCP DNS entry since outside interface is static

dhcpd dns 10.10.10.1

!--- Write configuration to the terminal for review

write term

!--- write to memory

write mem

Friday, August 04, 2006

Veritas BackUp Exec Cancel Pending

I have often attempted to cancel backups at various stages and found them to hang in the "cancel pending" state forever. A server reboot tends to put things in order, but is a fairly inconvenient solution. Stopping the services from the Windows Administrative Tools | Services snap-in tends to hang the services in the stopping state as well.

The easy but usually overlooked method is choosing Tools | BackUp Exec Services from within the Backup Exec console. You can stop and restart them all fairly effectively from there.

Stopping may take several minutes, but is ultimately successful.

Tuesday, June 13, 2006

WatchGuard Firebox V60L

The default IP address of interface 0 is 10.0.0.1/24.

The default username / password is admin / admin.

The console port uses a Cisco cable at 9600,8,N,1 and no flow control, and if you are Cisco IOS literate, basic interface configuration is relatively intuitive.

Saturday, April 15, 2006

Broadcast Fax from a desktop PC

Requirements:
Microsoft XP
Microsoft Outlook 2000 / XP /2003
a modem

Step 1:
Install the XP fax service. Go to Start | Control Panel | Add / Remove Programs | Add / Remove Windows Components | Fax.

Step 2:
Add the Fax Transport service in Outlook. In Outlook, go to Tools | E-Mail Accounts | Add a new email account | Additional Server Types | Fax Mail Transport.

Step 3:
Try it. Add two new contacts in Outlook with business fax numbers. Create a distribution group and add the two contacts Notice you will be given the option to add the contact with an email address, and the same contact with a fax number. In this case, add the contact with the fax number. Address a new email message to the group with a blank subject and body, but attach a Word document. Choose to send.

You will find the Fax Console (after it's configured) dial and deliver the Word document as a fax to both recipients.

Nice.