Friday, September 14, 2012

Breaking and Entering



Hey Everyone,                                            

        So this week I was helping by discarding their unwanted electronics while removing any of their data from different sources. One of these such sources was a 500GB Western Digital My Book Essential Edition 2.0 external Hard Drive (WD5000HU1). So as I begin to get things setup, I noticed......no power! So, I reach out to them and they proceed to explain that during their move it has been LOST!!!! This basically makes the external hard drive a Electronic waste paperweight, which of course everyone should have on their home and office desks. So, after some quick research I found out that you can easily pick up a new power supply for $10-$15. However, I didn't feel like spending the money just to erase the data SO, this was going to be my next small project. For anyone facing this situation and they really like their external drive I recommend either purchasing the power cord or later on they could purchase a SATA to USB external enclosure to put the hard drive in. That being said, for those who either need a last resort or a taste of destructive fun, I decided to dig in to take this item apart.

So this model doesn't have any external screws holding the chassis together, it is just plastic tabs concealed by the cover. I took a small Flat-Head screwdriver and slowly pried open the small plastic interior section as shown, and moved to the top and bottom of the device. I completed one side of the device, then finished the other side.











Once I had the two pieces separated, I then slid them apart while occasional needing to seperate them when they catch.


Looking at the bottom of the hard drive I found the PowerBoard that connected to the hard drive allowing the device to connect through USB, and removed the two screws.


 
 
After the PowerBoard is removed, I then removed the interior plastic cover by swinging it around the hard drive like a door until it detatched from the drive. I then removed four screws holding the hard drive to the metal bracket.
 
 
And here are all the parts disassembled.
 
So, now I can place the SATA drive in a external enclosure or in a system and erase all the data as needed. My plan is to install this drive as storage for my new Windows 8 system but, maybe I'll end utilizing it some other way. In any case, I had fun tearing things apart and as always Be Blessed!


Wednesday, September 5, 2012

It's all about the Script.....VBScript that is...

Hey Everyone,

       Sorry about the late post this week. To be honest, starting on Friday last week my work has thrown a huge curve ball at me and I've been plugging away at it. Basically, they have been planning on upgrading some business software that is a hosted web based solution, and regardless of the questions we asked about preparations and client based changes, we were assured that everything would transition smoothly. We'll the go live date was Friday of last week and the bombshell went off that the links used for majority of our users had to be changed. Just to give you and idea of the scale, we're talking roughly a little over 300 users and not only do they have shortcuts in their favorites, they also have desktop icons. Now some of you may be thinking, no big deal, use group policy, do this, do that.. and forgive me for being short but, yes that would work and in part I did but, this isn't my forte and was a new challenge for me. So, introductions and background out of the way, I wanted to share my experience and what I was able to discover after researching multiple websites for solutions.

       Basically, I had 3 goals: my first goal was to remove the old website shortcuts on Windows XP and Windows 7 through all the users profiles to eliminate confusing and false error reports to the help desk. Secondly, I needed to update the link that was applied through group policy across our domain to point to the new link, and finally, I had to create a new shortcut for every user pointing to the correct address.

      So, the second goal was the easiest to address and was knocked out before the end of business on Friday. I hopped onto the group policy manager and edited the link that was already applied through group policy. The other two goals were the more difficult ones. Remember to keep the scale of deployment in mind, this is 300 users that need this link, and that have old links. My approach was to utilize a process that I was familiar with and which is actually my tech tool of the week. I utilized PDQ Deploy by AdminArsenal to distribute a batch file that creates the shortcut for me. Now covering PDQ Deploy is a bit out of the scope of this blog today but, I plan to cover it in a video tutorial.

Here's the batch file contents that was deployed to all of the desktops:
-------------------------------------------------------------------------------------------------
@echo off
REM Providing network location
:_Create
IF NOT EXIST "X:" (
  goto :_X32
) else (
NET USE X: /Delete
goto :_Create
)
:_X32
NET USE X: \\Server\Shared\Drive\Folder
IF EXIST "C:\Documents and Settings" (xcopy /Y "X:\Internet Shortcut Needed.url" "C:\Documents and settings\All Users\Desktop\*.*") ELSE (goto :_X64)
IF EXIST "C:\Documents and Settings\All Users\Desktop\Internet Shortcut Needed.url" DEL "C:\Documents and Settings\All Users\Desktop\Internet Shortcut Needed.url"
goto :_eof
:_X64
IF Exist "C:\Users" (xcopy /Y "X:\Internet Shortcut Needed.url" "C:\Users\Public\Public Desktop\*.*") ELSE (goto :_X32)
IF Exist "C:\Users\Public\Public Desktop\Internet Shortcut Needed.url" DEL "C:\Users\Public\Public Desktop\Internet Shortcut Needed.url"
goto :_eof

:_eof
REM Remove Network Drive
NET USE X: /Delete
-----------------------------------------------------------------------------------------------------------------------

In case you're not familiar with scripts let me walk you through this. The first section checks if a drive is mapped to the drive letter 'X:', if so it disconnects the drive to assure it is available. If the drive doesn't exist, it jumps to :_X32. The first thing we do is map a drive to the network share that I stored the Internet shortcut, and assign the drive letter 'X'. It then checks to verify if this system is a Windows XP system by checking if 'C:\Documents and Settings' exists, if it does, it copies the Internet shortcut to the All Users profile on the desktop, which assures every user on the system now has the new link on their desktop. If it doesn't exist, it skips to :_X64. Continuing the process that 'C:\Documents and Settings' exists, it then checks the all users profile to see if the old icon exists on the desktop, if so it deletes it. The process is then complete and calls :_eof to cleanup and exit. :_eof disconnects the mapped drive since it is no longer needed and the user may require the X: drive for other functions. The :_X64 functions in the exact same manner however, it checks to verify it is a Windows 7 system and checks a different folder structure.

I don't know if this was the easiest way to deliver the shortcut but it worked for me. I had this process deployed by early morning Tuesday. Here was now the most difficult task, removing the old shortcuts in every users profile. Here's how I accomplished that task:
-----------------------------------------------------------------------------------
Dim fso, f, f1,strPath1,strComputer
Set fso = CreateObject("Scripting.FileSystemObject")
Set network = WScript.CreateObject("WScript.Network")
strComputer = network.ComputerName
Set strPath1 = fso.GetFolder("\\" & network.ComputerName & "\c$\Documents and Settings")
'WScript.Echo "strPath1: " & strPath1
Set f = strPath1.subFolders

For Each f1 in f
If fso.FileExists(f1 & "\Desktop\Internet Shortcut.url") Then
  fso.DeleteFile (f1 & "\Desktop\Internet Shortcut.url")
End IF
Next
For Each f1 in f
If fso.FileExists(f1 & "\Desktop\Internet Shortcut-2.url") Then
  fso.DeleteFile (f1 & "\Desktop\Internet Shortcut-2.url")
End If
Next
For Each f1 in f
If fso.FileExists(f1 & "\Desktop\Internet Shortcut-3.url") Then
  fso.DeleteFile (f1 & "\Desktop\Internet Shortcut-3.url")
End If
NEXT
For Each f1 in f
If fso.FileExists(f1 & "\Desktop\Internet Shortcut-4.url") Then
  fso.DeleteFile (f1 & "\Desktop\Internet Shortcut-4.url")
End If
NEXT
For Each f1 in f
If fso.FileExists(f1 & "\Desktop\Internet Shortcut-5.url") Then
  fso.DeleteFile (f1 & "\Desktop\Internet Shortcut-5.url")
End If
NEXT
WScript.Quit(0)
---------------------------------------------------------------------------------------------

I used active directory and deployed this script to all of my Windows XP systems. This script starts by defining all of the variables needed in the script. It then assigns the computer name to strComputer, and sets the path using the computer name and path to the location of user profiles. The 'For Each' command then runs through each profile deleting the Internet shortcut specified. I have multiple 'For Each' commands to address multiple variations that the old links could be titled as.

The Windows 7 script is the same way just with different paths. Here is a sample to compare the differences:
------------------------------------------------------------------
Dim fso, f, f1,strPath, strComputer
Set fso = CreateObject("Scripting.FileSystemObject")
Set network = WScript.CreateObject("WScript.Network")
strComputer = network.ComputerName
Set strPath = fso.GetFolder("\\" & strComputer & "\c$\Users")
'WScript.Echo "strPath: " & strPath
Set f= strPath.subFolders
For Each f1 in f
If fso.FileExists(f1 & "\Desktop\Internet Shortcut.url") Then
  fso.DeleteFile (f1 & "\Desktop\Internet Shortcut.URL")
End IF
NEXT
-----------------------------------------------------------------------

Well that's it, I don't know if that was the best solution but, that's what worked for me. What would you have done differently to solve this problem? Be Blessed!