Member
Статус: Не в сети Регистрация: 15.03.2009 Откуда: Minsk
Доброго всем времени суток! Возникла необходимость почистить АД от старых учетных записей. Вопрос: можно ли как-нить посмотреть когда последний раз регистрировались под учетной записью?
' LastLogon.vbs ' VBScript program to determine when each user in the domain last logged ' on. ' ' ---------------------------------------------------------------------- ' Copyright (c) 2002 Richard L. Mueller ' Hilltop Lab web site - http://www.rlmueller.net ' Version 1.0 - December 7, 2002 ' Version 1.1 - January 17, 2003 - Account for null value for lastLogon. ' Version 1.2 - January 23, 2003 - Account for DC not available. ' Version 1.3 - February 3, 2003 - Retrieve users but not contacts. ' Version 1.4 - February 19, 2003 - Standardize Hungarian notation. ' Version 1.5 - March 11, 2003 - Remove SearchScope property. ' Version 1.6 - May 9, 2003 - Account for error in IADsLargeInteger ' property methods HighPart and LowPart. ' Version 1.7 - January 25, 2004 - Modify error trapping. ' Version 1.8 - July 6, 2007 - Modify how IADsLargeInteger interface ' is invoked. ' Version 1.9 - December 29, 2009 - Output "Never" if no date. ' ' Because the lastLogon attribute is not replicated, every Domain ' Controller in the domain must be queried to find the latest lastLogon ' date for each user. The lastest date found is kept in a dictionary ' object. The program first uses ADO to search the domain for all Domain ' Controllers. The AdsPath of each Domain Controller is saved in an ' array. Then, for each Domain Controller, ADO is used to search the ' copy of Active Directory on that Domain Controller for all user ' objects and return the lastLogon attribute. The lastLogon attribute is ' a 64-bit number representing the number of 100 nanosecond intervals ' since 12:00 am January 1, 1601. This value is converted to a date. The ' last logon date is in UTC (Coordinated Univeral Time). It must be ' adjusted by the Time Zone bias in the machine registry to convert to ' local time. ' ' You have a royalty-free right to use, modify, reproduce, and ' distribute this script file in any way you find useful, provided that ' you agree that the copyright owner above has no warranty, obligations, ' or liability for such use.
Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 10
Вы не можете начинать темы Вы не можете отвечать на сообщения Вы не можете редактировать свои сообщения Вы не можете удалять свои сообщения Вы не можете добавлять вложения