[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

wmi script

Posted on 2007-12-05
4
Medium Priority
?
559 Views
Last Modified: 2010-08-05
i need a wmi script to use in group policy.  i need it to filter laptops from the policy so it only applies to workstation desktops.  what our goal is to filter .mp3, .wavs and laptops from this policy for folder redirection of the users my documents folder to a server for backup.  I am not a script guy so i need some help with this. thanks in advance
0
Comment
Question by:scripttron75
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 

Author Comment

by:scripttron75
ID: 20416667
cant anyone help on this??
0
 
LVL 12

Accepted Solution

by:
chandru_sol earned 2000 total points
ID: 20417192
Try this....


regards
Chandru
Option Explicit
Dim strComputer, strChassis
Dim objWMIService, objChassis, colChassis, objItem
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" _
& strComputer & "\root\cimv2")
Set colChassis = objWMIService.ExecQuery _
("Select * from Win32_SystemEnclosure",,16)
For Each objChassis in colChassis
  For Each objItem in objChassis.ChassisTypes
    Select Case objItem
    Case 1 strChassis = "Maybe Virtual Machine"
    Case 2 strChassis = "??"
    Case 3 strChassis = "Desktop"
    Case 4 strChassis = "Thin Desktop"
    Case 5 strChassis = "Pizza Box"
    Case 6 strChassis = "Mini Tower"
    Case 7 strChassis = "Full Tower"
    Case 8 strChassis = "Portable"
    Case 9 strChassis = "Laptop"
    Case 10 strChassis = "Notebook"
    Case 11 strChassis = "Hand Held"
    Case 12 strChassis = "Docking Station"
    Case 13 strChassis = "All in One"
    Case 14 strChassis = "Sub Notebook"
    Case 15 strChassis = "Space-Saving"
    Case 16 strChassis = "Lunch Box"
    Case 17 strChassis = "Main System Chassis"
    Case 18 strChassis = "Lunch Box"
    Case 19 strChassis = "SubChassis"
    Case 20 strChassis = "Bus Expansion Chassis"
    Case 21 strChassis = "Peripheral Chassis"
    Case 22 strChassis = "Storage Chassis" 
    Case 23 strChassis = "Rack Mount Unit"
    Case 24 strChassis = "Sealed-Case PC" 
 
    End Select
  Next
Next
WScript.Echo "Computer chassis type: " & strChassis
'WScript.Echo strComputer & "'s chassis type: " & strChassis 
 
WScript.Quit 
 
' End of WMI VBScript - Chassis type

Open in new window

0
 
LVL 3

Expert Comment

by:top_gizmo
ID: 20417322
If your desktops and laptops have a different naming convention you can create a wmi filter to filter them out (that is how I do it)

It is much simpler than using the above script by Chandru.  Although it is an awesome script.  I used it for other functions also, BUT be advised a laptop in a docking station sometimes will report it chassis type as a docking station, so that is another variable to have to work into your filter.
0
 
LVL 12

Expert Comment

by:chandru_sol
ID: 20421498
thanks scripttron75 for the Grade
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will show, step by step, how to integrate R code into a R Sweave document
With User Account Control (UAC) enabled in Windows 7, one needs to open an elevated Command Prompt in order to run scripts under administrative privileges. Although the elevated Command Prompt accomplishes the task, the question How to run as script…
Learn the basics of strings in Python: declaration, operations, indices, and slicing. Strings are declared with quotations; for example: s = "string": Strings are immutable.: Strings may be concatenated or multiplied using the addition and multiplic…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question