UPDATED: CSI_IsAdmin: Test for Admin Rights - Fast, Small, Efficient, Universal Script Code in VBScript (VBS), PowerShell (PS1) and CMD/BAT
This script code uses a fast and efficient method for determining whether the current session (process) has admin rights. The compact code is provided in VBS (9 lines) and CMD/BAT (3 lines). It works with XP / Server 2003 through Windows 7 / Server 2008. It works with UAC (reports admin rights only if session / process elevated). It uses passive methods to determine rights – in other words, it does not try to change anything on the target system.
Our Bginfo template has been updated to version 1.5. The template content is the same, but the installer now handles XP, checking for a copy of bginfo.exe next to script, checking for elevated admin on Vista and later (Version 6 and later). You can use the installer script to see a simple Shell (.BAT, .CMD) scripting method to check if someone is an elevated admin...
Malware Scanners Missing Stuff – Procmon Install Spy To The Rescue…
I had two different scenarios in two days where some of the top malware scanners completely ignored very concerning changes to systems I was working on…
How Do I UAC Prompt Thee? Let Me Count The Ways. (The Definitive UAC Prompt Guide)
UAC has caused a lot of buzz ever since Vista was released. Sometimes even I wonder if the topic of UAC comprises a measurable amount of the total web and email conversations about technology for the last two years ;)
The main concern about UAC has always been those pesky prompts asking your permission to do innocuous activities like deleting kernel32.dll. Sometimes you get them when you don’t want them and sometimes you don’t get them when you should. It turns out there are many ways to cause or suppress UAC prompts – this post attempts to document them all…
If you are just getting started with using manifest files to configure UAC elevation prompts, it can be difficult to remember what the options are and what to do if there is already a manifest. The following is a complete sample template of an application manifest and is commented so that you can…
File Recovery Sweetness – Free Beats The Pants Off Paying
Oh that sinking feeling after deleting a file that is your only good copy of a script. However, the second sinking feeling of knowing there is no recycler copy because the deletion happened via another machine over the network is even worse! I ended up using two products to attempt recovery – my paid for copy of Stellar Phoenix ($99) and the free and famous Recuva. Guess which one out performed in multiple was…
Maybe you have come across some of the UAC VBScript snippets for figuring out whether the current user is an administrator and even whether they are elevated or not. I wanted a quick and lightweight solution to figure our whether a user was admin and whether they were elevated. Once I got started, it didn’t take much to add checks for all the other groups and special permissions. And it’s all done in 40 lines…
CSI Toolkit: Windows Services Optimizer (WinServicesOptimizer.vbs)
Disabling unnecessary Windows services can result in significant performance gains for production machines and virtual machines. This script helps you manage and share templates for services optmization - including only starting services when they are needed. Some services optimization templates are included and instructions are included for converting from other services optimization tools. Click "Read More" for much more information about the benefits, uses and implementation of the script.
CSI Toolkit: bginfo template for Windows 7 Testing
The attached file contains a .bgi template for Sysinternals BGInfo and an installation shell script. We use it on the virtual machines for all our courses. It places all the security and UAC details of a Windows 7 (or Vista) machine on the background bitmap. I have seem many threads on the net about trying to get bginfo to run for all standard users and do it without admin rights. Just run the installation script (bginfoinst.bat) in an elevated command prompt and then bginfo will run for all users who login, whether or not they are admins or elevated.