Found a nice little script which will check a system and report drive space. In case the original link disappears; here it is. Option Explicit const strComputer = "." const strReport = "c:\diskspace.txt" Dim objWMIService, objItem, colItems Dim strDriveType, strDiskSize, txt Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2") Set colItems = objWMIService.ExecQuery("Select * from Win32_LogicalDisk _ WHERE DriveType=3") txt = "Drive" & vbtab & "Size" & vbtab & "Used" & vbtab & "Free" _ & vbtab & "Free(%)" & vbcrlf For Each objItem in colItems DIM pctFreeSpace,strFreeSpace,strusedSpace pctFreeSpace = INT((objItem.FreeSpace / objItem.Size) * 1000)/10 strDiskSize = Int(objItem.Size /1073741824) & "Gb" strFreeSpace = Int(objItem.FreeSpace /1073741824) & "Gb" strUsedSpace = Int((objItem.Size-objItem.FreeSpace)/1073741824) & "Gb" txt = txt & objItem.Name & vbtab & strDiskSize & vbtab & strUsedSpace _ & vbTab & strFreeSpace & vbtab & pctFreeSpace & vbcrlf Next writeTextFile txt, strReport wscript.echo "Report written to " & strReport & vbcrlf & vbcrlf & txt ' Procedure to write output to a text file private sub writeTextFile(byval txt,byval strTextFilePath) Dim objFSO,objTextFile set objFSO = createobject("Scripting.FileSystemObject") set objTextFile = objFSO.CreateTextFile(strTextFilePath) objTextFile.Write(txt) objTextFile.Close SET objTextFile = nothing end sub
vbscript diskspace report
Sunday, November 25th, 2012Where is cleanmgr for server 2008 R2
Saturday, November 24th, 2012I had a case of a drive filling up with nothing significant to delete and of course everybody needed everything. I decided to run disk cleanup to see if I could at least compress old files.
I entered: cleanmgr
I was rewarded with a file not found message.
It turns out the Desktop Cleanup utility is not a default install with 2008. There are two ways you can install it.
The first would be to install the Desktop Experience feature which adds other missing desktop features. The problem with this approach is the system will need a reboot to finish the install.
The second would be to simply copy a couple files to appropriate locations.
Look in the winsxs folder for the following:
C:\Windows\winsxs\amd64_microsoft-windows-cleanmgr_31bf3856ad364e35_6.1.7600.16385_none_c9392808773cd7da\cleanmgr.exe
C:\Windows\winsxs\amd64_microsoft-windows-cleanmgr.resources_31bf3856ad364e35_6.1.7600.16385_en-us_b9cb6194b257cc63\cleanmgr.exe.mui
Simply copy:
Cleanmgr.exe to %systemroot%\System32
Cleanmgr.exe.mui to %systemroot%\System32\en-US
Now cleanmgr will function as expected.
This technote helped with the second option.
New Black Hole Exploit kit
Monday, November 19th, 2012A security person on one of my lists posted this link. Rather heavy stuff but interesting if you want to learn this topic.
This is a worthwhile link to add to your collection: malware.dontneedcoffee.com
Citrix session screen flicker
Monday, November 19th, 2012I had a user complain about screen flicker while trying to use tools on a server via remote desktop. The server in question was 32 bit windows 2003 running citrix presentation server 4.5. This was not wide spread so only the one server was having issues.
Searching the Net I found a technote at Microsoft which seem to address this issue.
I downloaded the hotfix, installed it and rebooted the server and the problem was solved.
Visual Studio slow with network shares
Sunday, September 16th, 2012I saw an email exchange about issues surrounding visual studio 2010 and using network shares for work. Previously, there wasn’t an issue with 2005. Microsoft was contacted and they basically said it’s a “feature.”
I did some searching on the Net and found an interesting discussion on a similar problem. As it’s explained; Microsoft .NET framework is not fully trusted but you can modify it. One person explained he followed the directions from another post.
It’s an interesting approach and it kind of makes sense depending how often visual studio does security checks.
In my situation, I passed on this information but the users thought it would not address their problem. Even if it doesn’t; this was interesting to read so I will keep it for future reference.
DsGetSiteName failed: Status = 1919 0x77f ERROR_NO_SITENAME
Sunday, September 16th, 2012A user reported this error when he attempted to check the site name on a terminal server via the command: nltest /dsgetsite
A rather odd error as it usually appears on domain controllers and exchange servers. DNS was in order and there wasn’t an obvious error in the logs.
I checked which logon server was handling authentication for the terminal server via echo %LOGONSERVER% and found domain controllers in other countries were handling the authentication. I checked a couple other windows boxes and found the same errors.
This suggested the subnet for Active Directory was not configured or had a typo. I was not able to immediately verify this as AD is controlled by another group. I opened a trouble ticket and will wait for an answer.
I needed to solve the problem for the users who spotted this error. I found a registry entry would handle this issue.
From regedit; drill down the following:
HKLM\System\CurrentControlSet\Services\Netlogon\Parameters
Once you click Parameters, add a string word called “SiteName”
Add the current site name to the entry and exit regedit.
nltest /dsgetsite will now function as expected.
Not the best of solutions; but it at least it solved the user’s problem while the AD people figure out what is going on.
If I get an answer, I will update this post.
-update-
As suspected; a subnet range was missing from the AD configuration. It was added and the correct site and logonservers were appearing.
How to lock a remote desktop session.
Friday, September 14th, 2012An annoying little ritual we must all follow is the periodic password change. I had to change mine and I had a remote desktop session which of course wanted a session lock and password entry to update the credentials.
To lock a local session, you simply enter: windows+L
It works great with local sessions but it does nothing for remote desktop sessions.
For remote desktop; you can enter: CTRL+ALT+INS but this may not work as it requires you to configure remote desktop for it to work.
* Open the Remote Desktop Connection utility and click Options. * Open the Local Resources tab * Change the value for Apply Windows key combinations option under Keyboard to On the remote computer. * This will send all key combinations to the remote desktop connection; including Ctrl-Alt-Ins.
There is one more way which doesn’t require configuration changes.
Simply, enter: rundll32 user32.dll,LockWorkStation
After that a quick unlock and the credentials are updated.
My Laptop display is upside down!
Thursday, September 13th, 2012I was working on a virtual machine and while “wrestling” with a problem I found my display now showed my desktop upside down! Really strange.
After playing around with a few key combinations, I found that ctrl-alt and the up arrow key corrected the problem.
Never knew this could happen. Playing around with the arrow keys showed the display would go in all directions.
What is the size of the drives on a Redhat computer.
Thursday, September 13th, 2012I had to do an audit of several machines for possible inclusion to a compute farm. There was a requirement as to the physical size of the disks installed.
To find this information, you can use the fdisk command which will list the physical size and partition information. I had to use root to get this information.
# /sbin/fdisk -l Disk /dev/cciss/c0d0: 146.7 GB, 146778685440 bytes 255 heads, 32 sectors/track, 35132 cylinders Units = cylinders of 8160 * 512 = 4177920 bytes Device Boot Start End Blocks Id System /dev/cciss/c0d0p1 * 1 64 261104 83 Linux /dev/cciss/c0d0p2 65 20624 83884800 82 Linux swap / Solaris /dev/cciss/c0d0p3 20625 35132 59192640 83 Linux Disk /dev/cciss/c0d1: 146.7 GB, 146778685440 bytes 255 heads, 32 sectors/track, 35132 cylinders Units = cylinders of 8160 * 512 = 4177920 bytes Device Boot Start End Blocks Id System /dev/cciss/c0d1p1 * 1 35132 143338544 83 Linux #
As you can see in this example; there are two drives which are 146.7 GB in size.
What version of Redhat am I running?
Thursday, September 13th, 2012Every once in awhile I find myself asking the question of what version of Redhat is installed?
The login prompt tells you but if you access several systems, this information gets ignored.
Red Hat Enterprise Linux Client release 5.7 (Tikanga)
Kernel 2.6.18-274.el5 on an x86_64
login:
Rather then logging off and back in, you can review a file which will have the version information.
$ cat /etc/redhat-release
Red Hat Enterprise Linux Client release 5.7 (Tikanga)
$