flavor4real
-
Total Posts
:
11
- Scores: 0
-
Reward points
:
0
- Joined: 1/13/2011
-
Status: offline
|
Power shell for Event Archiving
Thursday, January 13, 2011 2:11 PM
( permalink)
Hello, I've posted in the VB area about a VB script which supposed to be located at one dedicated server. this VB script supposed to pull the event logs from other servers, save them on the dedicated server by servername then date, and then clear the event logs on these servers. I was wondering if there is a easy option with powershell? Thx
|
|
|
|
ebgreen
-
Total Posts
:
8227
- Scores: 98
-
Reward points
:
0
- Joined: 7/12/2005
-
Status: offline
|
Re:Power shell for Event Archiving
Friday, January 14, 2011 3:38 AM
( permalink)
I would expect it to be much simpler in Powershell. What have you tried so far?
|
|
|
|
flavor4real
-
Total Posts
:
11
- Scores: 0
-
Reward points
:
0
- Joined: 1/13/2011
-
Status: offline
|
Re:Power shell for Event Archiving
Wednesday, January 19, 2011 4:20 AM
( permalink)
Hello, sorry for responding so late to your post. I've tried so many VB's out and they just don't work. Well, I'm new with PS so I just tried my first script out. I can't copy/past in here. I basically went to the Script Center Repository at microsoft and search for one. Do you have anything that might work?
|
|
|
|
nirvana
-
Total Posts
:
16
- Scores: 4
-
Reward points
:
0
- Joined: 3/29/2009
-
Status: offline
|
Re:Power shell for Event Archiving
Sunday, February 13, 2011 1:19 AM
( permalink)
[datetime]$LogDate="02/13/11"
[string]$LogName="\\servername\share" + (get-date -format "yyyyMMdd" $LogDate) + ".txt"
get-eventlog application -after $LogDate -computername "computername" | fl * | out-file $LogName 1) Exports application event logs after 13th Feb 2011. 2) Make sure \\servername\share folder exists. 3) Replace "computername" by name of computer you want to export logs from.
|
|
|
|