I need a script to run with admin rights but I dont want to save the user/pass within the script file. Also, what would be the command that allows the script to assign "Authenticated Users" modify rights to a folder? TIA
I have the following script that pulls security logs showing users who were not able to login to the network. At the moment it does a line by line dump of the entire event log. What I really want is a list of users who had problems logging in. Bonus would be if it could sort by the number of...
Thanks crobin1! But I heard that get-eventlog does not run remotely, that is why I am using WMI to get the event log remotely. But maybe in v2 of Powershell, they might have added the ability to run it remotely also?
Actually the full code is this:
Function Get-EventsByWmi($computerName,$log,$eventID) #the params defined above are used as inputs here in the function definition
{
Get-WmiObject -Class win32_NTLogEvent -filter "logfile = '$log' and EventCode = '$eventID'" -computerName $computerName
} #end
Hello,
I use the following code to get events from the security log, by computername and event id. I need to take it one step further. I want to pull these events that occurred during the last week. How can I modify the command below to do this? I know it has something to do with...
I am trying to run the following query that will look for events with a particular date in a table. The date is saved as a string in the database (SQL 2005). But I get an error stating "Incorrect syntax near 'Sunday" on the following line (the second one).
start_date = "Job started: Sunday...
Hi all, started collecting data from an XML file that is created by our backup software. Was able to get a lot of that done thanks to the good folks here.
Now I am trying to dump that data into a SQL 2005 db. I am doing this by calling a function named bkupJobTableInsert, But I get errors like...
Thanks Skip - is cvar depracated in vbscript? It does not seem to work and someone mentioned in another forum the cvar is only available in VB but not vbscript! Thanks anyways - learned about the split function.
Jges! You come thru again! :) Thanks for the detailed code and documentation to...
Hello,
I am reading the following line from an XML file. There are several such lines in each XML file. However I only want to capture the bytes from each tag and add up the total bytes. This will tell me how much data was backed up (the XML file is produced by our backup software).
However...
One of my DC's spitted out almost a thousand instances of the same error before I rebooted it. Now, I am trying to figure out what happened. The error itself is sort of generic - Event ID 2000 - The server's call to a system service failed unexpectedly. There is more useful info in the Data...
Thanks again jges for a great suggestion. I excitedly tried it out but got an error (object does not support this property or method). Upon doing further research, it seems that vbscript does not have a function to return the array size - is this true or just old info? See -...
jges, you are right on! There was a mismatch. jobserver was actually listed only as server in the xml doc. While checking the server tag, I came across other issues though. I am looking for another tag called "start_time" and "end_time". But there are multiple "start_time" and "end_time" tags in...
I am using the code below to parse thru several XML files and print out data from each XML file. It only looks for files that starts with BEX and that are older than 2 days. However the code does not run if there are more than one file to parse. At that point I get the error -- VBSCript runtime...
Thanks jges - that worked! I combined the two if statements and now I get the error VBSCript runtime error: Object required:'ElemList.item(...)'
The error is in line 17 in the code. I think the error is caused because I am referring to the same item in the elemList array - maybe I need to...
Hi,
I have the following script that will go thru a folder containing several xml files and then extract data from those XML files. However, I want it to *only* parse XML files that begin with the letters BEX. How can I make this happen? Below is the script.
TIA
Dim server, filepath...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.