Home arrow Howto's arrow Howto - Scripting
Howto - Scripting
A Startup Script that Ensures Government's File Compliance PDF Print E-mail
Written by David Noel-Davies   

 
ImageAs any contractor who has worked within the public sector will know, Government Departments establish strict security guidelines and standards that all agencies must follow in their networks.
 
Many of the requirements can seem daunting. at first, For example, Windows desktops must be configured to treat 48 different file types with care. To make the registry settings needed to comply with established requirements for these file types.
Read more...
 
Automatic script to delete old files PDF Print E-mail
Written by David Noel-Davies   

ImageIn many organizations, users are given access to network drives on a file or print server on which they can store documents. but many users create folders and files indiscriminately. and as you probably know within a few months, these folders and files accounted for several gigabits of storage space.

 

Moving extraneous files and folders is time consuming at best and it uses time that could well be better spent with more proactive tasks that are sitting in your to do list! Administrators typically manually delete old files, which requires opening each subfolder and checking file dates.

 


Read more...
 
Managing Windows Networks Using Scripts - Part 7: Troubleshooting the Mystery Error PDF Print E-mail
Written by David Noel-Davies   

In the previous article we took our ChangeIPAddress.vbs script developed earlier and modified it to use it to change the IP address on a remote computer. Here's what our modified script looked like:

Option Explicit
Dim objWMIService
Dim objNetAdapter
Dim strComputer    
Dim strAddress    
Dim arrIPAddress
Dim arrSubnetMask
Dim colNetAdapters
Dim errEnableStatic

If WScript.Arguments.Count = 0 Then
     Wscript.Echo "Usage: ChangeIPAddress.vbs new_IP_address"
     WScript.Quit
End If

strComputer = "xp2"
strAddress = Wscript.Arguments.Item(0)
arrIPAddress = Array(strAddress)
arrSubnetMask = Array("255.255.255.0")
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colNetAdapters = objWMIService.ExecQuery("Select * from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE")
For Each objNetAdapter in colNetAdapters
     errEnableStatic = objNetAdapter.EnableStatic(arrIPAddress, arrSubnetMask)
Next

The line:

strComputer = "xp2"

tells us that the computer targeted by the script has the name XP2. The remote computer XP2 initially had an IP address of 172.16.11.43.

Read more...
 
Managing Windows Networks Using Scripts - Part 6: Remote Scripting First Steps PDF Print E-mail
Written by David Noel-Davies   

Let's go back to the script ChangeIPAddress.vbs that we developed to change the IP address of a network adapter:

Option Explicit
Dim objWMIService
Dim objNetAdapter
Dim strComputer    
Dim strAddress    
Dim arrIPAddress
Dim arrSubnetMask
Dim colNetAdapters
Dim errEnableStatic

If WScript.Arguments.Count = 0 Then
     Wscript.Echo "Usage: ChangeIPAddress.vbs new_IP_address"
     WScript.Quit
End If

strComputer = "."
strAddress = Wscript.Arguments.Item(0)
arrIPAddress = Array(strAddress)
arrSubnetMask = Array("255.255.255.0")
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colNetAdapters = objWMIService.ExecQuery("Select * from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE")
For Each objNetAdapter in colNetAdapters
     errEnableStatic = objNetAdapter.EnableStatic(arrIPAddress, arrSubnetMask)
Next

Read more...
 
Managing Windows Networks Using Scripts - Part 5: Getting Over the Hump PDF Print E-mail
Written by David Noel-Davies   

In the previous article in this series we started exploring what we could do with the Win32_NetworkAdapterConfiguration class. This powerful WMI class has 61 properties and 41 methods that can be used for retrieving and changing TCP/IP networking settings on Windows computers.

To illustrate the power of this class, we took the sample script we developed in the first and second articles and, using information about this class on MSDN, we customized our original script to make it do something different. Specifically, we took a script that changed the IP address of a network adapter and customized it to come up with a new script that disables NetBIOS over TCP/IP (NetBT) on all network adapters that have TCP/IP bound and enabled on them.

We need to explore this powerful WMI class further, and we're going to do so in several future articles. But before we do this, let's talk about The Hump.

Read more...
 
<< Start < Prev 1 2 3 4 Next > End >>

Results 1 - 9 of 29
Powered by IT CONTRACTORS and designed by EZPrinting web hosting