Windows Tip of the Week: Find your account password expiration date in an AD environment

Image of laptop with hand holding a skeleton key extending outwards through the display.In many cases your enterprise Active Directory will not involve too many domains, in fact it is quite common for an Active Directory implementation to only include one domain.  In some cases, however, when you have the unfortunate situation of having a username in multliple domains with differing policies on password expiration it is useful to be able to know when your password, or that of another user will expire.  Here is an easy way to accomplish this from the command line.

For the current active user

net user /domain

For a different user

net user /domain _username_here_

Here is an example of the output:

User name                    afore
Full Name                    Andrew Fore
User's comment
Country code                 000 (System Default)
Account active               Yes
Account expires              Never

Password last set            1/29/2015 4:38:37 PM
Password expires             4/29/2015 4:38:37 PM
Password changeable          1/29/2015 4:38:37 PM
Password required            Yes
User may change password     Yes

Workstations allowed         All
Logon script
User profile
Home directory
Last logon                   3/18/2015 3:27:55 PM

Logon hours allowed          All

Local Group Memberships
Global Group memberships     *VMWare Admins        *Domain Users

If you notice there is a lot of useful information regarding the user account here, but of particular interest in my situation was the value of Password expires since I was trying to ensure that I got my password reset prior to the policy setting so that I would not find myself locked out over the weekend that I went on call when the Helpdesk would be closed.

Solaris Tip of the Week: a better du experience

Graphic showing several nested command line terminal application windows.In my day job as a Systems Engineer I frequently find myself switching between different UNIX and Linux distributions.  While many of the commands exist on both sides of the aisle, I often find vast differences in the command line parameters that can be consumed by a given command when used in, for example, Linux vs Solaris.

Recently I came upon this again with the need to easily ferret out the majority consumer of drive space on a Solaris 10 system.  While we did have the xpg4 specification support available, the du command was still missing my favorite option “max-depth”.

In Linux I use this to limit the output to only the current directory level so that I don’t have to face to possibility of wading through a tremendously large listing of sub-directories to find the largest directory in the level I am in.  Unfortunately, in Solaris, even with xpg4, the du command doesn’t have this option, so my solution was to pipe the results through egrep and use that to filter out the sub-directories.

Here is some example output from a RedHat Linux 5.11 server:

[root@atl4cmweb01 var]# du -h
8.0K    ./games
8.0K    ./run/saslauthd
8.0K    ./run/lvm
8.0K    ./run/setrans
8.0K    ./run/ppp
8.0K    ./run/snmpd
4.0K    ./run/mysqld
8.0K    ./run/pm
8.0K    ./run/dbus
8.0K    ./run/nscd
8.0K    ./run/console
8.0K    ./run/sudo
8.0K    ./run/netreport
176K    ./run
8.0K    ./yp/binding
24K     ./yp
8.0K    ./lib/games
8.0K    ./lib/mysql
4.0K    ./lib/nfs/statd/sm.bak
8.0K    ./lib/nfs/statd/sm
24K     ./lib/nfs/statd
8.0K    ./lib/nfs/v4recovery
0       ./lib/nfs/rpc_pipefs/statd
0       ./lib/nfs/rpc_pipefs/portmap
0       ./lib/nfs/rpc_pipefs/nfs/clntf
0       ./lib/nfs/rpc_pipefs/nfs/clnt5
0       ./lib/nfs/rpc_pipefs/nfs/clnt0
0       ./lib/nfs/rpc_pipefs/nfs
0       ./lib/nfs/rpc_pipefs/mount
0       ./lib/nfs/rpc_pipefs/lockd
0       ./lib/nfs/rpc_pipefs
40K     ./lib/nfs
8.0K    ./lib/dhclient
8.0K    ./lib/iscsi/isns

Here is the same example ouput from the RedHat server using the max-depth option:

[root@atl4cmweb01 var]# du -h --max-depth=1
8.0K    ./games
176K    ./run
24K     ./yp
22M     ./lib
32K     ./empty
1.5G    ./log
12K     ./account
236K    ./opt
24K     ./db
8.0K    ./nis
2.9M    ./tmp
8.0K    ./tmp-webmanagement
40K     ./lock
8.0K    ./preserve
8.0K    ./racoon
16K     ./lost+found
1.4M    ./spool
8.0K    ./net-snmp
83M     ./cache
8.0K    ./local
1.6G    .

Here is the command example run without my egrep mod in Solaris 10:

[root@atl4sfsbatchb log]# /usr/xpg4/bin/du -h
  25K ./webconsole/console
  26K ./webconsole
   1K ./pool
   1K ./swupas
   2K ./ilomconfig
   1K ./current/ras1_sfsuperbatchb
   1K ./current/od1_atl4sfsuperbatchb
 4.3G ./current/ras1_atl4sfsbatchb
 2.1G ./current/od1_atl4sfsbatchb
 560K ./current/avs
   2K ./current/ebaps/output
 9.3M ./current/ebaps
 4.0M ./current/psh
 3.1M ./current/autoresponder
   5K ./current/fdms_download
  29K ./current/fdms_server
 109K ./current/fmt
   5K ./current/paris/output
 653K ./current/paris
   1K ./current/od1_sfsuperbatchb
  28K ./current/ccTemplateLoader
 633K ./current/ccTemplateLoaderLegacy
  15M ./current/whinvoices
   1K ./current/
 132M ./current/chase
 6.6G ./current
 160K ./archive/ccTemplateLoader
   1K ./archive/od1_atl4sfsuperbatchb
 4.9M ./archive/avs
   1K ./archive/ebaps/output
  26M ./archive/ebaps
 881M ./archive/psh
1014M ./archive/autoresponder
   1K ./archive/fdms_download
 6.8M ./archive/fdms_server
  21M ./archive/paris
   1K ./archive/ccTemplateLoaderLegacy
 4.1G ./archive/ras1_atl4sfsbatchb
 3.1G ./archive/od1_atl4sfsbatchb
 5.9G ./archive/chase
 102M ./archive/whinvoices
  15G ./archive
  22G .

And here is the improved command output using my egrep mod on the same Solaris server:

[root@atl4sfsbatchb log]# /usr/xpg4/bin/du -hx | egrep -v '.*/.*/.*'
  26K ./webconsole
   1K ./pool
   1K ./swupas
   2K ./ilomconfig
 6.6G ./current
  15G ./archive
  22G .

Desktop Google Chrome Reader Mode

If you are a Safari user then you are likely used to the “reader mode” which disables all the extra graphical stuff and focuses the view on the content of the article.  Thanks to a tip from Google Plus user Francois Beaufort, here’s how to enable it on the desktop (in Windows at the very least, I haven’t tried in any other OS).

If you’re on desktop, playing with it is as easy as running chrome with the –enable-dom-distiller switch. Once it’s done, you’ll notice a new “Distill page” menu item.

Hopefully this will make it to mainstream with a nice icon.

Creating a firewalld service for Plex Media Server

plex_firewalldI recently rebuilt my Plex Media Server box as a CentOS 7 VM running on Hyper-V on a Windows Server 2012 setup.

When I installed the rpm and started the service I found that I was unable to load the interface on my desktop. I knew that it was running because I installed netstat and I was able to see the port was open for traffic and I was also able to load the interface locally in lynx on the server. Continue reading “Creating a firewalld service for Plex Media Server”

Starting anew in 2015 – a resolution

As the new year broke upon us just over two weeks ago, I found myself wondering what resolutions I should make to improve myself during the next twelve months.  In the past I have made resolutions about inconsequential things like reading more books or taking more photos.  I even tried to participate in a photo a day and managed to make it through two months before giving up. Continue reading “Starting anew in 2015 – a resolution”