Windows IT Pro is the authoritative and independent resource for windows nt, windows 2000, windows 2003, windows xp. Features a collection of resources and magazines for windows IT professionals.
  
  
  Advanced Search 


May 02, 2008

Creating a WMI Moniker: Including the Security Parameter


RSS
View this exclusive article with VIP access -- click here to join |
See More Security Articles Here | Reprints | Or sign up for our VIP Monthly Pass!
Main Article    The Event Log Query Utility

To include a Security parameter in your WMI moniker, you need to include a security settings component, as in the following line of code:

 Set WMIService = GetObject_  
("winmgmts:{impersonationLevel=_
impersonate,(Security)}!\\" & _
strSrv & "\root\cimv2")

The following line of code shows what a typical moniker looks like:

 Set WMIService = GetObject_  
("winmgmts:\\" & strSrv & _
"\root\cimv2")

A moniker has three basic parts, beginning with the mandatory prefix, winmgmts. The moniker then includes a security settings component, which is the section enclosed in the curly brackets in the first example above. The security settings component is typically optional, but it’s required when you’re undertaking privileged activities involving security, debugging, and computer shutdowns. Note the exclamation point (!) prefix in the first code example; it should precede the computer name and namespace when you’re specifying a security setting. The third moniker component is the WMI object path, which refers to the computer name and the WMI namespace. In the example above, strSrv is a variable that contains the computer name, and "\root\cimv2" is the namespace. . . .

Reader Comments

You must log on before posting a comment.

If you don't have a username & password, please register now.




Top Viewed ArticlesView all articles
Command Prompt Tricks

One reader shares his tip for setting up the command prompt to reflect a remote path. ...

Microsoft Touts Xbox 360 'Black Friday' Success

Microsoft this week revealed that its Xbox 360 video game console outsold its Sony PlayStation 3 rival 3-to-1 on "Black Friday," which curiously describes the three day weekend after Thanksgiving, a period that unofficially kicks off the holiday selling ...

How can I stop and start services from the command line?

...


Security Whitepapers The Impact of Messaging and Web Threats

Why SaaS is the Right Solution for Log Management

Protecting (You and) Your Data with Exchange Server 2007

Related Events How IE7 & The New Extended Validation SSL Certificates Impact Your Site

Top 10 Email Security Challenges and Solutions

Introduction to Identity Lifecycle Manager "2"

Check out our list of Free Email Newsletters!

Security eBooks Spam Fighting and Email Security for the 21st Century

Understanding and Leveraging Code Signing Technologies

A Guide to Windows Certification and Public Keys

Related Security Resources Become a VIP member of the Windows IT Pro community!
Get it all with the VIP CD and VIP access. A $500+ value for only $279!

Subscribe to Windows IT Pro!
Solve your toughest technical problems with our experts and access 10,000 + articles online. 30% off

Monthly Online Pass - Only $5.95!
Get instant access to 10,000+ articles from Windows IT Pro Magazine!

TechNet Virtual Labs
Evaluate and test Microsoft's newest products.


Windows IT Pro Home Register FAQ for Windows WinInfo News
Europe Edition About Us Contact Us/Customer Service Media Kit Affiliates / Licensing  
SQL Server Magazine Office & SharePoint Pro Windows Dev Pro IT Job Hound ITTV
IT Library Technology Resource Directory Connected Home Windows Excavator Windows SuperSite 
 
 Windows IT Pro is a Division of Penton Media Inc.
 Copyright © 2008 Penton Media, Inc., All rights reserved. Terms and Use | Privacy Statement | Reprints and Licensing