IT Support archives - If it has a plug, it's IT stuff

If it has a plug, it's IT stuff:

IT support

Nov 20 2008   8:51AM GMT

My 2 cents on Vista



Posted by: Alessandro Panzetta
IT support

Many and many articles have been written on the last Microsoft operating system, some claim that is a good operating system with significant enhancements, some other instead scream about the issues and problems they had to face with Vista. To my pint of view everything depends on the context in which the OS is evaluated.

I’ve had experience in both “main” environments, that’s to say office and home and I have a different evaluation for both of them.

In the office I simply could not use it because of its incompatibility with some tools that are used in the company so I had to discard it after two days and reinstall Windows XP.

For home usage instead I really appreciated it, I had it installed on a HP laptop and, except the first week in which it was really slow, it started satisfying me: rapid resume from standby, fast application opening and many other cool and useful things.

That’s it, everything depends on the context!

The UAC feature is certainly what causes all of the disruptions and errors in applications; you can’t configure apps to run as services,while installing something you have to right click and choose “run as administrator” and so on…but this feature is useful, it prevents unwanted applications to escalate privileges.

Considering the UAC in the “office”, to my point of view, this is somewhay unuseful because IT admins already know how to avoid unwanted behavior; at “home” instead the UAC feature is a good thing because prevents virii spread for those users who are not really confident with computing.

So I wonder, why didn’t Microsoft simply decide to make two different things like an “office” version and a “home” version? I know that Business edition is this way but it’s simply an OS with some added features and not an OS deigned mainly for corporate usage.

My 2 cents…

Nov 18 2008   7:45AM GMT

Homemade House Automation!!!



Posted by: Alessandro Panzetta
automation, IT support, home, domotics

This is always been one of dreams! And today this dream can come true!

Since last June I have changed job role and passed from System Administration, a job that I’ve done form about 10 years, and have become a Technical Support Engineer in a company that is a leader in software for industry automation. So now I have a better view on how to do it!

Like in Bill Gates’ “The Road ahead” I’ve always thought to my house to be “intelligent” and to easy my daily tasks and ease the way I live in house so let’s call it a “bidirectional understanding”.

It’s not only about motion sensors  that can switch lights on or off, it’s not about the music to “follow” me when changing rooms, it’s a matter of an intelligent house and also intelligent house management that in the end means : cost reduction.

I’m actually searching for documents on open systems because home automation is already present in the market but all systems that I’ve seen are “closed” that means that they rely on ther own protocols and devices. What I’m looking for is instead a standard that allows me to use different devices from different vendors that can talk together.

I’ll continue to search andreport on this blog my findings…stay tuned!


Nov 10 2008   10:48AM GMT

Group Policy scripts, what are they doing on my PC?



Posted by: Alessandro Panzetta
Group Policy, IT support

Even if I’m not anymore in the direct IT Department, some manager have asked me this question when they noticed that there were some shutdown/startup scripts running on their client machines so I thought that writing a post that explains how to find this information could be a good idea.

Let’s start from the concept: in an Active Directory based domain Administrators can write Group Policies that can satisfy many needs in IT Administration, including which scripts a computer or user has to run while starting up or logging to a computer. These scripts are of two main kinds:

  • COMPUTER: we can have a script for startup and one for shutdown
  • USER: we can have a script for login and one for logoff

So an Admin can provide some scripts and be sure that these are running accordingly but how can you understand what are the scripts doing? Simply perform these steps

  1. Click START/RUN type MMC and press ENTER
  2. Press CTRL+M (Add/Remove Snap-in) and click the ADD button
  3. Select Resultant Set Of Policy, click the ADD button and then CLOSE
  4. Click OK
  5. Right click the Resultant Set Of Policy node and choose “Generate RSOP data
  6. Click NEXT until you reach the USER SELECTION window
  7. Check the lower radio button “Do not display user policy…” and click NEXT twice
  8. Click FINISH
  9. Expand the tree Computer Configuration/Windows Settings/Scripts/Startup
  10. Now browse your closest domain controller to something like \\DOMAINCONTROLLER\SYSVOL\DOMAINNAME\Policies\{XXXXXXXXXXXXXXXXXXXXXXXXXXXX}\Machine\Scripts\Startup; in this folder you should find the scripts that are run on your computer

At this point you can copy these files and read their content and, if they are clear enough, remove any doubt on what your SysAdmin is trying to do with these scripts.


Nov 2 2008   9:38AM GMT

IT: the past and the future



Posted by: Alessandro Panzetta
mainframe, IT support, future, past

In my experience as a SysAdmin I’ve had the opportunity to put my hands on several IT infrastructures and I’ve seen many ways of using the IT technologies. I’ve seen things that humans….oops that was another thing :)

Actually I’m not managing these infrastructures anymore because I’ve crossed the border and have become an IT user leaving the burden of administering to someone else so I’ve had the time and occasion to think about it.

In an era in which web based applications are already an obsolete thought, in which most of our activities are web based and the main goal of many IT managers is concentrate IT functions in one place in order to reduce maintenance, running costs, energy consumption and so on. So it will probably come one day when the company where we work for will be a unique network based place.

Said this I wonder: is the mainframe concept coming back?

Together with this phenomena we also can see the software industry to act in this direction too; Microsoft just released their web based Office suite and image editing has gone to the web, various companies have provided tools that allow you to keep your stuff on the web (Live Mesh, Gmail, etc) and users don’t have to think of backups, antivirus and all of the things they have usually manage. As you see these are evolutions of the old terminals!!!

But we’re not anymore in the past, we’re actually living our present and have to think about the future…let’s do an effort and try to imagine this.

Another thing we have to think of is the network connection that is becoming, day after day, available everywhere. GPRS, Edge, UMTS, HDSPA, WiMax, BlackBerry are all technologies that aim at keep you connected and, once you’re hooked to the Internet, be able to reach your company’s network and perform your tasks. Additionally more and more companies are dealing with an increasing number of home-office users that work 8 hours a day by not being present in the office.

I’m a person who loves to visualize that means that when I think I usually create a mental image of what I’m thinking about so let’s see how I imagine my working days in the future.

My car will mount what I call device that is a mix of a car radio, movie/mp3 player, GPS navigator, thin client that is continuously connected to the internet and this will be in communication with a kind of AI that behaves as my personal secretary.

I enter my car and put my daughter in the back seat, turn on the engine and turn on the device.

Hi James, so what’s new today?” – I ask by voice to the device that I’m use to call James.

Good morning Alessandro, you’ve received 12 new emails last night, do you want me to read them?” – James responds.

Yes please but keep it short, I just woke up!”

1st message is from IT Department and says that the scheduled maintenance shutdowns have been performed, then John Doe wrote you about the last conference call with Contoso, he attached a Word document too…” – James keeps telling until I say him to stop and schedule a meeting with John and to send a meeting request to the Contoso guys too.

I watch in the rear-mirror and ask to my daughter: “Honey, do you want to see some cartoons? Or I’d switch to MTV?

The novel can go ahead for the whole working day but I let you imagine what life could really look like.

I’m looking forward living these days…that shouldn’t be so far anyway :)


Oct 16 2008   8:11AM GMT

[TLBAT] Intranet: ADMIN section and the final conclusions.



Posted by: Alessandro Panzetta
Database, IT support, Intranet, Admin tools, Intranet portal

So in the previous post I’ve suggested you to use the Persist ASP Upload components (not free), some of you may wonder why…well it’s easy: this component not only allows you to upload your files via ASP but also gives you the opportunity to set the ACLs (Access Control List) on the files so in the end if we’re uploading a file that will be restricted to a given group the component will also set the corresponding ACL to the file!

This post is the only one for the Download Center and I will finally provide you with all files needed for the thing to have a working Download Center! At any time feel free to ask me your questions or any doubts on this tool….now let’s rock and download the files!


Sep 25 2008   3:16PM GMT

[TLBAT] Intranet: request_package.asp



Posted by: Alessandro Panzetta
Database, Active Server Pages, self-service, IT support, Intranet, Intranet portal

In the previous post we have seen the code that stays behind the scenes and that checks if a user is allowed to download the file. But what happens if the user is not allowed to download the requested software?

If you check the ASP code in my previous post you will see that there is a subroutine called RequestPack that accepts two parameters: NEEDED_GROUP and FILE. So whenever a user is not allowed there is an IF/THEN clause that, in case of not allowance to download a file, redirects the user to the RequestPack subroutine.

if Licensed = True then

Call GimmePack(FILE)

else

    Call RequestPack(NEEDED_GROUP, FILE)

End if

What the RequestPack will do is to redirect the user to a page called request_package.asp where he/she will be asked if they want to request access to this package, if yes an email will be sent to the Download Center administrator with all necessary information.

Here is the RequestPack routine, present in the download_special.asp page, that builds the link to the request_package.asp page:

Sub RequestPack(NEEDED_GROUP, FILE)

    Response.Redirect “request_package.asp?UserName=” & UCase(USERID) & “?Group=” & NEEDED_GROUP & “?File=” & FILE & ” “

End Sub

Hereafter the code for the request_package.asp page, in the next post we will start seeing the Administration part of the Download Center where we can add/remove packages, define site’ subnets, configure the replication between distribution points and so on so….stay tuned!!!

======CODE======

<%

USERID = Request.querystring(”UserName”)

NEEDED_GROUP = Request.querystring(”Group”)

FILE = Request.querystring(”File”)

File1 = Split(FILE,”.”)

%>

<center><hr width=50% color=006699><font face=”Tahoma” color=”#006699″> <% response.write UCase(USERID) %> requests <% response.write UCase(File1(0)) %></center><hr width=50% color=006699>

<!–webbot BOT=”GeneratedScript” PREVIEW=” ” startspan –><script Language=”JavaScript” Type=”text/javascript”><!–

function FrontPage_Form1_Validator(theForm)

{

if (theForm.Confirmation.value == “”)

{

alert(”Please enter a value for the \”Confirmation\” field.”);

theForm.Confirmation.focus();

return (false);

}

if (theForm.Confirmation.value.length < 2)

{

alert(”Please enter at least 2 characters in the \”Confirmation\” field.”);

theForm.Confirmation.focus();

return (false);

}

if (theForm.Confirmation.value.length > 3)

{

alert(”Please enter at most 3 characters in the \”Confirmation\” field.”);

theForm.Confirmation.focus();

return (false);

}

var checkOK = “ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ”;

var checkStr = theForm.Confirmation.value;

var allValid = true;

var validGroups = true;

for (i = 0; i < checkStr.length; i++)

{

ch = checkStr.charAt(i);

for (j = 0; j < checkOK.length; j++)

if (ch == checkOK.charAt(j))

break;

if (j == checkOK.length)

{

allValid = false;

break;

}

}

if (!allValid)

{

alert(”Please enter only letter characters in the \”Confirmation\” field.”);

theForm.Confirmation.focus();

return (false);

}

return (true);

}

//–></script><!–webbot BOT=”GeneratedScript” endspan –><form method=”GET” action=”request_package.asp” onsubmit=”return FrontPage_Form1_Validator(this)” language=”JavaScript” name=”FrontPage_Form1″>

<p align=”center”><font face=”Tahoma” color=”#006699″>You are going to request the license for the software package <b><% response.write File1(0) %></b> do you confirm the request?</font></p>

<p align=”center”>

<!–webbot bot=”Validation” s-display-name=”Confirmation” s-data-type=”String” b-allow-letters=”TRUE” b-value-required=”TRUE” i-minimum-length=”2″ i-maximum-length=”3″ –><input type=”text” name=”Confirmation” size=”20″ value=”Please type YES or NO” maxlength=”3″></p>

<p align=”center”><input type=”submit” value=”Submit” name=”B1″></p>

</form>

</font>

<%

if Request.querystring(”Confirmation”) = “Please type YES or NO” then

elseif Request.querystring(”Confirmation”) = “YES” then

    Set objEmail = CreateObject(”CDO.Message”)

    objEmail.From =  download_center at mydomain.comBE SURE TO CHANGE THIS

    objEmail.To = “dloadcenter_admin@mydomain.com”‘BE SURE TO CHANGE THIS

    objEmail.Subject = “[Download Center 2.0] Package request from: ” & UCase(USERID)

    BodyTxt = “The user ” & UCase(USERID) & ” must be added to ” & NEEDED_GROUP & ” group in order to be allowed to download <b>” & FILE & “</b>” & vcbcrlf

    objEmail.Textbody = BodyTxt & “Please verify with the user’s manager to see if the user is allowed to download this software.”

    objEmail.Configuration.Fields.Item(”http://schemas.microsoft.com/cdo/configuration/sendusing”) = 2

    objEmail.Configuration.Fields.Item(”http://schemas.microsoft.com/cdo/configuration/smtpserver”) = “mail.lamrc.com”

    objEmail.Configuration.Fields.Item(”http://schemas.microsoft.com/cdo/configuration/smtpserverport”) = 25

    objEmail.Configuration.Fields.Update

    objEmail.Send

Else

    Response.redirect(”default.asp”)

End If

%><head><title>..:: Download Center ::..</title></head>

======END CODE======


Sep 24 2008   12:52PM GMT

[TLBAT] Intranet: an image is worth 1000 words!!



Posted by: Alessandro Panzetta
Database, Patch management, Active Server Pages, IT support, Intranet, Intranet portal

Hi folks, I just found out that I had an image of the concept behind the Download Center so I think it’s much better to post it so this can clearly explain how the whole thing works…here it is!

Download Center diagram


Sep 24 2008   12:36PM GMT

[TLBAT] Intranet: the download_special.asp



Posted by: Alessandro Panzetta
Networking, Database, Bandwidth, Active Server Pages, IT support, Intranet, Intranet portal

So we’re finally at the “interesting” stuff: the page that checks if a user is allowed or not to download a certain package.

As in previous posts in order to allow a user to download a certain file he/she must be a member of a given group; e.g. we want to restrict the downloads of MySoftware.exe and make this available only to the members of the grp_MySoftware group. We defined then in our database that this file has the following entry:

PackageDesc = “My beautiful software 1.0″

PackageName = “MySoftware.exe”

PackageType = “Special”

NeededGroup = “grp_MySoftware”

The code that you find below will check if the user that is visiting the page is part of the grp_MySoftware group and, if successful, build the download link by redirecting him/her to the closest distribution point. Example http://192.168.xxx.1/files/MySoftware.exe where xxx is the subnet of the client visiting the page.

So now let’s see the code and remember to change the MyDomain = “contoso” to your domain name (E.g. if you have mycompany.com just type mycompany).

The code that follows is self-explanatory so just…read it and check the commented lines!

‘======CODE======

<!– #include file=”adovbs.inc” –>

<%

Session.Timeout=10

Dim NEEDED_GROUP

Dim SOURCE

Dim FILE

Dim MyDomain

‘Dim USERID

FILE = Request.querystring(”file”)

USERID = Request.querystring(”UserName”)

MyDomain = “contoso”

Dim Licensed

Set cnnSearch = Server.CreateObject(”ADODB.Connection”)

cnnSearch.Open “Provider=Microsoft.Jet.OLEDB.4.0;Data Source=” & Server.Mappath(”db/downloads.mdb”) & “;”

strSQL2 = “SELECT Packages.NeededGroup FROM Packages WHERE (((Packages.PackageName)=’” & FILE & “‘)) GROUP BY Packages.NeededGroup;”

Set rstSearch2 = cnnSearch.Execute(strSQL2)

Do While Not rstSearch2.EOF

   NEEDED_GROUP= rstSearch2.Fields(”NeededGroup”).Value

    rstSearch2.MoveNext

Loop

Call CheckGroup

Sub CheckGroup

Set objDictionary = CreateObject(”Scripting.Dictionary”)

set User = GetObject(”WinNT://” & MyDomain & “/” + USERID)

For Each Prop In User.groups

    if instr Prop.Name,right(NEEDED_GROUP,3)) > 0 then

        Licensed = True

    end if

Next

End Sub

if Licensed = True then

Call GimmePack(FILE)

else

    Call RequestPack(NEEDED_GROUP, FILE)

End if

‘ *** Get the visitor’s subnet

CLIENT_IP = Request.ServerVariables(”REMOTE_ADDR”)

SUBNET0 = Split(CLIENT_IP,”.”)

‘ *** Check the distribution point for the given subnet

strSQL = “SELECT Sites.Subnet, Sites.Distrib_Point FROM Sites WHERE (((Sites.Subnet)=’” & SUBNET0(2) & “‘)) GROUP BY Sites.Subnet, Sites.Distrib_Point;”

Set rstSearch = cnnSearch.Execute(strSQL)

Do While Not rstSearch.EOF

    Session(”SOURCE”) = rstSearch.Fields(”Distrib_Point”).Value

    rstSearch.MoveNext

Loop

‘ *** Create the download link and redirect the by using the REFRESH metatag so the package automatically starts downloading

Sub GimmePack(FILE)

    DOWNLOAD_LINK = Session(”SOURCE”) & FILE

    response.write “<html><head><META http-equiv=’refresh’ content=’3;URL=” & DOWNLOAD_LINK & “‘><title>Download page for ” & FILE & “</title></head><body>”

    response.write “<center><FONT FACE=TAHOMA SIZE=2 COLOR=#006699>You are registered to download <b>” & FILE & “</b></FONT><br>”

    response.write “<FONT FACE=TAHOMA SIZE=2 COLOR=#006699>Your download should start in few seconds, if this doesn’t happen, click <a href=” & DOWNLOAD_LINK & “>HERE</a></b> to download the file</FONT><center>”

    LogHit

End Sub

Sub LogHit

    CLIENT_IP = Request.ServerVariables(”REMOTE_ADDR”)

    Dim DB_CONNECTIONSTRING

    DB_CONNECTIONSTRING = “Provider=Microsoft.Jet.OLEDB.4.0;Data Source=” & Server.Mappath(”db/hits.mdb”) & “;”

    Dim objRecordset

    Set objRecordset = Server.CreateObject(”ADODB.Recordset”)

    strSQL = “SELECT * FROM downloads;”

    objRecordset.Open strSQL, DB_CONNECTIONSTRING, adOpenKeyset, adLockPessimistic, adCmdText

    objRecordset.AddNew

    objRecordset.Fields(”Package”) = FILE

    objRecordset.Fields(”UserName”) = USERID

    objRecordset.Fields(”IP_ADDR”) = CLIENT_IP

    objRecordset.Fields(”Date”) = Date

    objRecordset.Update

    objRecordset.Close

    Set objRecordset = Nothing

End Sub

Sub RequestPack(NEEDED_GROUP, FILE)

    Response.Redirect “request_package.asp?UserName=” & UCase(USERID) & “?Group=” & NEEDED_GROUP & “?File=” & FILE & ” “

‘    Session.Abandon

End Sub

%><head><title>..:: Download Center ::..</title></head>

‘======END CODE======


Sep 17 2008   3:07PM GMT

Time won’t leave as I am….



Posted by: Alessandro Panzetta
IT support

…but time won’t take the boy out of this man! (U2 - City of blinding lights)

Some of you probably notices that I’m not updating as frequently as before…oh well…soooooooorry but this new job is sucking taking all of my time in styudying, exams and so on. So pleas ebe patient, I’ll be updating soon with other TLBAT stuff for our Download center…stay tuned!


Sep 11 2008   10:13AM GMT

[TLBAT] Intranet: download.asp



Posted by: Alessandro Panzetta
Database, Active Server Pages, IT support, Intranet, Intranet portal

In this post we will build the page that downloads the packages that we have defined as: STANDARD, GOODIE or PATCH. These software packages are the ones that are available to all users in our domain so no special need is required except being a user in the domain.

What the page will do is to identify in which IP subnet the user is located and build the download URL relative to his or her site; this will save bandwidth and reduce download times for the users.

The page uses an ASP Server Variable that is used to obtain the client’s IP address and then compare this to our sites’ definition in our database, indeed if we look at the code we will see the: Request.ServerVariables(”REMOTE_ADDR”)
string, this variable is the IP address of the computer that is visiting the page.

As an example let’s consider the IP address 192.168.39.123, in this page we will check the 3rd octet of the IP address and compare it to our database; in this case the “39″ part identifies the Italian site located in Milan so the final URL will be “http://iis_ita1/download/free/myfile.exe ” where the myfile.exe is passed by the default.asp page.

The page then will also log the hit for the given file to the hits database; this is done by calling the LogHit subroutine.

The next post will discuss the SPECIAL packages where in order to be allowed to download a given file, the user is required to be member of a given domain group…stay tuned!!

<!– #include file=”adovbs.inc” –>

<%

Dim cnnSearch

Dim rstSearch

Dim strDBPath

Dim strSQL

Dim strSearch

Dim SOURCE

Set cnnSearch = Server.CreateObject(”ADODB.Connection”)

cnnSearch.Open “Provider=Microsoft.Jet.OLEDB.4.0;Data Source=” & Server.Mappath(”db/downloads.mdb”) & “;”

FILE = Request.QueryString(”file”)

‘ *** Get the visitor’s subnet

CLIENT_IP = Request.ServerVariables(”REMOTE_ADDR”)

SUBNET0 = Split(CLIENT_IP,”.”)

‘ *** Check the distribution point for the given subnet

strSQL = “SELECT Sites.Subnet, Sites.Distrib_Point FROM Sites WHERE (((Sites.Subnet)=’” & SUBNET0(2) & “‘)) GROUP BY Sites.Subnet, Sites.Distrib_Point;”

Set rstSearch = cnnSearch.Execute(strSQL)

Do While Not rstSearch.EOF

    SOURCE = rstSearch.Fields(”Distrib_Point”).Value

    rstSearch.MoveNext

Loop

‘ *** Create the download link and redirect the by using the REFRESH metatag so the package automatically starts downloading

DOWNLOAD_LINK = “http://” & SOURCE & “/download/free/” & FILE

response.write “<html><head><META http-equiv=’refresh’ content=’3;URL=” & DOWNLOAD_LINK & “‘><title>Download page for ” & FILE & “</title></head><body bgcolor=’#B1C9E9′>”

response.write “<br><center><font face=tahoma size=3 color=#006699>Your download should start automatically in 3 seconds.<br> If the download doesn’t start, click <b><a href=’” & DOWNLOAD_LINK & “‘ style=’text-decoration:none’> HERE</a></b> to download the file you requested.</center></body></html>”

‘ *** Free up some memory

Set rstSearch = Nothing

Set cnnSearch = Nothing

LogHit

Sub LogHit

    USERID = split(Request.ServerVariables(”LOGON_USER”),”\”)

    Dim DB_CONNECTIONSTRING

    DB_CONNECTIONSTRING = “Provider=Microsoft.Jet.OLEDB.4.0;Data Source=” & Server.Mappath(”db/hits.mdb”) & “;”

    Dim objRecordset

    Set objRecordset = Server.CreateObject(”ADODB.Recordset”)

    strSQL = “SELECT * FROM downloads;”

    objRecordset.Open strSQL, DB_CONNECTIONSTRING, adOpenKeyset, adLockPessimistic, adCmdText

    objRecordset.AddNew

    objRecordset.Fields(”Package”) = FILE

    objRecordset.Fields(”UserName”) = USERID(1)

    objRecordset.Fields(”IP_ADDR”) = CLIENT_IP

    objRecordset.Fields(”Date”) = Date

    objRecordset.Update

    objRecordset.Close

    Set objRecordset = Nothing

End Sub

%><head><title>..:: EIT Download Center ::..</title></head>