Thanks, Daniel.

I'll give that a try.  Since it's "Miller" time I'll have to try this on Monday.

Thanks,
Ken ...

From: [email protected] [mailto:[email protected]] On 
Behalf Of Daniel Ratliff
Sent: Thursday, June 06, 2013 3:06 PM
To: [email protected]
Subject: [mssms] RE: PowerShell script help

Wmic isn't PowerShell, it's a built in windows command. You will have to turn 
that string into a command so that it can use your $computer variable. 
Invoke-command or start-process should do the trick.

Daniel Ratliff

From: [email protected]<mailto:[email protected]> 
[mailto:[email protected]] On Behalf Of Lutz, Ken
Sent: Thursday, June 06, 2013 6:03 PM
To: [email protected]<mailto:[email protected]>
Subject: [mssms] RE: PowerShell script help

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]> 
[mailto:[email protected]]<mailto:[mailto:[email protected]]>
 On Behalf Of Brandon Linton
Sent: Thursday, June 06, 2013 2:38 PM
To: [email protected]<mailto:[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






The information transmitted is intended only for the person or entity to which 
it is addressed
and may contain CONFIDENTIAL material. If you receive this material/information 
in error,
please contact the sender and delete or destroy the material/information.




<<inline: image001.png>>

<<inline: image002.png>>

Reply via email to