0

Code snippets : CMD : Dump Windows Server DHCP configuration

-

If you need to capture configuration of Windows-based DHCP server for documentation or review purposes, this might be handy:

netsh -r lab-dc-01 dhcp server dump > C:\dhcp-lab-dc-01.txt

NOTE: lab-dc-01 in example command is name of the Windows server which has DHCP installed.

Example DHCP server dump from Windows Server 2008 R2 you can see here. It contains one scope for subnet 172.16.90.0/24, option for DNS and default gateway defined.

0

Config snippets : Cisco : DHCP on Catalyst switches

-

Usually I tend to create DHCP server on Windows Server. However, sometimes there is no server on site. Only what I have are network devices, workstations and voip phones. In those cases I used to create DHCP server on switches. As environment I operate in contains mainly Cisco devices, each location has at least one or more Cisco Catalyst switches (2960 or 3560) it is possible to provide DHCP service using IOS features. Example contains DHCP configuration for network with different VLANs for data, voice and printers.

Below is short description and set of commands demonstrating how to setup:

  • DHCP scopes
  • Exclusions
  • Define DHCP helper on the interface
  • Check status of DHCP assignments

(more…)

0

Code snippets : VBscript : Ping all computers from Active Directory OU

-

Here is quick script which connects to Active Directory, reads all computer accounts from Organization Unit (OU) indicated in script and then pings all computers found in that OU. It might be handy if all server accounts are located in one OU.

(more…)

2

Code snippets : SQL : Backup and FTP transfer SQL Server database

-

Some time ago I had to transfer SQL Server databases from remote retail locations to central system. At that time whol einfrastructure was operating on Microsoft SQL server 2000 and link in remote locations was 128kb/s ISDN. At that time I thought that the best idea will be backup database to local hard disk on SQL server, RAR it and FTP compressed backup of SQL database to headquater. It did work quite well. So, below is a script I scheduled to be run as part of scheduled job defined on SQL Server Agent.

Before script will be used few things have to be customized:

  • location for database backups – @archive_path – default: F:\Backup
  • location of WinRAR application – @archive_cmd – default: C:\Program Files\WinRAR
  • IP address of FTP server – default: 192.168.10.120
  • Username and password for FTP user – default: dbupload/password
  • Folder on FTP server for backup upload – default: Site_Backup

As there might ba many remote sites uploading backups, each site can have different folder for data transfer.

Here is script to backup SQL Server database and trasfer backup to FTP server:

(more…)

0

Code snippets : VBscript : Change local admin username and password

-

Script I used as computer statup script pushed via GPO. It renames local Administrator to Admin and sets password for Admin account to one specified in script.
(more…)

1

Code snippets : VBscript : Change My Computer icon description

-

Script changes description of My Computer icon to display Computer: ComputerName

Can be very handy when troubleshooting computer remotely when we require user to tell us name of the computer user works on.
Script works on Windows 2000/XP/Vista/7.

(more…)