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

.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 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

.VBS to automatic configuration of proxy servers at Internet Explorer

Script to be used on notebooks, when a user uses a notebook inside of your company with a proxy server and at another networks without proxy servers, like home. The script execute a ping to a server (that can be the proxy server), if the ping command is successfully then Internet Explorer will be open configured to use a proxy server. If ping command fails, then Internet Explorer will be open without a proxy server.
Create a shortcut with the Internet Explorer icon with the follow address:
%windir%system32wscript.exe “c:program filesinternet explorerabrir_ie.vbs”
Continue reading