Howto: Mount a Windows share on SLES linux using cifs


This post is mainly for my own benefit.  I mount Windows shares on my SuSE linux box so infrequently, I have to dig through past notes to remind myself what the syntax is.

To mount a Windows share on SLES linux using cifs:

mount -t cifs -o username=jsmith //po5/gwdompri /mnt/po5/gwdompri

where:
  • jsmith is the user account to authenticate as
  • //po5/gwdompri is the Windows server and share you wish to mount
  • /mnt/po5/gwdompri is the location to mount the share, or where you access it on the local Linux box.
Note:
  •  you will be prompted for the password 
  • /mnt/po5/gwdompri must exist

Howto: Use msizap to remove orphaned cached Windows Installer Data Files to increase free disk space


Msizap is a command-line tool that can delete the configuration data that Windows Installer maintains for products that it installs, including the directories, files, registry subkeys, and registry entries in which Windows Installer stores configuration data.

Running msizap.exe with the G parameter removes orphaned cached Windows Installer data files for all users. Running this command on an old Windows XP machine allowed me to reduce the size of the C:\Windows\Installer directory from 3.6GB down to 875MB.

This computer had so many orphaned files due to the constant installation and uninstallation of software such as Java, Flash, Acrobat Reader, and other utility software over the years. Yes, orphaned files persist on your hard drive despite following proper uninstall procedures.

To run msizap, login to the machine as an administrative user and launch a command window. Navigate to the directory that contains msizap.exe, then type the following command:

msizap !G

The G option removes the orphaned cache files, the exclamation point forces a ‘yes’ response to any prompt.

While removing orphaned files should not have any negative impact on your Windows installation, be aware that msizap is a powerful tool that can cause problems if used incorrectly.

Msizap can be downloaded as a part of the Microsoft Windows Server 2003 Support Tools or the Windows Installer CleanUp Utility. I was unable to find the Windows Installer CleanUp Utility by searching Microsoft’s download site, so note that as of today the file’s name is msicuu2.exe if you the above link goes dead in the future.

If you don’t want to install the Windows Installer CleanUp Utility, use a program such as Universal Extractor (aka UniExtract) to extract the individual files. Once you extract the files, you’ll notice msizap.exe does not exist, but you will find MsiZapA.exe and MsiZapU.exe.

There are two versions of MSIZAP.EXE: MsiZapA.exe (for use in Windows 95, Windows 98 and Windows ME), and MsiZapU.exe (for use in Windows NT, Windows 2000, Windows XP, and Windows Server 2003). The appropriate executable should be renamed MsiZap.exe.

Current msizap.exe options are as follows:

Usage: msizap T[WA!] {product code}
msizap T[WA!] {msi package}
msizap *[WA!] ALLPRODUCTS
msizap PWSA?!

* = remove all Windows Installer folders and regkeys;
adjust shared DLL counts; stop Windows Installer service
T = remove all info for given product code
P = remove In-Progress key
S = remove Rollback Information
A = for any specified removal, just change ACLs to Admin Full Control
W = for all users (by default, only for the current user)
M = remove a managed patch registration info
G = remove orphaned cached Windows Installer data files (for all users)
? = verbose help
! = force ‘yes’ response to any prompt

For more information on the Windows Installer Cleanup Utility and msizap.exe see KB290301.

Howto: Generate many files of a particular size in Windows


I was recently performing some performance testing that required me to copy many files of a particular size from one Windows XP workstation to a Windows 2003 server. I had a heck of a time figuring out how to batch generate the test files.

Finally I cam across the fsutil tool, which is included on both Windows XP and Windows Server 2003.

The syntax for using fsutil is:

fsutil file createnew filename filesize

I used a simple loop to create files of a particular size using fsutil. Running from a command prompt:

For /L %i in (1,1,25000) do fsutil file createnew A%i.tmp 12288

will create 25,000 files of 12288 bytes (12KB) named A1.tmp, A2.tmp, A3,tmp…

to run this loop in a .cmd file instead of from the command line replace single % with double percent signs

For /L %i in (1,1,10000) do fsutil file createnew B%i.tmp 65536

will create 10,000 files of 65536 bytes (64KB) named B1.tmp, B2.tmp, B3,tmp…

For /L %i in (1,1,2500) do fsutil file createnew C%i.tmp 131072

will create 2,500 files of 131072 bytes (128KB) named C1.tmp, C2.tmp, C3,tmp…

For /L %i in (1,1,1000) do fsutil file createnew D%i.tmp 1048576

will create 1,000 files of 1048576 bytes (1024KB or 1MB) named D1.tmp, D2.tmp, D3,tmp…

I was able to create hundreds of thousands of files of a very specific size in a short amount of time using this procedure.

The deltree command equivalent for Windows 2000, Windows XP, Windows Server 2003, and beyond


Good old DOS and versions of Windows prior to Windows 2000 included the deltree.exe command. The deltree command could remove a directory and all the files the directory contained. Subdirectories could also be deleted when the /s option is used. This was extremely helpful for removing a directory structure that contained many files and folders. It’s usually much faster to delete files from the command line, rather than through Windows Explorer.

To remove multiple levels of files and directories in Windows operating systems that do not have deltree.exe, use the rd.exe or rmdir.exe command:

rd directoryname /s
or
rmdir directoryname /s

where directoryname is the name and path to the directory you want to remove. This will also delete all files and subdirectories.

Use the following command to remove all files from a directory and it’s subdirectories while maintaining the directory structure:

del *.* /s /q

This uses the del.exe command to delete all files from the current directory and subdirectories. The /q option instructs del.exe to run in quiet mode and not to prompt you to remove every folder it encounters.

Howto: Use DiskPart.exe with BartPE and Windows Server 2003 to align the boot disk partition before Windows Server setup runs


You can’t run DiskPart to align the boot partition during Windows setup, so we’ll need to create the partition prior to starting setup.  We’ll need the Windows Server CD/DVD and a copy of BartPE to accomplish this.

1)  Download the BartPE Windows live CD/DVD and extract the contents.
 
 
To summarize, you’ll need to create a /diskpartition directory inside BartPE’s /plugins directory.  Inside the /diskpartition directory, create a text file named diskpartition.inf.  
 
Copy and paste the following into diskpartition.inf, then save the file 
[Version]
Signature= "$Windows NT$"</div>
[PEBuilder]
Name="Diskpart functionality in Win2k3 - SP1 only"
; Assisted with this understanding was:
; http://support.microsoft.com/?kbid=910380
; http://technet2.microsoft.com/WindowsServer/en/Library/89c3a36a-d3e2-4462-8893-7a384b118c6b1033.mspx
; http://windowssdk.msdn.microsoft.com/library/default.asp?url=/library/en-us/vds/base/vds_interfaces.asp
Enable=1

[SourceDisksFiles]
Ftdisk.sys=4
Partmgr.sys=4
Volsnap.sys=4
Swprv.dll=2
Eventcls.dll=2
Vssadmin.exe=2
Vssapi.dll=2
Vssui.dll=2
Vssvc.exe=2
Vss_ps.dll=2
Diskpart.exe=2

[Default.AddReg]
; Runs dependent DLL registration for Application usage
; 0x1= REG_SZ
; 0x2= REG_EXPAND_SZ
; 0x1, "Software\Microsoft\Windows\CurrentVersion\Run", "DiskPartSupport", "%systemroot%\system32\regsvr32.exe /s %systemroot%\system32\vss_ps.dll"
; removed because the reg key is not read unless you use explorer as a shell.

[SetupReg.AddReg.3790]
; Win2k3 SP1 Only: RpcSS needs to lanuch DComLaunch Service first.
0x7, "ControlSet001\Services\RpcSs","DependOnService","DcomLaunch"

; New DComLaunch Service in Win2k3 SP1
0x1,"ControlSet001\Services\DcomLaunch","Description","DCOM Services"
0x1,"ControlSet001\Services\DcomLaunch","DisplayName","DCOM Services"
0x4,"ControlSet001\Services\DcomLaunch","ErrorControl",0x1
0x1,"ControlSet001\Services\DcomLaunch","Group","<a target="_blank">Event Log</a>"
0x2,"ControlSet001\Services\DcomLaunch","ImagePath","svchost -k DcomLaunch"
0x1,"ControlSet001\Services\DcomLaunch","ObjectName","LocalSystem"
0x4,"ControlSet001\Services\DcomLaunch","Start",0x2
0x4,"ControlSet001\Services\DcomLaunch","Type",0x20
0x3,"ControlSet001\Services\DcomLaunch","FailureActions",\
00,00,00,00,00,00,00,00,00,00,00,00,01,00,00,00,00,00,00,00,02,00,00,00,60,\
ea,00,00
0x1,"ControlSet001\Services\DcomLaunch\Enum","0","Root\LEGACY_DCOMLAUNCH000"
0x4,"ControlSet001\Services\DcomLaunch\Enum","Count",0x1
0x4,"ControlSet001\Services\DcomLaunch\Enum","NextInstance",0x1
0x2,"ControlSet001\Services\DcomLaunch\Parameters","ServiceDll","rpcss.dll"
0x3,"ControlSet001\Services\DcomLaunch\Security","Security",\
01,00,14,80,b4,00,00,00,c0,00,00,00,14,00,00,00,34,00,00,00,02,00,20,00,01,\
00,00,00,02,80,18,00,ff,01,0f,00,01,01,00,00,00,00,00,01,00,00,00,00,20,02,\
00,00,02,00,80,00,05,00,00,00,00,03,18,00,8d,00,02,00,01,01,00,00,00,00,00,\
01,00,00,00,00,00,00,00,00,00,03,18,00,ff,01,0f,00,01,02,00,00,00,00,00,05,\
20,00,00,00,20,02,00,00,00,03,18,00,8f,00,02,00,01,02,00,00,00,00,00,05,20,\
00,00,00,23,02,00,00,00,03,18,00,9d,00,00,00,01,01,00,00,00,00,00,05,04,00,\
00,00,23,02,00,00,00,03,18,00,9d,00,00,00,01,02,00,00,00,00,00,05,20,00,00,\
00,21,02,00,00,01,01,00,00,00,00,00,05,12,00,00,00,01,01,00,00,00,00,00,05,\
12,00,00,00

0x1,"ControlSet001\Enum\Root\LEGACY_DCOMLAUNCH000","Service","DcomLaunch"
0x4,"ControlSet001\Enum\Root\LEGACY_DCOMLAUNCH000","Legacy",0x1
0x4,"ControlSet001\Enum\Root\LEGACY_DCOMLAUNCH000","ConfigFlags",0x0
0x1,"ControlSet001\Enum\Root\LEGACY_DCOMLAUNCH000","Class","LegacyDriver"
0x1,"ControlSet001\Enum\Root\LEGACY_DCOMLAUNCH000","ClassGUID","{8ECC055D-047F-11D1-A537-0000F8753ED1}"
0x1,"ControlSet001\Enum\Root\LEGACY_DCOMLAUNCH000","DeviceDesc","DCOM Services."
0x1,"ControlSet001\Enum\Root\LEGACY_DCOMLAUNCH000\Control","ActiveService","DcomLaunch"
0x4,"ControlSet001\Enum\Root\LEGACY_DCOMLAUNCH","NextInstance",0x1

[Software.AddReg]
0x1,"Classes\CLSID\{E0393303-90D4-4A97-AB71-E9B671EE2729}",,"VDS ProxyStub"
0x2,"Classes\CLSID\{E0393303-90D4-4A97-AB71-E9B671EE2729}\InprocServer32",,"%SystemRoot%\System32\vds_ps.dll"
0x1,"Classes\CLSID\{E0393303-90D4-4A97-AB71-E9B671EE2729}\InprocServer32","ThreadingModel","Both"

0x1,"Classes\CLSID\{F2C2787D-95AB-40D4-942D-298F5F757874}",,"PSFactoryBuffer"
0x2,"Classes\CLSID\{F2C2787D-95AB-40D4-942D-298F5F757874}\InprocServer32",,"%SystemRoot%\System32\vds_ps.dll"
0x1,"Classes\CLSID\{F2C2787D-95AB-40D4-942D-298F5F757874}\InprocServer32","ThreadingModel","Both"

0x1,"Classes\Interface\{88306BB2-E71F-478C-86A2-79DA200A0F11}",,"IVdsVolume"
0x1,"Classes\Interface\{88306BB2-E71F-478C-86A2-79DA200A0F11}\ProxyStubClsid32",,"{E0393303-90D4-4A97-AB71-E9B671EE2729}"
0x1,"Classes\Interface\{9882F547-CFC3-420B-9750-00DFBEC50662}",,"IVdsCreatePartitionEx"
0x1,"Classes\Interface\{9882F547-CFC3-420B-9750-00DFBEC50662}\ProxyStubClsid32",,"{E0393303-90D4-4A97-AB71-E9B671EE2729}"
0x1,"Classes\Interface\{98F17BF3-9F33-4F12-8714-8B4075092C2E}",,"IVdsHwProviderPrivate"
0x1,"Classes\Interface\{98F17BF3-9F33-4F12-8714-8B4075092C2E}\ProxyStubClsid32",,"{E0393303-90D4-4A97-AB71-E9B671EE2729}"
0x1,"Classes\Interface\{9AA58360-CE33-4F92-B658-ED24B14425B8}",,"IVdsSwProvider"
0x1,"Classes\Interface\{9AA58360-CE33-4F92-B658-ED24B14425B8}\ProxyStubClsid32",,"{E0393303-90D4-4A97-AB71-E9B671EE2729}"
0x1,"Classes\Interface\{CB53D96E-DFFB-474A-A078-790D1E2BC082}\ProxyStubClsid32",,"{E0393303-90D4-4A97-AB71-E9B671EE2729}"
0x1,"Classes\Interface\{D188E97D-85AA-4D33-ABC6-26299A10FFC1}",,"IVdsAdmin"
0x1,"Classes\Interface\{D188E97D-85AA-4D33-ABC6-26299A10FFC1}\ProxyStubClsid32",,"{E0393303-90D4-4A97-AB71-E9B671EE2729}"
0x1,"Classes\Interface\{D5D23B6D-5A55-4492-9889-397A3C2D2DBC}",,"IVdsAsync"
0x1,"Classes\Interface\{D5D23B6D-5A55-4492-9889-397A3C2D2DBC}\ProxyStubClsid32",,"{E0393303-90D4-4A97-AB71-E9B671EE2729}"
0x1,"Classes\Interface\{D99BDAAE-B13A-4178-9FDB-E27F16B4603E}",,"IVdsHwProvider"
0x1,"Classes\Interface\{D99BDAAE-B13A-4178-9FDB-E27F16B4603E}\ProxyStubClsid32",,"{E0393303-90D4-4A97-AB71-E9B671EE2729}"
0x1,"Classes\Interface\{DAEBEEF3-8523-47ED-A2B9-05CECCE2A1AE}",,"IVdsMaintenance"
0x1,"Classes\Interface\{DAEBEEF3-8523-47ED-A2B9-05CECCE2A1AE}\ProxyStubClsid32",,"{E0393303-90D4-4A97-AB71-E9B671EE2729}"
0x1,"Classes\Interface\{E0393303-90D4-4A97-AB71-E9B671EE2729}",,"IVdsServiceLoader"
0x1,"Classes\Interface\{E0393303-90D4-4A97-AB71-E9B671EE2729}\ProxyStubClsid32",,"{E0393303-90D4-4A97-AB71-E9B671EE2729}"
0x1,"Classes\Interface\{9882F547-CFC3-420B-9750-00DFBEC50662}",,"IVdsCreatePartitionEx"
0x1,"Classes\Interface\{9882F547-CFC3-420B-9750-00DFBEC50662}\ProxyStubClsid32",,"{E0393303-90D4-4A97-AB71-E9B671EE2729}"
0x1,"Classes\Interface\{E0393303-90D4-4A97-AB71-E9B671EE2729}",,"IVdsServiceLoader"
0x1,"Classes\Interface\{E0393303-90D4-4A97-AB71-E9B671EE2729}\ProxyStubClsid32",,"{E0393303-90D4-4A97-AB71-E9B671EE2729}"
0x1,"Classes\Interface\{0EE1A790-5D2E-4ABB-8C99-C481E8BE2138}",,"IVdsLunPlex"
0x1,"Classes\Interface\{0EE1A790-5D2E-4ABB-8C99-C481E8BE2138}\ProxyStubClsid32",,"{E0393303-90D4-4A97-AB71-E9B671EE2729}"
0x1,"Classes\Interface\{0EE1A790-5D2E-4ABB-8C99-C481E8BE2138}",,"IVdsLunPlex"
0x1,"Classes\Interface\{0EE1A790-5D2E-4ABB-8C99-C481E8BE2138}\ProxyStubClsid32",,"{E0393303-90D4-4A97-AB71-E9B671EE2729}"
0x1,"Classes\Interface\{0818A8EF-9BA9-40D8-A6F9-E22833CC771E}",,"IVdsService"
0x1,"Classes\Interface\{0818A8EF-9BA9-40D8-A6F9-E22833CC771E}\ProxyStubClsid32",,"{E0393303-90D4-4A97-AB71-E9B671EE2729}"
0x1,"Classes\Interface\{07E5C822-F00C-47A1-8FCE-B244DA56FD06}",,"IVdsDisk"
0x1,"Classes\Interface\{07E5C822-F00C-47A1-8FCE-B244DA56FD06}\ProxyStubClsid32",,"{E0393303-90D4-4A97-AB71-E9B671EE2729}"
0x1,"Classes\Interface\{0316560B-5DB4-4ED9-BBB5-213436DDC0D9}",,"IVdsRemovable"
0x1,"Classes\Interface\{0316560B-5DB4-4ED9-BBB5-213436DDC0D9}\ProxyStubClsid32",,"{E0393303-90D4-4A97-AB71-E9B671EE2729}"
0x1,"Classes\Interface\{3540A9C7-E60F-4111-A840-8BBA6C2C83D8}",,"IVdsLun"
0x1,"Classes\Interface\{3540A9C7-E60F-4111-A840-8BBA6C2C83D8}\ProxyStubClsid32",,"{E0393303-90D4-4A97-AB71-E9B671EE2729}"
0x1,"Classes\Interface\{33B87426-5C06-49F4-84BD-F486B1B4A21D}",,"IVdsMigrateDisks"
0x1,"Classes\Interface\{33B87426-5C06-49F4-84BD-F486B1B4A21D}\ProxyStubClsid32",,"{E0393303-90D4-4A97-AB71-E9B671EE2729}"
0x1,"Classes\Interface\{11F3CD41-B7E8-48FF-9472-9DFF018AA292}",,"IVdsProviderPrivate"
0x1,"Classes\Interface\{11F3CD41-B7E8-48FF-9472-9DFF018AA292}\ProxyStubClsid32",,"{E0393303-90D4-4A97-AB71-E9B671EE2729}"
0x1,"Classes\Interface\{118610B7-8D94-4030-B5B8-500889788E4E}",,"IEnumVdsObject"
0x1,"Classes\Interface\{118610B7-8D94-4030-B5B8-500889788E4E}\ProxyStubClsid32",,"{E0393303-90D4-4A97-AB71-E9B671EE2729}"
0x1,"Classes\Interface\{10C5E575-7984-4E81-A56B-431F5F92AE42}",,"IVdsProvider"
0x1,"Classes\Interface\{10C5E575-7984-4E81-A56B-431F5F92AE42}\ProxyStubClsid32",,"{E0393303-90D4-4A97-AB71-E9B671EE2729}"
0x1,"Classes\Interface\{E882C452-CF37-482A-BBFF-E6EE614E8023}",,"IVdsSwProviderPrivate"
0x1,"Classes\Interface\{E882C452-CF37-482A-BBFF-E6EE614E8023}\ProxyStubClsid32",,"{E0393303-90D4-4A97-AB71-E9B671EE2729}"
0x1,"Classes\Interface\{EE2D5DED-6236-4169-931D-B9778CE03DC6}",,"IVdsVolumeMF"
0x1,"Classes\Interface\{EE2D5DED-6236-4169-931D-B9778CE03DC6}\ProxyStubClsid32",,"{E0393303-90D4-4A97-AB71-E9B671EE2729}"
0x1,"Classes\Interface\{FF24EFA4-AADE-4B6B-898B-EAA6A20887C7}",,"IVdsDrive"
0x1,"Classes\Interface\{FF24EFA4-AADE-4B6B-898B-EAA6A20887C7}\ProxyStubClsid32",,"{E0393303-90D4-4A97-AB71-E9B671EE2729}"
0x1,"Classes\Interface\{3B69D7F5-9D94-4648-91CA-79939BA263BF}",,"IVdsPack"
0x1,"Classes\Interface\{3B69D7F5-9D94-4648-91CA-79939BA263BF}\ProxyStubClsid32",,"{E0393303-90D4-4A97-AB71-E9B671EE2729}"
0x1,"Classes\Interface\{4AFC3636-DB01-4052-80C3-03BBCB8D3C69}",,"IVdsServiceInitialization"
0x1,"Classes\Interface\{4AFC3636-DB01-4052-80C3-03BBCB8D3C69}\ProxyStubClsid32",,"{E0393303-90D4-4A97-AB71-E9B671EE2729}"
0x1,"Classes\Interface\{4DAA0135-E1D1-40F1-AAA5-3CC1E53221C3}",,"IVdsVolumePlex"
0x1,"Classes\Interface\{4DAA0135-E1D1-40F1-AAA5-3CC1E53221C3}\ProxyStubClsid32",,"{E0393303-90D4-4A97-AB71-E9B671EE2729}"
0x1,"Classes\Interface\{54D1F9E3-7FD3-421A-AF9C-53C2D8EE5BCF}",,"IVdsOwnershipChangeQuery"
0x1,"Classes\Interface\{54D1F9E3-7FD3-421A-AF9C-53C2D8EE5BCF}\ProxyStubClsid32",,"{E0393303-90D4-4A97-AB71-E9B671EE2729}"
0x1,"Classes\Interface\{6E6F6B40-977C-4069-BDDD-AC710059F8C0}\ProxyStubClsid32",,"{E0393303-90D4-4A97-AB71-E9B671EE2729}"
0x1,"Classes\Interface\{6FCEE2D3-6D90-4F91-80E2-A5C7CAACA9D8}",,"IVdsSubSystem"
0x1,"Classes\Interface\{6FCEE2D3-6D90-4F91-80E2-A5C7CAACA9D8}\ProxyStubClsid32",,"{E0393303-90D4-4A97-AB71-E9B671EE2729}"
0x1,"Classes\Interface\{8326CD1D-CF59-4936-B786-5EFC08798E25}",,"IVdsAdviseSink"
0x1,"Classes\Interface\{8326CD1D-CF59-4936-B786-5EFC08798E25}\ProxyStubClsid32",,"{E0393303-90D4-4A97-AB71-E9B671EE2729}"

 
3) From the BartPE directory, run pebuilder.exe.  Configure the source to point to your Windows Server 2003 .iso file or installation file source
 
4)  Press the plugins button and configure RpcSS Needs to launch DComLaunchService first – SP2 only to enabled and select Close
 
5)  Build the BartPE CD, burn it and boot it on your soon-to-be Windows server
 
6)  If needed, press F6 to specify your server’s storage drivers from a floppy, CD, DVD, or USB drive
 
7) No need to start BartPE networking, but it won’t hurt anything if you do
 
8 ) From the GO menu, select Run and type in Diskpart
 
9)  Type: Select Disk 1
 
10) Create your boot partition and specifiy the alignment by typing:
 
Create partition primary align=64
 
align=64 is the suggested number, but depending on what your system is going to be used for, you may chose to use 32, 64, 128, or some other number that is divisible by 8KB.
 
This will use all the free disk space to create the boot partition.  If you don’t want that, specify the size=xxxxx  option when creating the partition, where xxxxx is the partition size in megabytes:
Create partition primary size=20480 align=64
 
11)  Exit DiskPart and BartPE.  Boot from the Windows Server 2003 CD/DVD
 
12) If needed, press F6 to specify your server’s storage drivers from a floppy, CD, DVD, or USB drive
 
13) At the setup screeen that displays the paritions, choose the partition we just created to install Windows onto by pressing enter.  Continue with setup as normal.

Microsoft has finally fixed their methodology for disabling Autorun on Windows operating systems


Technet article 91525 describes a registry key that can be set to disable the Autorun feature in Windows operating systems. 

The registry key is NoDriveTypeAutoRun, which can be found at HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer

This key disables the Autoplay feature on all drives of the type specified.  Autoplay begins reading from a drive as soon as media is inserted in the drive. As a result, the setup file of programs and the sound on audio media starts immediately.

Unfortunately, this key did not produce the desired result of disabling the Double Click and Contextual Menu features.  Microsoft just released KB 953252, which describes how to obtain updates that correct these broken registry key settings in the following Windows Operating Systems:

Windows 2000
Windows XP Service Pack 2
Windows Server 2003 Service Pack 1 and 2
Windows Vista

Note: Windows Server 2008 is not affected.

The main purpose of Autorun is to provide a software response to hardware actions that you start on a computer. Autorun has the following features:

• Double Click
• Contextual Menu
• AutoPlay

These features are typically called from removable media or from network shares. During AutoPlay, the Autorun.inf file from the media is parsed. This file specifies which commands the system runs. Many companies use this functionality to start their installers.

Please see KB 952252 for security updates to each applicable operating system to disable autorun capabilities.  This KB also describes Group Policy settings to disable all Autorun features, plus instructions on selectively disabling specific Autorun features.

If you’re still not sure why you’d want to disable Autorun, check out Scott’s article on Autorun attacks.

Mark’s Windows 2008 DNS Server Command Line Cheat Sheet


If you’re a command line type administrator like myself you’ll want to check out Mark’s Mark’s DNS Server command line cheat sheet. He’s summarized the Windows Server 2008 CLI commands relating to DNS administration.

Function

DNSCMD option

Example

Comments

Do any dnscmd command on a remote system

dnscmd servername command

dnscmd main.bigfirm.com /zoneprint bigfirm.com

 

Create a primary zone

dnscmd /zoneadd zonename /primary

dnscmd /zoneadd bigfirm.com /primary

 

Create a secondary zone

dnscmd /zoneadd zonename /secondary master IP address

dnscmd /zoneadd bigfirm.com /secondary 192.168.1.1

 

Host a zone on a server based on an existing (perhaps restored) zone file

dnscmd /zoneadd zonename /primary /file filename /load

dnscmd /zoneadd bigfirm.com /primary /file bigfirm.com.dns /load

 

Delete a zone from a server

dnscmd /zonedelete zonename [/f]

dnscmd /zonedelete bigfirm.com /f

(without the /f, dnscmd asks you if you really want to delete the zone)

Show all of the zones on a DNS server

dnscmd /enumzones

dnscmd /enumzones

 

Dump (almost) all of the records in a zone

dnscmd /zoneprint zonename

dnscmd /zoneprint bigfirm.com

Doesn’t show glue records.

Add an A record to a zone

dnscmd /recordadd zonename hostname A ipaddress

dnscmd /recordadd bigfirm.com mypc A 192.168.1.33

 

Add an NS record to a zone

dnscmd /recordadd zonename @ NS servername

dnscmd /recordadd bigfirm.com @ A dns3.bigfirm.com

 

Delegate a new child domain, naming its first DNS server

dnscmd /recordadd zonename childname NS dnsservername

dnscmd /recordadd bigfirm.com test NS main.bigfirm.com

This would create the “test.bigfirm.com” DNS child domain unter the bigfirm.com DNS domain

Add an MX record to a zone

dnscmd /recordadd zonename @ MX priority servername

dnscmd /recordadd bigfirm.com @ MX 10 mail.bigfirm.com

 

Add a PTR record to a reverse lookup zone

dnscmd /recordadd zonename lowIP PTR FQDN

dnscmd /recordadd 1.168.192.in-addr.arpa 3 A pc1.bigfirm.com

This is the PTR record for a system with IP address 192.168.1.3

Modify a zone’s SOA record

dnscmd /recordadd zonename @ SOA primaryDNSservername responsibleemailipaddress serialnumber refreshinterval retryinterval expireinterval defaultTTL

dnscmd /recordadd bigfirm.com @ SOA winserver.bigfirm.com mark.bigfirm.com 41 1800 60 2592000 7200

Ignores the serial number if it’s not greater than the current serial number

Delete a resource record

dnscmd /recorddelete zonename recordinfo [/f]

dnscmd /recorddelete bigfirm.com @ NS main.bigfirm.com /f

Again, “/f” means “don’t annoy me with a confirmation request, just do it.”

Create a resource record and incorporate a nonstandard TTL

dnscmd /recordadd zonename leftmostpartofrecord TTL restofrecord

dnscmd /recordadd bigfirm.com pc34 3200 A 192.168.1.4

 

Reload a zone from its zone file in \windows\system32\dns

dnscmd /zonereload zonename

dnscmd /zonereload bigfirm.com

Really only useful on primary DNS servers

Force DNS server to flush DNS data to zone file

dnscmd /zonewriteback zonename

dnscmd /zonewriteback bigfirm.com

 

Tell a primary whom to allow zone transfers to

dnscmd /zoneresetsecondaries zonename /nonsecure|securens

dnscmd /zoneresetsecondaries bigfirm.com /nonsecure

That example says to allow anyone who asks to get a zone transfer

Enable/disable DNS NOTIFY

dnscmd /zoneresetsecondaries zonename /notify|/nonotify

dnscmd /zoneresetsecondaries bigfirm.com /nonotify

Example disables DNS notification, which is contrary to the default settings.

Tell a secondary DNS server to request any updates from the primary

dnscmd /zonerefresh zonename

dnscmd /zonerefresh bigfirm.com

 

Enable or disable dynamic DNS on a zone

dnscmd /config zonename /allowupdate 1|0

1 enables, 0 disables, 0 is default

 

Stop the DNS service

Either net stop dns or sc stop dns

 

(No dnscmd command for this)

Start the DNS service

Either net start dns or sc start dns

 

(No dnscmd command for this)

Install the DNS service on a 2008 full install system

servermanagercmd -install dns

 

 

Install the DNS service on a 2008 Server Core system

ocsetup DNS-Server-Core-Role

 

Case matters — ocsetup dns-server-core-role would fail

Uninstall the DNS service on a 2008 Server full install system

servermanagercmd -remove dns

 

 

Uninstall the DNS service on a 2008 Server Core system

ocsetup /uninstall DNS-Server-Core-Role

 

 

You’ll need to become intimately familiar with administering DNS via the command line if you’re running the Server Core version of Windows 2008.

Gone in 47.11 Seconds


I was performing a little security audit today, and used PWdump to dump the contents of the SAM file from a Windows 2000 Domain Controller.

I took the results from PWdump and imported them into LMcrack.  It took 47.11 seconds to enumerate 617 of the 2272 account passwords.

47.11 Seconds

Next I ran Richard Mueller’s DocumentGroups.vbs script which dumped the group membership of all the domain’s Active Directory accounts to a file.

Now I had a list of user and their passwords, plus a list of user account group memberships.  Are you suprised that three users with Domain Admin membership were on the cracked.dic list? 

I bet the entire process, from PWdump to LMcrack to DocumentGroups.vbs took all of ten minutes.   The local network admin was not happy with the strength of his user’s passwords.  Maybe now he’ll start enforcing stronger passwords.

Windows Server 2008 Firewall Ports


Mark Empson has published a nice list of firewall ports used by Windows Server 2008.

Possible Rule name

Description

Port

Path

Active Directory Domain Controller – LDAP (TCP-In)

Inbound rule for the Active Directory Domain Controller service to allow remote LDAP traffic. (TCP 389)

389

%systemroot%\System32\lsass.exe

Active Directory Domain Controller – LDAP (UDP-In)

Inbound rule for the Active Directory Domain Controller service to allow remote LDAP traffic. (UDP 389)

389

%systemroot%\System32\lsass.exe

Active Directory Domain Controller – LDAP for Global Catalog (TCP-In)

Inbound rule for the Active Directory Domain Controller service to allow remote Global Catalog traffic. (TCP 3268)

3268

%systemroot%\System32\lsass.exe

Active Directory Domain Controller – NetBIOS name resolution (UDP-In)

Inbound rule for the Active Directory Domain Controller service to allow NetBIOS name resolution. (UDP 138)

138

System

Active Directory Domain Controller – SAM/LSA (NP-TCP-In)

Inbound rule for the Active Directory Domain Controller service to be remotely managed over Named Pipes. (TCP 445)

445

System

Active Directory Domain Controller – SAM/LSA (NP-UDP-In)

Inbound rule for the Active Directory Domain Controller service to be remotely managed over Named Pipes. (UDP 445)

445

System

Active Directory Domain Controller – Secure LDAP (TCP-In)

Inbound rule for the Active Directory Domain Controller service to allow remote Secure LDAP traffic. (TCP 636)

636

%systemroot%\System32\lsass.exe

Active Directory Domain Controller – Secure LDAP for Global Catalog (TCP-In)

Inbound rule for the Active Directory Domain Controller service to allow remote Secure Global Catalog traffic. (TCP 3269)

3269

%systemroot%\System32\lsass.exe

Active Directory Domain Controller – W32Time (NTP-UDP-In)

Inbound rule for the Active Directory Domain Controller service to allow NTP traffic for the Windows Time service. (UDP 123)

123

%systemroot%\System32\svchost.exe

Active Directory Domain Controller (RPC)

Inbound rule to allow remote RPC/TCP access to the Active Directory Domain Controller service.

Dynamic RPC

%systemroot%\System32\lsass.exe

Active Directory Domain Controller (RPC-EPMAP)

Inbound rule for the RPCSS service to allow RPC/TCP traffic to the Active Directory Domain Controller service.

135

%systemroot%\System32\svchost.exe

Active Directory Domain Controller (TCP-Out)

Outbound rule for the Active Directory Domain Controller service. (TCP)

Any

%systemroot%\System32\lsass.exe

Active Directory Domain Controller (UDP-Out)

Outbound rule for the Active Directory Domain Controller service. (UDP)

Any

%systemroot%\System32\lsass.exe

DNS (TCP, Incoming)

DNS inbound

53

%systemroot%\System32\dns.exe

DNS (UDP, Incoming)

DNS inbound

53

%systemroot%\System32\dns.exe

DNS (TCP, outbound)

DNS outbound

53

%systemroot%\System32\dns.exe

DNS (UDP, outbound)

DNS outbound

53

%systemroot%\System32\dns.exe

DNS RPC, incoming

Inbound rule for the RPCSS service to allow RPC/TCP traffic to the DNS Service

135

%systemroot%\System32\dns.exe

DNS RPC, incoming

Inbound rule to allow remote RPC/TCP access to the DNS service

Dynamic RPC

%systemroot%\System32\dns.exe

Nice reference Mark. I was just looking for a similar list for Windows Server 2003 R2 Domain Controllers, and had to pull the information from a variety of sources. I couldn’t find a nice summary like you’ve made.

Updated Documentation: Changes in Functionality From Windows Server 2003 With SP1 to Windows Server 2008


 

Microsoft has released a massive new document titled Changes in Functionality From Windows Server 2003 With SP1 to Windows Server 2008.

This document is 341 pages, and it applies to the released version of Windows Server 2008. It does not describe all of the changes that are included in Windows Server 2008, but instead highlights changes that will potentially have the greatest impact on your use of Windows Server 2008 and provides references to additional information.

The following topics have been added since the September 2007 version of this document:

· Authorization Manager

· Storage Manager for SANs

· Security Configuration Wizard

· Volume Activation

Topics about the following technologies or features received updates:

· DNS Server Role

· Server Manager

· Streaming Media Services

· Terminal Services

· Virtualization Role

· Windows Deployment Services Role

· Windows Server Backup

If you’ll be deploying Windows Server 2008 anytime soon, make sure to check it out.

Follow

Get every new post delivered to your Inbox.

Join 32 other followers