garethEds Posted June 23, 2015 Posted June 23, 2015 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
Chuckster Posted June 23, 2015 Posted June 23, 2015 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 2
Sephiroth Posted June 23, 2015 Posted June 23, 2015 Can I just ask why you want this, as there may be better or simpler ways of doing what you need to do.
garethEds Posted June 23, 2015 Author Posted June 23, 2015 Thanks @Chuckster @Sephiroth : Seemed like the easiest way to create a quick visual guide. What better or simpler way would you suggest?
atso Posted June 23, 2015 Posted June 23, 2015 This might help too; Get Active Directory Computer Details Using PowerShell | Random Tech Tips
sted Posted June 23, 2015 Posted June 23, 2015 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?
Sephiroth Posted June 23, 2015 Posted June 23, 2015 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
atso Posted June 23, 2015 Posted June 23, 2015 There is also modified dates too, or delete ad object before rebuild
sted Posted June 23, 2015 Posted June 23, 2015 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
Arthur Posted June 23, 2015 Posted June 23, 2015 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?
atso Posted June 23, 2015 Posted June 23, 2015 Nope because you could pull that off too via powershell and add them back when done too if needed.
halbaradkenafin Posted June 23, 2015 Posted June 23, 2015 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.
Gatt Posted June 23, 2015 Posted June 23, 2015 I find it creates a Registry Entry: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Deployment 4
free780 Posted June 23, 2015 Posted June 23, 2015 Could just check c:\windows\temp\deploymentlogs for the dates.
garethEds Posted June 23, 2015 Author Posted June 23, 2015 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
rtt Posted September 3, 2015 Posted September 3, 2015 Dude, you can just type systeminfo in a command prompt to get the build date. Quickly Find System Build Date/Time & System Boot Date/Time | Random Tech Tips Hope that helps
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now