This script allows you to get the disk space used by the Recycle Bin items on a shared folder. It can be very useful and interesting if you run it on a file server where the user home drives are
Delegate the Reset password permission on OU
Delegate the Unlock user account permission on OU
Reboot task optimization in a VMware Virtual Desktop Infrastructure
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