This command will kill all the processes with a specific name : kill `ps -ef | grep process-name-to-kill | grep -v grep | awk ‘{print $2}’` References kill Manpage The command kill sends the specified signal to the specified process
Delegate the Reset password permission on OU
Delegate the Unlock user account permission on OU
Reboot task optimization in a VMware Virtual Desktop Infrastructure
Create GeoIP firewall rules for iptables
Get the server uptime in days with WMI
Get GDI handles by process
This script requires Powershell 3.0 This script get the number of GDI handles by process Script : $global:sig = @’ [DllImport(“User32.dll”)] public static extern int GetGuiResources(IntPtr hProcess, int uiFlags); ‘@ Get-Process | select ProcessName -Unique | ? {$_.processname -notmatch “Idle|System|svchost”}
Resolve or get SID for Active Directory object
The following little scripts will allow you to play and take your first steps with the Active Directory object SID Resolve object SID to username $objSID = New-Object System.Security.Principal.SecurityIdentifier(“S-1-5-21-123456789-1234567890-123456789-12345”) $objUser = $objSID.Translate( [System.Security.Principal.NTAccount]) $objUser.Value Get the SID of a username