Use iCacls to set permissions on a directory and all sub-directories

icacls “C:\Program Files\My Folder\” /T /C /grant “Domain Users”:(OI)(CI)M Read more at: http://technet.microsoft.com/en-us/library/cc753525(WS.10).aspx http://ss64.com/nt/icacls.html

Test TCP Utility (TTCP)

If you ever needed to test the throughput or bandwidth of your LAN or WAN, here is a small utility that will allow you to truly see what the network speed is working at. Prerequisite: PsTools, specifically PsExec must be available on your computer.  Dropping all the “Ps” tools into your %PATH% is recommended. Download [...]

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: [...]

Reduce Winsxs folder size after Windows 7 SP1 install

Quick tip on how to reduce your Winsxs folder on your Windows 7 drive after you have installed SP1. Open an elevated Command Prompt and type the following command: DISM /online /Cleanup-Image /SpSuperseded I have seen varying reports on how much this will reduce your WinSXS folder, but I’ve seen reports for as much as [...]

Query and terminate Remote Desktop sessions

Open the command prompt.  Type: qwinsta /SERVER:<SERVERNAME> This command will query the server and report the existing connections.  Find the ID of the session you would like to terminate.  Then, run the following command to terminate that session. rwinsta <ID> /SERVER:<SERVERNAME> This will terminate the session.

How to create a unique filename with date / time in filename

This little snippet of code will allow you to set a filename based on date and time.  This comes in handy if you ever need to create backup files. for /f “delims=/ tokens=1-3″ %%a in (“%DATE:~4%”) do ( for /f “delims=:. tokens=1-4″ %%m in (“%TIME: =0%”) do ( set FILENAME=basename-%%c-%%b-%%a-%%m%%n%%o%%p ) )

SQL Server Security Overview

I am no database administrator. But, my job requires me to understand what is involved with setting up and securing Microsoft SQL Server 2005. Yes, one can argue that this should be left up to a database administrator, but as many in the IT field understand… we, as IT professional wear many hats. I’ve read [...]

Query User Membership in Active Directory

Have you ever needed to quickly get a particular users group membership in Active Directory? Sure, you could open ‘Active Directory Users and Computers’ and find the user and then check the ‘Member Of’ tab, but this has its drawbacks (i.e. it’s difficult to get a list if you need to email it to a [...]

Follow

Get every new post delivered to your Inbox.