In order for the inventory check to run automatically, the following script should be used. Once that script has been placed into an existing logon script, or pasted into a new batch file, you should add this script to your group policy:net start winmgmt sc config winmgmt start= auto
netsh advfirewall firewall add rule dir=in name ="WMI" program=%systemroot%\system32\svchost.exe service=winmgmt action = allow protocol=TCP localport=any
J:
cscript.exe GetSysInfo.vbs net use J: /delete /yes exit |
Command Definitions: - net start winmgmt - Start the WMI service
- sc config winmgmt start= auto - set the WMI service to start automatically
- netsh advfirewall firewall add rule dir=in name ="WMI" program=%systemroot%\system32\svchost.exe service=winmgmt action = allow protocol=TCP localport=any - Create a Windows Firewall exception for WMI queries
net use J: /delete /yes - DELETES ANY CURRENT DRIVE MAP AT THE INDICATED LETTER Note: The above "net use #: /delete" command is optional. However, if the drive letter is already in use, the script will not execute. Note: The choice of drive letter used is also optional. We used "J" as an example.
- net use J: \\hiddenUNC\folder$ - Create a temporarily mapped drive to NovoRoot"pc_inventory"Current to execute the WMI query
- J: - Change to the mapped drive
- cscript.exe GetSysInfo.vbs - Executes the script
Note: The GetSysInfo.vbs will copy a file similar to "ComputerName_SystemInfo.xml" to the mapped drive
- net use J: /delete /yes - Deletes the mapped drive
- exit - close command prompt window
|