Monday, March 28, 2011

Attacked by hackers

Watch out for failed logins for administrator on your computer.  2-3 times every second, coming from file://ntscan/.  The IP in this case was  69.167.189.5, originating from New York, USA. Apprently it is attacking the RDP port.

Solution: rename the Administrator account. Get a firewall. But I'm sure it causes a ton of network traffic.

http://www.webhostingtalk.com/archive/index.php/t-945341.html

Winzip

I'm glad I don't use Winzip, but in case you do... There is a serious bug which erases removable drives before creating the zip file.  You might want to update to the latest version.

http://www.winzip.com/rel_notes_wz.htm

Sunday, March 27, 2011

Windows 7 language and Word 2007

I couldn't figure out why my keyboard keeps on displaying French letters.  For example, whenI type ', I get an e with an accent. It's because I chose English - Canada as the language setting in Windows.  Installed English - US instead and it works fine.

Friday, March 18, 2011

Needle in a haystack = stupid coding error

I've been driven crazy for days over why my proprietary Declone and Sysprep refuses to work on an Optiplex 980.  Works perfectly on a 960, 755 and GX520.  There is a piece of perl code that is used in the declone script to match the MAC address of the computer to one in a text file.  It goes like this.

if( $line =~ /00-*/ )  {

Where "00" is the first two digits of the MAC address.  Guess what?  They make NIC cards with addresses starting with the rest of the hex numbers.  I had to change it to:

if( $line =~ /\d\d-*/ )  {

Of course, higher up all I got was a Sysprep error.  Other parts of the program picked up the computer name correctly. Many hours wasted looking in the wrong places.

Windows 7 can shrink partitions

This is a nifty feature.  I still remember the days of Partition Magic where you needed to boot outside the OS on disk to be able to change the size of the primary boot partition.  Windows 7 allows you to do it while booted into the OS.  If there is space I assume that it will extend partitions as well

Monday, March 14, 2011

Windows 7 - profile corrupted

Imagine the horror when you reboot your computer, logon and get a profile that is wiped of all your settings. The error is "Windows cannot find the local profile and is logging you on with a temporary profile. Changes you make to this profile will be lost when you log off."  I have seen this lots in the lab but never really worried about it.  Until it happened to me.  Thank goodness the first method mentioned in the link below worked.

http://support.microsoft.com/kb/947215

Friday, March 11, 2011

Facebook malware

I recently posted this on my status. It's not the first time I have come across this.  It appeared on a friend's profile, someone who does not normally post this type of content.  I was suspicous.  Too bad I can't find anything from authoritative sources on the web referencing this type of malware.

There is Facebook malware or scam going around. A link such as "Look what happens when FATHER catches DAUGHTER on her WEBCAM!" on your friend's profile and is liked by them. Don't click on it! Tell your friend to remove it from their profile. If you click on it, it will post itself on your profile without asking. It also has a lot of spammy content that could infect your computer.

Thursday, March 10, 2011

More code for creating shortcuts on the desktop

Here's another way of doing it.  I'm not sure I like this method as I am an old geezer and hang onto the computer name, pre-Windows 2000 instead of the common name. Which means that it does not identify users if they are not named properly.

But it really doesn't solve my biggest problem... the fact that the members of the Admin group reside in two different domains.

Option Explicit
Dim net, currentUser, objGroup, objUser, strdistinguishedName, arrDnComponents, userNameComponent, strDesktopFolder, objShell, objShortCut
Set net = CreateObject("Wscript.Network")
currentUser = net.UserName
'Bind to the group
Set objGroup = GetObject("ldap://CN=Admins,ou=foo,dc=foo,dc=bar,dc=com")
'Iterate through the user objects in the group
For Each objUser In objGroup.Members
 'Get the users distinguishedName
 strdistinguishedName = objUser.distinguishedName
 'Split users distinguishedName by ','
 arrDnComponents = Split(objUser.distinguishedName, ",")
 'Split the actual user name
 userNameComponent = Split(arrDnComponents(0), "=")
 ' Check to see if the user is in the group

If userNameComponent(1) = currentUser then
 wscript.echo "This user is a member of the group. Creating shortcuts..."
 call CreateShortcut("c:\windows\scripts\admin\TightVNC","TightVNC")
 call CreateShortcut("%SystemRoot%\system32\gpmc.msc","Group Policy Management Console")
 call CreateShortcut("%SystemRoot%\system32\dsa.msc","Active Directory Users and Computers")
Else
 wscript.echo "Processing user..." & userNameComponent(1)
End If
Next
' *****************************************************
'This function creates a shortcut on the user's desktop.
Function CreateShortcut(targetPath,shortcutName)
 set objShell = WScript.CreateObject( "WScript.Shell" )
 strDesktopFolder = objShell.SpecialFolders("Desktop")
 Set objShortCut = objShell.CreateShortcut(strDesktopFolder & "\" & shortcutName & ".lnk")
 objShortCut.TargetPath = targetPath
 objShortCut.Save
End Function
' *****************************************************
' Clean up
set objShell = Nothing
set net = Nothing

Tuesday, March 1, 2011

Creating shortcuts on desktop


I needed some code to create shortcuts for admin users only on logon.

Sourced from here:

http://daniel.streefkerkonline.com/vbscript-check-if-current-user-is-a-member-of-a-certain-group/

and tweaked it a bit.  The guy writes clean looking code.

' ******************************************
'Error Handling
On Error Resume Next
set objShell = WScript.CreateObject( "WScript.Shell" )

'Calls the isMember function with the specified group to see if the current user
' is a member of that group.
' If member, then create a shortcut to TightVNC, GMPC & ADUC on the desktop
If isMember("My_Admins") Then
    call CreateShortcut("c:\windows\scripts\admin\TightVNC","TightVNC")
    call CreateShortcut("%SystemRoot%\system32\gpmc.msc","Group Policy Management Console")
    call CreateShortcut("%SystemRoot%\system32\dsa.msc","Active Directory Users and Computers")
    Else
    ' wscript.echo "The user is not a member of the group"
End If

' ******************************************
'This function checks to see if the passed group name contains the current
' user as a member. Returns True or False
Function IsMember(groupName)
    If IsEmpty(groupListD) then
        Set groupListD = CreateObject("Scripting.Dictionary")
        groupListD.CompareMode = TextCompare
        ADSPath = EnvString("userdomain") & "/" & EnvString("username")
        Set userPath = GetObject("WinNT://" & ADSPath & ",user")
        For Each listGroup in userPath.Groups
            groupListD.Add listGroup.Name, "-"
        Next
    End if
    IsMember = CBool(groupListD.Exists(groupName))
End Function
' ******************************************
'This function returns a particular environment variable's value.
' for example, if you use EnvString("username"), it would return
' the value of %username%.
Function EnvString(variable)
    variable = "%" & variable & "%"
    EnvString = objShell.ExpandEnvironmentStrings(variable)
End Function
' ******************************************
'This function creates a shortcut on the user's desktop.
Function CreateShortcut(targetPath,shortcutName)
    strDesktopFolder = objShell.SpecialFolders("Desktop")
    Set objShortCut = objShell.CreateShortcut(strDesktopFolder & "\" & shortcutName & ".lnk")
    objShortCut.TargetPath = targetPath
    objShortCut.Save
End Function
' ******************************************
' Clean up
Set objShell = Nothing