/build/static/layout/Breadcrumb_cap_w.png

Create CIRs to show current users mapped drives and networked printers. Presented at Dell World User Forum 2014 - lessons from the field

CIR’s run as system so to make calls that read the users data is difficult.

Easy Solution: Have a kscript that runs as logged on user, on a custom schedule to catch the users info and write it to a txt file.

You can also add the other couple of user calls needed for the malware/adware portion of my Dell world presentation to this same batch file then you will only need one Kscript running as user to gather the needed data.  I will be posting that blog in a couple of days so watch for that.

The gatherer kscript:  the cron settings run 10am, noon, 2pm, and 4pm monday thru friday
Ltip6i.jpeg
invisible.vbs
CreateObject("Wscript.Shell").Run "run.bat",0,True
run.bat
rem: this part is for malware detection:

reg.exe query hkcu\software\microsoft\windows\currentversion\run /s > C:\ProgramData\Dell\KACE\user\hkcuRunKeys.txt

reg.exe query hkcu\software\microsoft\windows\currentversion\uninstall /s /f DisplayName > C:\ProgramData\Dell\KACE\user\hkcuSoftware.txt

rem: this part lists the users network - drives and printers

wmic logicaldisk where "drivetype='4'" get deviceid,providername > C:\ProgramData\Dell\KACE\user\NetworkDrives.txt

wmic printer where 'network="true"' get name, default, network > C:\ProgramData\Dell\KACE\user\NetworkPrinters.txt

exit
once that has run it will build the needed txt files to read into the cirs below

5bSWyE.jpeg
YfP8vd.jpeg

This what you get returned under the CIR section of an individual computer, of course now you can also create reports on them
VNQDZn.jpeg



Comments

  • SMal.tmcc, i'm having some troubles with getting the VBS script to run as you show it here. It is failing when I try and run it from $(KACE_DEPENDENCY_DIR), "c:\windows\system32\wscript.exe',invisible.vbs (is this just to make it so the cmd window doesn't pop-up? Also any clarification would be extremely helpful. - hf13207 7 years ago
    • will fail if you did not put double quotes around the command. from the line you are showing you did not do that.

      need for command:
      "c:\windows\system32\wscript.exe"

      should look like:
      Launch “$(KACE_DEPENDENCY_DIR)\”c:\windows\system32\wscript.exe“” with params “invisible.vbs”

      the vbs was to hide the batch in 6.3, they fixed that bug of batches showing in 6.4 where you can get away without using the script any longer. - SMal.tmcc 7 years ago
  • I cannot get the reporting to work correctly. I'm only getting the first line of the CIR that reads "Default Name Network" for the 10) network mapped printers (per users).

    Thoughts? - joseph.belanger@nichols.edu 7 years ago
  • Have you successfully modified this to include the shortcuts under Network Locations? We are starting to use those instead of Mapped Drives. - DaveMT 6 years ago
  • we do not track those but I think this is what you are looking for

    User run Script command
    c:\windows\system32\reg.exe query HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\PublishingWizard\AddNetworkPlace\AddNetPlace\LocationMRU > C:\ProgramData\quest\kace\user\hkcuNetplace.txt

    CIR
    Shellcommandtextreturn(cmd /c if exist C:\ProgramData\quest\kace\user\hkcuNetplace.txt type C:\ProgramData\quest\kace\user\hkcuNetplace.txt) - SMal.tmcc 6 years ago
This post is locked

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

Share

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ