Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.

Windows 7: Profile log in record

20 Apr 2012   #21

Windows 7 Ultimate x64

Quote   Quote: Originally Posted by karlsnooks View Post
why I thank you for giving me permission to post my script.
Sorry didn't mean it like that, just thought you might not post until I got a response about mine or until he found out about having PowerShell.

My System SpecsSystem Spec
20 Apr 2012   #22

Windows 7

Nice work. Will need time to wrap my head around this. Did the log.bat file with instant results. Wil use somewhat over the weekend and post results. Thank you. @ Karlsnooks. I am going to lay off the power shellfirst. Not because i think it wont work but because it scares me. I will give it serious go if the other file does not do it for me. But, thank you so much for the effort.
My System SpecsSystem Spec
20 Apr 2012   #23

Windows 7

@Karlsnooks. I just could not wait. Gave powershell a go, just quick you see. Got instant results. Man that is freaky. Info is weird thought. Give me user logon times. not time. Wait I will post screenshot. Whats up with that. Am I doing it wrong. Probably. Late friday night. Time for bed. Thx

Attached Thumbnails
Profile log in record-screenhunter_01-apr.-20-22.10.jpg  
My System SpecsSystem Spec

20 Apr 2012   #24

MS Windows 7 Ultimate SP1 64-bit

I suspected that you might want more.

What that script shows you is the last time that the user(s) logged on and the total number of times they have logged on.

What it doesn't show is when a user logged off and the total number of hours that they were logged on.

For some of that info, the EventViewer can be useful, however, as you have seen, the clearing of the logs will eliminate past event log entries.

True is that with group policy you can restrict the use of EventViewer.

I suspect that your users don't have the slightest idea what event viewer is.

Although supposedly there is a "LogoffTime" property, the info doesn't seem to be there. Whether this is operator malfucntion or a "feature" of the netlogons is beyond my knowledge.

I seriously recommend visiting a couple of powershell and/or admin forums to see if someone there will, for no renumeration, write a script for you.

There are many more, I just don't have a convenient set of bookmarks for PowerShell-mostly just RSS feeds
My System SpecsSystem Spec
21 Apr 2012   #25

Windows 7 Ultimate x64

If you run my batch file it will instantly create the files under C:\Logs that you can then view. If setup through Group Policy as a logon/logoff script it will be ran each time a user logs on or off and the info will be recorded in the log file.

One problem here is I don't know is WinXP Home has Group Policy so you might need WinXP Professional, although you might be able to use Task Scheduler.

Karlsnooks PowerShell script can also be converted to a VBScript file if your familer with that but it accesses the WMI Object Win32_NetworkLoginProfile and under both Win7 and Virtual PC's WinXP Mode the logoff time is returned as "LastLogoff: **************.******+***" making it invalid.

I could not find any WMI Object to return any info about logoff times. It's possible to retrieve this info from the EventViewer but I don't know how to script it to return the info you want in any scripting language but my skills are quite limited. Simply opening the EventViewer to view the info can also be a bit unappealing.

Also my script can be converted to VBScript if you have problems with the batch file but formatting the output may be a challange.

Like Karlsnooks said you can also ask on some scripting sites if you want to retrieve the info from Windows instead of generating it yourself.

If you choose to use my batch script then I can help with any formatting or changes you require.
My System SpecsSystem Spec
21 Apr 2012   #26

MS Windows 7 Ultimate SP1 64-bit

PowerShell is available also for XP. Simply a download away. Win 7 and Win 8 come with PowerShell.

I can not recommend strong enough visiting some of the PowerShell sites and also admin sites. PowerShell is the preferred scripting language by admins.

You might want to check for an admin site.
My System SpecsSystem Spec
24 Apr 2012   #27

Windows 7

I am sorry. I am really busy this side. Did not give this all the attention it needs. We have a long weekend coming up, Friday, Sat, Sun, Monday, and Tuesday. Bad for business but good for the lazy... I will attend to it then.
My System SpecsSystem Spec

 Profile log in record

Thread Tools

Similar help and support threads
Thread Forum
The User Profile Service failed the logon. Safe mode, only my profile
Hi After experiencing some blue screens (graphics driver related) I reverted back to 314.22 and this morning decided to give the card a good clean. This is my main PC which has Windows 7 Home Premium, Q9450, GTX 260 (216). Somehow I managed to corrupt my user profile and received the User...
General Discussion
Instead of logging into main profile, I am forced into temp profile
When attempting to login to my main profile, after a several minute wait, Windows loads normally, but I receive a notice saying that I have been logged into a temporary profile, which would be deleted upon shutting down. As far as I can tell, this started happening immediately after switching...
General Discussion
Big Mess after creating new profile and deleting original profile
Originally I had all my data files in drive D and only programs in drive C. Somehow my old user profile got corrupted and the Backgound wall paper is not working properly. So I created a new admin profile to fix it but now I have a mess . After I created a new admin profile and moved the old...
General Discussion
HELP! User profile service failed the login - profile cannot be loaded
I followed the tutorial here and it worked beautifully... All my user docs are on the D drive and the Start button entires all point to the new location. HOWEVER when I tried to log in this mornias wand was...
Backup and Restore
Record Icon not showing when pressing record in Live TV
Hi Guys When I am watching Live TV and press the record button on my remote or through the interface using the mouse I am no longer getting the red icon indicating that recording has started but the program is actually recording. I use to get it but for some reason it now no longer pops up. Has...
Media Center

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 10:23.
Twitter Facebook Google+