Windows Tip: WMIC and non-admins

January 24, 2008, 02:17 PM —  MTIT Enterprises — 

We've looked at using Windows Management Instrumentation Command-line (WMIC) for gathering information from computers running Microsoft
Windows. WMIC is a powerful tool that lets you query Windows Management Instrumentation (WMI) providers directly from the command line or using batch files, and if you're an administrator then it's well worth your while exploring its capabilities.

However, reader Richard Webb pinged me to point out that WMIC only works if
you are a local administrator, therefore "it's kind of a catch 22 to use
it to support users who don't normally have permissions for the command."
He makes a really good point. If your users aren't local administrators on their
computers, they won't be able to run WMIC commands on them. And if you're trying
to run WMIC commands remotely (i.e. against remote computers) then you need
to use a domain account that is a member of the local Administrators group on
the remote computer. With servers, that's usually no problem, but with client
computers, well, it's unlikely that (and would be very bad if) your domain Administrator
account is a member of the local Administrators group on every client computer
on your network!

(If you want to know how really, really bad doing the above would be, read
the terrific Chapter 13 "Managing Security Dependencies To Secure Your
Network" by security guru Jesper M. Johansson in the upcoming Windows Server
2008 Security Resource Kit from Microsoft Press
.)

Richard makes a good point but it's mitigated by a couple of things. First,
the customer support scenario described in last week's tip involves unmanaged
computers, that is, a software company supporting customers who use their software.
In such a scenario, if the users are running Windows XP then they're very likely
already administrators on their machines, and if they're running Windows Vista
then they're probably admins as well, and can use Run As Admin to open a command
prompt they can run WMIC from.

If the user's computer is managed however (i.e. they belong to an Active Directory
domain and have Group Policy applied) and running Windows XP, then the user's
domain user account may or may not belong to the local Administrators group
on her machine. If it does belong, everything is OK. If not, a workaround would
be to have helpdesk offer Remote Assistance to the user. Once the offer is accepted,
helpdesk can then take control of the user's computer and run WMIC commands
on it to troubleshoot the issue.

If the users' computer is managed but running Vista however, there's a snag:
once helpdesk takes control of the machine and then tries to open an admin-level
command prompt, a UAC prompt will appear. Unfortunately with Vista RTM, only
the user can respond to this prompt as the UAC prompt isn't remoted to helpdesk.
With Service Pack 1 for Vista however, there's a new Group Policy setting in
Vista SP1 that solves this problem:

Computer Configuration\Policies\Windows Settings\Security Settings\Local Policies\Security
Options\User Account Control: Allow UIAccess Applications To Prompt For Elevation
Without Using The Secure Desktop

If you enable this policy in a GPO that applies to the user's computer, helpdesk
will be able to enter admin credentials to open an admin-level command prompt
on the user's computer and run WMIC commands as needed. For more information
about Remote Assistance in Windows Vista, see chapter 23 of the Vista Resource
Kit
from Microsoft Press.

Thanks to everyone for the feedback and keep it coming!

MTIT Enterprises

I like it!
Post a comment
The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
Resources
White Paper

Symantec Backup Exec 12 and Backup Exec System Recovery 8 deliver industry leading Windows data protection and system recovery. Download this whitepaper to find out the top reasons to upgrade and how to get continuous data protection and complete system recovery.

Webcast

Data and system loss — from a hard drive failure, malicious attack, natural disaster, or simple human error — can happen anytime. Don’t leave your business vulnerable. Make sure you have a secure recovery strategy in place. Symantec's latest backup and system recovery technology can efficiently restore critical applications, individual emails and documents and even restore your entire system in minutes in the event of a loss.

White Paper

Businesses face a growing challenge to ensure that the IT environment is properly protected. Backup Exec 12 integrates with other applications in the Symantec family of products, to complement your current data protection strategy, keep your data securely backed up and make it recoverable when you need it most.

Free stuff

Crimeware: Understanding New Attacks and Defenses
By Markus Jakobsson, Zulfikar Ramzan
Published Apr 6, 2008 by Addison-Wesley Professional. Part of the Symantec Press series.
Enter now! | Official rules | Sample chapter

Securing VoIP Networks: Threats, Vulnerabilities, and Countermeasures
By Peter Thermos, Ari Takanen
Published Aug 1, 2007 by Addison-Wesley Professional.
Enter now! | Official rules | Sample chapter

Featured Sponsor

AISO founders envisioned a Web hosting company that was environmentally friendly. While the company employed energy-efficient innovations like solar panels, its infrastructure produced unacceptable power and cooling requirements. Find out how AISO leveraged AMD technology to overcome their challenge in this case study white paper.

In this whitepaper, Scalar explores the opportunity to change the landscape with respect to mission critical databases built around Oracle. Leveraging technologies such as Linux, high-end commodity processing power and Oracle RAC technology to architect, design, build and maintain database infrastructure that delivers maximum availability, reliability and performance at a fraction of traditional cost.

On a typical day, weather.com, the Web site for The Weather Channel in Atlanta, serves up between 15 million and 20 million page views. But in September 2004, when back-to-back hurricanes ransacked Florida, the peak traffic on one day more than tripled: over 70 million page views by more than 7 million unique visitors. Read the full success story now.

More Resources