Delete Event Viewer Logs in Windows 7

Quick and easy way to delete your Event Viewer Logs in Windows 7. @echo off for /F “tokens=*” %%G in (‘wevtutil.exe el’) DO (call :clear_it “%%G”) echo. echo Event Logs have been cleared! ^<press any key^> goto fin :clear_it echo %1 – CLEARED wevtutil.exe cl %1 goto :eof :fin pause>NUL Note: You must run this [...]

Quickly query Active Directory to find users distinguished name

Pretty simple method on extracting users distinguished name (dn) data from Active Directory. dsquery.exe * -limit 0 -filter “(&(objectCategory=Person)(objectClass=User)(!userAccountControl:1.2.840.113556.1.4.803:=2))” >”c:\activeUsers.txt” Note: This will only extract active users. To gather a list of all users, simply run: dsquery user

Update Active Directory User Objects

This PowerShell script allows you to update or append user objects in Active Directory based on data in an external data file (csv). $users = import-csv c:\is\scripts\ps1\ourusers.csv foreach($row in $users) { $dn = $row.dn $user=[ADSI]“LDAP://$dn” $telephoneNumber = $row.telephoneNumber $user.put(“telephoneNumber”, $telephoneNumber) $user.SetInfo() } The data file needs to have the following format: dn,telephoneNumber “distinguished name”,telephoneNumber Reference: [...]

Follow

Get every new post delivered to your Inbox.