Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Opinions Needed: Track Group Policy Results 1

Status
Not open for further replies.

Timhi

Technical User
Apr 28, 2008
33
US
Hi,

I am using a startup script (batch) through Group Policy to copy a custom wallpaper to each computer in the domain. The problem is there are a lot of laptops that are only here at certian times, and I need to know who got the update so I can filter who didn't.

So I want a way to track who got the update. I was thinking adding a log function to the batch
Example:
Code:
ECHO %COMPUTERNAME% HAS THE FILE >>\\pdc\wallpaper\verify.log
And all computers will append to that log.

Will this work? Does anyone have a better technique?


Thanks,
Tim
 
There are a number of ways to perform what you are doing. Your method is the most straight forward to implement. My only comment is that you have to read this file later to reconcile against a list of systems in your domain. That task will be hard if you have a lot of "extra" words in your file.

I suggest that you simply echo the computer name (and possibly the date and time), so that you can open the file in Excel and eliminate the hundreds or thousands of duplicate entries.

echo %computername%,%DATE:~4,10%,%time% >>\\pdc\wp\log.csv


PSC

Governments and corporations need people like you and me. We are samurai. The keyboard cowboys. And all those other people out there who have no idea what's going on are the cattle. Mooo! --Mr. The Plague, from the movie "Hackers
 
Thanks! That will make it easier to sort indeed.

I was also looking for a way to modify the %time% output. (I don't really need hh/mm/ss.ss when hh/mm will do) Is there a good site out there that explains these attributes?

Thanks again
 
%date% and %time% are standard system variables. A member of this site showed this method of getting specific portions of environment variables a couple of years ago, and I have used it since...

Basically [red]:~4,10[/red] tells the command interpreter to return only 10 characters from the variable, starting at the 5th position.

So... [blue]%time:~0,8%[/blue] will return HH:MM:ss

I don't know where this is documented, and generally I don't care these days, since I've converted to doing most things in VBScript. (But it's also good to keep old tricks up your sleeve.) Keeping things simple and supportable is pretty important, which is why I didn't suggest a more complicated solution.

Good luck!

PSC

Governments and corporations need people like you and me. We are samurai. The keyboard cowboys. And all those other people out there who have no idea what's going on are the cattle. Mooo! --Mr. The Plague, from the movie "Hackers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top