Link to home
Start Free TrialLog in
Avatar of devlinb
devlinb

asked on

How do I deploy and run Datashift-Printer.vbs on all clients using SMS 2003?

I want to collect network printer information for each client in my organisation.  I downloaded the DataShift-Printer.zip from 'http://www.smsexpert.com/MOF/Scripts.aspx' and extracted the file renaming it to 'DataShift-Printer.vbs'.  I created a package in SMS 2003 with DataShift-Printer.vbs as the source file and created a program with the command line 'cscript.exe DataShift-Printer.vbs'.

I amended the sms_def.mof on the server by adding the following:

#pragma namespace("\\\\.\\root\\cimv2\\sms")
[SMS_Report(TRUE), SMS_Group_Name("SMX Printers"),
SMS_Class_ID("SMXPRINTERS")]
class SMX_Printer : SMS_Class_Template
{
[SMS_Report(TRUE)] string Comment;
[SMS_Report(TRUE)] boolean Default;
[SMS_Report(TRUE)] string DeviceID;
[SMS_Report(TRUE)] string DriverName;
[SMS_Report(TRUE)] boolean Local;
[SMS_Report(TRUE)] string Location;
[SMS_Report(TRUE), key] string Name;
[SMS_Report(TRUE)] boolean Network;
[SMS_Report(TRUE)] string PortName;
[SMS_Report(TRUE)] uint32 PrinterState;
[SMS_Report(TRUE)] string ServerName;
[SMS_Report(TRUE)] boolean Shared;
[SMS_Report(TRUE)] string ShareName;
};

I advertised the program to a test client and forced a hardware inventory.  SMX Printers is now displayed in Resource Explorer for that client but it only lists local printers.

I ran the vbs locally on the client and forced another hardware inventory.  The list of SMX Printers in Resource Explorer for that client now displays local AND network printers.

Why will the script work locally but not when deployed using SMS?  Am I doing something wrong?
ASKER CERTIFIED SOLUTION
Avatar of Adam Leinss
Adam Leinss
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial