Re: Inventory script question



Hi Richard,

Apologies for the delay in a response; I haven't been working on this project since I last posted.

I was, in fact, referring to kb156276. I just looked over it, and you're right in saying that there is no mention of version 5.1.2600... Oddly enough, however, it did not work with that version of the Command Processor. I set my script to Sleep for 60 seconds, and the message that popped up was that this version of the Processor did not support UNC pathing.

After adding the DWORD that I mentioned in the last post, and setting it to 1, the agent program ran successfully... We also upgraded to SP3. I tried to set the DWORD value to 0 this morning, reset the inventory date, and rebooted the machine... The script ran with no problems whatsoever, updated the inventory, and otherwise ran without a hiccup. I also deleted the value entirely, and still no problems. I checked the version info for the Command Processor, and it's still at 5.1.2600. Could it have been a glitch that was corrected with SP3?

I'm going to be checking on a non-SP3 machine a little later on ... I may need to use the mapping script (which we looked at originally but scrapped for this one). Slowly but surely!!

Thanks for all your help, again... I'll be letting you know what we've come up with.

--Matt

"Richard Mueller [MVP]" <rlmueller-nospam@xxxxxxxxxxxxxxxxxxxx> wrote in message news:eXAc3I10JHA.4756@xxxxxxxxxxxxxxxxxxxxxxx
Do you refer to kb 156276? I don't see reference to version 5.1.2600. I'm not familiar with this problem. Would it make sense to map a drive to the share? For example:

Set objNetwork = CreateObject("Wscript.Network")
objNetwork.MapNetworkDrive "S:", "\\server\Folder$"
Set objApp = CreateObject("WScript.Shell")
objApp.Run "%comspec% /C S:\agent.exe"
objNetwork.RemoveNetworkDrive "S:"

--
Richard Mueller
MVP Directory Services
Hilltop Lab - http://www.rlmueller.net
--
"Matthew Curiale" <thisisnot@xxxxxxxxxxxx> wrote in message news:uI9nE3y0JHA.140@xxxxxxxxxxxxxxxxxxxxxxx
Well, the script works, but command processor v. 5.1.2600 does not support UNC pathing. It works, if we pull the workaround from the KB, being:

"add the value DisableUNCCheck REG_DWORD and set the value to 0 x 1 (Hex)."

The example is set under HKEY_Current_User, but we obviously want this to happen on the machine. Is there a way, in the script, to write this DWORD to the registry, set it to 1, have the agent run, set the DWORD back to 0, and then continue?

This is pretty much the last hurdle, but I don't want disabling UNC checking to mess with anything else that happens in the other scripts.

Thanks!

-Matt

"Richard Mueller [MVP]" <rlmueller-nospam@xxxxxxxxxxxxxxxxxxxx> wrote in message news:eVW%23Trx0JHA.1424@xxxxxxxxxxxxxxxxxxxxxxx
If the script runs as a startup script, then perhaps the computer object lacks permissions in \\server\Folder$. You could grant permissions to the group "Domain Computers" in the share, so that the computer can run the program. Remember, there is no user (except the local system account) when startup scripts run.

--
Richard Mueller
MVP Directory Services
Hilltop Lab - http://www.rlmueller.net
--

"Matthew Curiale" <thisisnot@xxxxxxxxxxxx> wrote in message news:%23m$ukRx0JHA.1092@xxxxxxxxxxxxxxxxxxxxxxx
Set objApp = CreateObject("WScript.Shell")
objApp.Run "cmd /C \\Server\Folder$\agent.exe"
Set objApp = Nothing

This is the code that's running... It's located in a test group in our forest. The GPO is link enabled, but not enforced.

When the machine boots up, sits at the login screen for a few seconds, I get a command window flash by very quickly. I've used the /K switch, also... but that hasn't changed anything. It looks like there's an error message, but I can't see it as it closes very fast.

The script doesn't reside on the local machines, though ... So is there any way to put a method in the vbscript itself, to append/write to a log file somewhere?

-Matt

"Pegasus [MVP]" <news@xxxxxxxxxxxxx> wrote in message news:OM7ybDx0JHA.4756@xxxxxxxxxxxxxxxxxxxxxxx

"Matthew Curiale" <thisisnot@xxxxxxxxxxxx> wrote in message news:O2XFjvw0JHA.3988@xxxxxxxxxxxxxxxxxxxxxxx
Well, I ended up writing a VERY simple script to call the program that writes the inventory to the database (read: 3 lines of code or so).

We've put it into the test group, and applied it as a GPO... The problem now is that, after starting up the machine itself, it doesn't query/write to the database. If I run a rsop and gpresult on the test machine, it says that the script has been applied ... Yet my inventory doesn't update. Conversely, if I run the script "as is" on a machine, it updates the inventory just fine.

Is there a way to test the startup script to see if it actually runs? Like, anything that I can put into the code to keep the console window open before it gets to the login screen?

TIA, again :)

Matt

If your script is a batch file then this line will do the trick:
echo %date% %time% %UserName% %ComputerName% >> c:\Invent.txt

If it is a VB Script file then a simple method is to invoke it like so:
cscript //nologo c:\Matt.vbs >> c:\Invent.txt
and include something like this in the script itself:
wscript.echo date & time

Alternatively you can use the WriteLine method of the File System Object to write the same information into your log file.








.



Relevant Pages

  • Re: Inventory script question
    ... Set objApp = CreateObject ... We've put it into the test group, and applied it as a GPO... ... If I run a rsop and gpresult on the test machine, it says that the script has been applied ... ... Alternatively you can use the WriteLine method of the File System Object to write the same information into your log file. ...
    (microsoft.public.windows.server.scripting)
  • Re: Microsoft Software Auditing ?
    ... > wanted to inventory the software installed on the system. ... Overwritten executables will most likely be detected by ... script to do it, as the time invested would not really be worth it. ... but only if you want to detect malicious changes to the system. ...
    (Security-Basics)
  • Re: Inventory script question
    ... I ended up writing a VERY simple script to call the program that writes the inventory to the database. ... If you script the polling into the logon script then you get a whopper of a load every morning when people report for work, which is exactly what you said you wanted to avoid. ...
    (microsoft.public.windows.server.scripting)
  • Input from a text file
    ... I have posted the part of an inventory script that connects to WMI. ... I'd like to change it so I don't have to wait for a user to logon for me to update the inventory. ... For Each strComputer In arrComputers ... 'Change this to the UNC path where inventory files should be created ...
    (microsoft.public.scripting.vbscript)
  • Re: Inventory script question
    ... when startup scripts run. ... The script doesn't reside on the local machines, ... writes the inventory to the database. ... We've put it into the test group, and applied it as a GPO... ...
    (microsoft.public.windows.server.scripting)

Quantcast