Posts Tagged ‘Scripts’

VBScript to show current Teamviewer ID and save to text file

Since TeamViewer can be rolled out in an organization with the MSI package and sample vbs scripts from TeamViewer, I was asked if it would be hard to do a small VBScript to fetch the TeamViewer ID from theese machines and save it somewhere for the support staff to look up in.

This script is a very simple example of how to fetch the ID on a machine from registry and save that together with current logged in user and machine name in text files. To change this to save into another system, database, etc. would be quite simple.

But by creating a share with write permissions from everyone and pointing this script to it and placing it during login for all users in a domain, it would be easy to find a given machine or users TeamViewer ID. Since the TeamViewer ID does not change for a machine, it could be just run on machines when the TeamViewer client is installed, but that is entirely up to you. Read the rest of this entry »

Active Directory Shadow Group Script – will let you spend less time on updating group memberships

Introduction
If you are just looking for a free shadow group script, either click here for a nice simple one or go to the bottom of this post for the full AD administrated script.

I was looking into Shadow Groups, inspired by a customer migrating from Novell to Active Directory. Apparently in Novell you can use Organizational Units as security groups, and by just moving a user to another OU when they change departments, they will automatically update their security permissions given by their department OU placement.

So what is so great about shadow groups you might ask. Simply put if you have OU’s for departments, where you place users depending on department membership, shadow groups, will shadow the members of the OU in the security group, I assume that is where the name shadow group comes from. This allows you to setup security permissions for a group that is linked to an organizational unit. So when you move user A from department sales, into department accounting, the user A will automatically be removed from the sales security group and added to the accounting security group, effectively updating user A’s permissions automatically. Saves time for large organizations, now a user moving OU does not need to have his groups manually updated.

The first hit on google was a blog post by John Policelli (MVP) explaining shadow groups is not a new type of group in Active Directory, it is rather a concept, when you automatically update the members of a security group from the objects placed in an Organizational Unit. Also he points out that this automatic synchronization is not an existing feature in Windows Server, we need to add it our self. The example he uses with dsquery, dsget and dsmod, works if you manually set it in a script for each OU/Group, I was looking for something easier to manage, that preferably did not require editing of the script that needed to run. I strongly believe scripts that can be maintained from Active Directory will always have a longer life time, since less updates and potential errors happen in the script.

After some more searching I found an article by Jakob H. Heidelberg (MVP and fellow Dane) this one also had a good explanation about what Shadow Groups are and also a download link to a simple VBScript to populate a group with the users in an Organizational Unit. If You are looking for a script to feed the OU and Group and then update the group from the users of the OU, that script will do you just fine and I would recommend you take a look at the article and script he wrote, as it is simpler and less prone to errors by being simple.

My idea of a Shadow Group Script Read the rest of this entry »

VBScript to remove network printers, when RemovePrinterConnection fails and still have time for popcorn and a movie

For the last couple of months, and some months ahead, I am working primarely on migration projects, currently I have just finished developing a lot of scripts to automatically migrate from Novell & ZenWorks to a purely Microsoft environment. So I might share some tips and tricks from my experiences.

Novell LogoTrying to uninstall Novell printers automatically with VBScripting in a login script gave me a headache, for some reason the good old function WshNetwork.RemovePrinterConnection would fail every time trying to uninstall a Novell printer. After some searching and testing I found that by executing a command to RUNDLL32 PRINTUI.DLL,PrintUIEntry, I could successfully uninstall the printers. My personal experience shows no warnings or errors to the user, as long as the computer can still access Novell, however I did have some warning messages appear when the computer could not connect, but the printer was still deleted, and the user could not abort it, so in my book thats a success!

Also i found some examples removing the printers with /dn instead of the /dl that I am using Read the rest of this entry »