This script place’s a “cmd prompt here” in the explorers context menu. This is a most for any one that uses the command often.
123456789'**************************************************************************
' File: CmdPromptExplorerMenu.vbs
'**************************************************************************
Dim WSHShell
Set WSHShell = WScript.CreateObject("WScript.Shell")
WSHShell.RegWrite "HKCR\Folder\Shell\MenuText\Command\", "cmd.exe...
Archive for the ‘VBScript’ Category
Create shortcut VBScript
Posted by John Sorensen on June 29th, 2009
1234567891011121314151617181920212223'====================================================================
' NAME: <createAddRemoveShortCut.vbs>
'
' COMMENT: Key concepts are listed below:
'1. Uses wscript.shell to create shortcut on the desktop.
'2. The hard part was passing an argument to the target, which is not allowed
'3. in the target argument. You need to use the arguments property instead.
'====================================================================
Option Explicit
Dim objShell...
List all computers in Domain
Posted by John Sorensen on June 14th, 2009
1234567891011121314151617181920212223242526272829303132333435' Run this script via cscipt other wise edit to direct output to text file
' ListComputers.vbs
Dim RootDSE, DomainNC, Connection, Command, RecordSet
' CALLOUT A
Set RootDSE = GetObject("LDAP://rootDSE")
DomainNC = RootDSE.Get("defaultNamingContext")
' END CALLOUT A
Set Connection = CreateObject("ADODB.Connection")
Connection.Open("Provider=ADsDSOObject;")
Set...
Lists Domain Controllers
Posted by John Sorensen on June 13th, 2009
123456789101112131415161718192021222324252627282930313233343536373839' Lists all domain controllers in domain
'
' Run this via Cscript or direct output to text
'
' ListDCs.vbs
Dim RootDSE, ConfigNC, Connection, Command, RecordSet, DC
' CALLOUT A
Set RootDSE = GetObject("LDAP://rootDSE")
ConfigNC = RootDSE.Get("configurationNamingContext")
' END CALLOUT A
Set Connection = CreateObject("ADODB.Connection")
Connection.Open("Provider=ADsDSOObject;")
Set...
Barracuda Spam Firewall Stats VBScript
Posted by John Sorensen on April 28th, 2009
I found this script buried in the barracuda forums. It grabs the stats (XML) and creates a CSV file and formats it.
The following are the instructions to use the VBScript later in this post:
1. Create a text file and rename it to Barracuda Stats to CSV – Pivot Tables.vbs or whatever you want – as long as it ends in .vbs.
2. Copy the VBScript code below and edit the URL to your stats page between the quotes for the variable sMyBarraCudaStatsPage.
a. For example: sMyBarracudaStatsPage=”http://microsoft-barracuda:8000/cgi-bin/stats.cgi?”
b....
Working with AD Groups
Posted by John Sorensen on February 10th, 2009
This is a collection of scripts and snippets for working Active Directory
Adding 1,000 Users to a Security Group
Demonstration script that creates a security group named Group1, and adds one thousand users (UserNo1 through UserNo10000) to that group. This script is not intended for use in a production environment.
1234567891011121314Const ADS_PROPERTY_APPEND = 3
Set objRootDSE = GetObject("LDAP://rootDSE")
Set objContainer = GetObject("LDAP://cn=Users," &...


Posted in