Brandon, Thanks for the reply When I try to put the $Computer variable into the command it fails.
$Computer = "XYZ"
WMIC /namespace:\\$Computer\root\ccm\invagt path inventoryActionStatus where
InventoryActionID="{00000000-0000-0000-0000-000000000001}" DELETE /NOINTERACTIVE
I'm having problems getting the command to work with the variable value. I
want the variable so that I can next create a text file of machine names and
send that to the script.
What my objective is to have this script read the mif files that show up in the
dataloader inbox badmifs folders and pars out the computer name and force a
full inventory. The above is just the first part of my attempt to get this
script working while leaning PowerShell at the same time. Part of my problem
is that I don't have a programming or scripting background, so I have a lot to
learn.
Thanks,
Ken ...
From: [email protected] [mailto:[email protected]] On
Behalf Of Brandon Linton
Sent: Thursday, June 06, 2013 2:38 PM
To: [email protected]
Subject: [mssms] RE: PowerShell script help
Below is the wmic command to force a full HW Inventory.
WMIC /namespace:\\root\ccm\invagt path inventoryActionStatus where
InventoryActionID="{00000000-0000-0000-0000-000000000001}" DELETE /NOINTERACTIVE
Thanks,
Brandon A. Linton | Sr. Consultant |
[email protected]<mailto:[email protected]> | Work 484.323.7205
From: [email protected]<mailto:[email protected]>
[mailto:[email protected]] On Behalf Of Lutz, Ken
Sent: Thursday, June 6, 2013 5:21 PM
To: SMS List
Subject: [mssms] PowerShell script help
I'm trying to learn PowerShell and this script is what I was hoping would be a
good place to start. I want to be able to input a list of computers and then
kick off a full Hardware or Software inventory (rather than a delta inventory).
So far I have it kicking off a delta inventory. I don't see a way to do a full
inventory.
Here is what I have so far (this is just the inventory portion for testing):
$Computer = "XYZ"
[wmi]"\\$Computer\ROOT\ccm\invagt:InventoryActionStatus.InventoryActionID='{00000000-0000-0000-0000-000000000001}'<file:///\\$Computer\ROOT\ccm\invagt:InventoryActionStatus.InventoryActionID='%7b00000000-0000-0000-0000-000000000001%7d'>"
| remove-wmiobject
([wmiclass]"\\$Computer\Root\CCM:SMS_Client<file:///\\$Computer\Root\CCM:SMS_Client>").TriggerSchedule('{00000000-0000-0000-0000-000000000001}')
When I run this I get the following in the InventoryAgent.log file:
[cid:[email protected]]
Thanks,
[cid:[email protected]]
Ken Lutz
Senior Systems Administrator
Information Systems Department
Spokane County
815 N. Jefferson
Spokane, Washington 99260
<<inline: image001.png>>
<<inline: image002.png>>

