Jump to content




shawn.pederson

SCCM 2012 Mapped Network Printers - Hardware Inventory



Recommended Posts

Having trouble pulling the mapped network printers for a user; here’s what I have done so far:

 

On a test computer ran the attached (zipped) SCCM_REGINI.txt (with regini.exe) to build a registry structure to pull the users network printers (from the CURRENT_USER hive) to a hive called SCCMINV (in LOCAL_MACHINE).

post-14550-0-34819500-1375888893_thumb.jpg

 

Ran the attached VBS script (SCCM_PRINTER_INV.vbs) to copy the network printers to said hive.

post-14550-0-75790900-1375888894_thumb.jpg

 

Modified the ‘configuration.mof’ file to look in the hive for the information.

post-14550-0-08668100-1375888897_thumb.jpg

 

Modified the client agent settings to pull information (classes) from that hive.

post-14550-0-70345400-1375888898_thumb.jpg

 

I still can’t seem to find the SQL table in my SCCM DB. Anyone have any ideas on where to start?

 

I have verified the classes being copied on the test client logs:

post-14550-0-04283100-1375888900_thumb.jpg

 

All the scripts are taken from: http://myitforum.com/myitforumwp/2011/11/23/howto-printer-inventory-script-w-network-printers/

  • See attached ZIP file.

And verified with: http://schadda.blogspot.se/2012/02/sccm-2012-customize-extend-hardware.html

SCCM_Printer_Inventory1.zip

Share this post


Link to post
Share on other sites


I should also mention I have compiled the .MOF on the client as well:

 

C:\Windows\system32>mofcomp C:\temp\configuration.mof
Microsoft ® MOF Compiler Version 6.1.7600.16385
Copyright © Microsoft Corp. 1997-2006. All rights reserved.
Parsing MOF file: C:\temp\configuration.mof
MOF file has been successfully parsed
Storing data in the repository...
WARNING: File C:\temp\configuration.mof does not contain #PRAGMA AUTORECOVER.
If the WMI repository is rebuilt in the future, the contents of this MOF file wi
ll not be included in the new WMI repository.
To include this MOF file when the WMI Repository is automatically reconstructed,
place the #PRAGMA AUTORECOVER statement on the first line of the MOF file.
Done!

Share this post


Link to post
Share on other sites

There is no need to compile the configuration.mof on the clients, it will happened automatically.

 

The SQL views will be called something like v_GS_PrinterInv and v_GS_PrinterInv64

Share this post


Link to post
Share on other sites

Thanks Garth! I had a look in there. Don't seem to see it. I see dbo.v_GS_Parallel_Port to PWR_Policy but no PRINTERINV.

 

post-14550-0-32717600-1375911400_thumb.jpg

 

post-14550-0-63472200-1375911351_thumb.jpg

 

I was also under the assumption that I would be able to see the pulled information per device under the Resource Explorer from the CCM console. However, no luck. I am terrible with SQL but my next step was to build a report then then push the above mentioned VBS/INI scripts to more computers; once I verified it is working.

Share this post


Link to post
Share on other sites

Thanks Garth, all looks well. Flows from the client to the site server then gets dumped into the DB.

 

InventoryAgent.log:

<![LOG[Collection: Namespace = root\cimv2; Query = SELECT __CLASS, __PATH, 
__RELPATH, KeyName, Comment, Default, DriverName, Local, Location, Name, 
Network, PortName, ServerName, ShareName, UserID FROM PRINTERINV; Timeout = 600 
secs.]LOG]!><time="15:56:28.981+360" date="08-07-2013" 
component="InventoryAgent" context="" type="1" thread="6628" 
file="collectiontask.cpp:478">

DATALDR.LOG on Site Server:

Done: Machine=SPEDERSON(GUID:05875980-F038-4B2C-ADC3-B92CB0F6EA1B) code=0 
(105 stored procs in XH3PYAYJI.MIF)

I'm stuck...

Share this post


Link to post
Share on other sites

Just to be clean. The workstation status data and time has not updated? I'm not interested in the printer stuff yet.

Share this post


Link to post
Share on other sites

Then it means there is no data in the Reg keys. Confirm that there is data within the reg keys.

Share this post


Link to post
Share on other sites

The issue is going to be with your sms_def.mof, you will be able to see this by following the either video. Make sure that you connect to root\cimv2 then find your printer class.

 

Remote PC

http://www.youtube.com/watch?v=2nPxjzhZbVM

 

Local PC

http://www.youtube.com/watch?v=d9UqSSQ3kBE

 

 

If you see data within WMI (wbemtest) then force a full inventory using sccm client center.

Share this post


Link to post
Share on other sites

Thanks Garth, I believe this issue is isolated to my workstation (must be WMI issues). As I have ran this on a few others; and it is collecting the data. Interestingly, I am unable to query the SMS_ConsoleUser with WBEMTEST as it crashes when I try to bring up the instances.... regardless this is working now. I will see if I can figure out why that crashes and post any findings.

 

Faulting application name: wbemtest.exe, version: 6.1.7600.16385, time stamp: 0x4a5bc77f

Faulting module name: OLEAUT32.dll, version: 6.1.7601.17514, time stamp: 0x4ce7c930

Exception code: 0xc0000005

Fault offset: 0x0000000000001029

Faulting process id: 0x145c

Faulting application start time: 0x01ce976b410c00bc

Faulting application path: C:\Windows\System32\Wbem\wbemtest.exe

Faulting module path: C:\Windows\system32\OLEAUT32.dll

Report Id: 73c9f9c7-0366-11e3-9d0c-005056c00008

 

post-14550-0-05985100-1376322655_thumb.jpg

Share this post


Link to post
Share on other sites

Hello,

Apparently the link on myitforum.com is gone...

http://myitforum.com/myitforumwp/2014/03/29/configmgr-inventory-per-user-network-printer-mapped-information-datashift-replacement/

Any other way to get the user network printer?

Thanks,
Dom

Edited by Dom
Add proper link

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×