Jump to content

Recommended Posts

Posted

Good morning,

 

A quick request - when building a machine via MDT I'd like the task sequence to create a text file which contains the following information:

 

Build Date:

 

Of course replacing the with the date and time the machine was rebuilt. The text file can be named anything suitable.

 

Perhaps there is one out there already (Not found on Google yet)

 

Cheers

 

Gareth

Posted

I would say create a custom task in MDT and in the command line enter something like this: cmd.exe /c "\\wdsserver\MDTbuildarea$\Scripts\name_of_file.bat"

 

Tthe start in is: C:\Windows\System32\

 

 

In your .BAT file you would have this:

 

@echo off

REM Workstation Build Date

echo Workstation built on %date% %time% > "C:\Workstation Build.txt"

exit

  • Thanks 2
Posted
Could you not just pull this from AD computer object.

 

isn't that just when the ad object was created so if you rebuild a pc it will still say the date you created the object?

Posted

I use BGInfo to put this straight onto the desktop of whoever is logged in, using the following script.

 

Set dtmConvertedDate = CreateObject("WbemScripting.SWbemDateTime")
strComputer = "."
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set ColOS = objWMIService.ExecQuery ("Select * from Win32_OperatingSystem")
For Each objOS in ColOS
   dtmConvertedDate.Value = objOS.InstallDate
   Echo dtmConvertedDate.GetVarDate
Next

Posted
There is also modified dates too, or delete ad object before rebuild

 

then you have to remember where it was and what groups it was a part of

Posted
when building a machine via MDT I'd like the task sequence to create a text file which contains the following information

Could you put this information elsewhere (e.g. in the registry) so that you don't have text files cluttering up the C: drive? :)

Posted
then you have to remember where it was and what groups it was a part of

 

MDT lets you specify an OU to put the computer object in when it adds it to the domain which would solve that problem. Still not ideal to remove the object from AD in the first place though.

@garethedmondson I'm curious why you need to record the last build date of a PC.

Posted
MDT lets you specify an OU to put the computer object in when it adds it to the domain which would solve that problem. Still not ideal to remove the object from AD in the first place though.

@garethedmondson I'm curious why you need to record the last build date of a PC.

 

Because I forget sometimes.

 

GJE

  • 2 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...