Roberto Alves

Scripting and server based computing

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

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

.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

.VBS to compare applications version on all servers

This is a very, very and very simple inventory tool. But can be very useful on sbc environments. This script checks the list of applications on Add/Remove Programs of each server, and writes a result in a table inside a html file.  Then, you can compare if all servers has same software installed or same updates!

To have a reliable Citrix or Terminal Services environment, you need ensure that all servers on each silo are equal, to all users get same applications, updates, etc.

Continue reading

.VBS to search non-auto created printers on profiles

I made little modifications on this script created by Jakob Heidelberg to search for printers manually created on user profiles. This is very usefull when you wanna ensure that eveybody has only auto created printers, from Citrix or ThinPrint.

This script load ntuser.dat on each profile, check some registry keys, write a log and unload ntuser.dat. Some users can have problems to load their profiles if you use this script on the same time that they try logon.

Continue reading