Roberto Alves

Scripting and server based computing

Re-enable toolbars in Excel 2003

Sometimes you can be very surprised with the amount of irresponsible people doing some code as vbs scripts, programs or even simple excel macros that can negatively affect production environments.

Last week I got a very simple problem, that can be frustrating for a user. Some external partner of my company created a Excel spreadsheet with a macro that disable all toolbars and hide Excel menus. Basically, the macro cleans all Excel screen, transforming the spreadsheet into something similar to a Visual Basic program.
Continue reading

Easily running commands in all servers/workstations

Sometimes we are diving into so many tools, products, technologies, etc that we forgot simple and old tools that can save the day or at least save a good time. I will give as example the Sysinternals psexec, that is very useful to run remote commands.

Let’s imagine that you need force a policy update in all servers or workstations. May be, your first thought can be:  “I can create a script that reads a file with a list of servers/workstations, after read the file, the script can run processes using a WScript.Shell object. After ran the process in each server the script can get a result and save a file with the task results.” Of course that this script will take some time to write and probably will have some dozens of code lines.

Or, you can do the same task just with one line of command.
Continue reading

.vbs script to restrict access only from internet to Citrix XenApp or TS servers

This vbs script consist into two verifications to restrict access of users from internet in Citrix XenApp (Presentation Server/Metaframe) servers or Terminal Services, to be included in the session initialization. The idea of this script allow access from users from Internet just if they are in a specific Active Directory group.

In the first verification, the script checks if the current user belongs to a group called “Remote Workers. If yes, the script jumps to the end. If no, the script goes to the second verification.
Continue reading

Simple and better solution to redirect local drives in XenApp sessions

ICA or RDP are not the best protocols to copy files between DataCentres and remote workstations. But, some times is very difficult to implement a different solution to provide access to users local files from Citrix XenApp or Terminal Services, and even if the idea was rejected in the design of your environment, one day you will be faced with this problem and may be your easiest and better option will be enable redirection from local drives to remote sessions.

Well, you can select if you want map/redirect floppy disks, cd roms, remote drives or local drives. If you are worried with the impact of this configuration in the logon time of your users, probably you will enable just the redirection for local drives and unfortunatelly you will consider that many users can have more than one local drive and this can affect their logon.
Continue reading

Is Citrix FastLaunch a good option to improve logon time of Citrix XenApp sessions?

In this month Citrix released a new utility called FastLaunch. This is not a official supported utility or even a tech preview. It is just a very small utility made by IT guys in Citrix to “hold” Citrix sessions, providing to users reconnect their sessions every time, instead to logon again.

This tool was created some time ago and Citrix didn’t made available because they faces a interesting problem caused by the community involvement. Someone shows the utility in a Citrix event, then other one put a video in internet talking about the utility, and a lot of people become to ask for downloads or to Citrix include the utility in XenApp.

But, the “magic” utility is not a dream for almost Citrix administrators pissed off by users complaining about slow logons. In almost cases, this utility can be a major problem, witch means that you need to be very careful before publish to production users.
Continue reading

XML-based map network drives for login scripts

I found at VisualBasicScript.com Forum a very useful script wrote by a user called “ginolard”, that can be used at login scripts or if you need, you can use the basic structure of this script into others scripts with different proposes.

Basically, this script read a XML file and execute mapnetwork commands considering the information gathered. The great advantage of use this model (scripts reading XML or INI files to get information), is that you can keep the same script for a long time without amends.
Continue reading

Automating project documentations with AutoIT

One picture say more than a thousand words. Because this in some cases I like to include a lot of images on my project documentations. Generally, these pictures are PrintScreens of consoles and their configurations and diagrams that explain some funcionality.

Benefits when you use pictures instead pure text on project documentations:

  • You are sure that all configurations of that screen was documented;
  • It’s easy to read and find what configuration you want (if you organize on chapters);
  • Is more simple to update the documentation, after change configurations;
  • Is more clear that you made the documented configurations;
  • Using scripts you can document everything using a read-only console, without “admin” access to controls or configurations;

Continue reading

.VBS Copying files to many locations

This is a very simple script that copies a folder from a specific path to all servers listed on servers.txt file.

There is a file called progress.htm that runs an activeX control that shows a progress bar, that increases when the copy is done on each server.

On Error Resume Next

source_server = “machine_name”
source = “c$InstallCPS45HF”

Dim server()

Set objFSO = CreateObject(“Scripting.FileSystemObject”)

Continue reading

.VBS to remap network drivers after file server migrations

Very useful on File Servers migrations, this script was created and used on login script of 1000+ users after migration from Novell file server to a new Windows file server. The script reduces the calls on service desk after migration, reading what mapped drivers each user has and creating a new mapped driver.

Basically, you need specify share names that you wanna modify and put this script to run on login script. After a file server migration, users run login script and remap automatically network drivers.

Continue reading