Advertisement

09.08.2008 at 11:51AM PDT, ID: 23713118
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.0

PowerShell Error

Asked by loftyworm in Scripting Languages, MSH/Monad PowerShell

I have the attached Script, and it works great except on my domain controllers for some reason.  the error I get is "1450"  nothing else.  I have tried to run just the offending part of the script against a DC hoping for a more detailed error, but can't seem to get it to work.

PS C:\Logs> (Get-WmiObject Win32_NTEventLogFile -comp SERVER) | $_.BackupEventLog($path).ReturnValue
Expressions are only permitted as the first element of a pipeline.
At line:1 char:86
+ (Get-WmiObject Win32_NTEventLogFile -comp SERVER) | $_.BackupEventLog($path).ReturnValue <<<<Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
#----------------------------------------------------
# This script is writen in Powershell v1.0 to remotely retreive
# event logs and store them on the local system.
# Created Blankmonkey 8/25/8 
#----------------------------------------------------
 
 
#----------------------------------------------------
# First we get the server list to get the logs from
#----------------------------------------------------
 
$list = Get-Content "servers.txt"
 
#----------------------------------------------------
# DISABLED -- Now we get the credintials.  Note this is once for all the computers in the list, 
# so use differant lists for differant domains.
#----------------------------------------------------
 
#$domainUser = Read-Host "Enter your domain User ID in the form <Domain>\<UserID>"
#$domainPass = Read-Host "Enter your password" -asSecureString
 
#----------------------------------------------------
# We start the loop, and use the $Server variable in the loop form the input file
#----------------------------------------------------
 
foreach($server in $list)
{
 
#----------------------------------------------------
# get the date, this is for later file naming
#----------------------------------------------------
 
$a = get-date -f yyyy-MM-dd-HH-mm-ss
 
#----------------------------------------------------
# The wmi query to find which event logs are on the system
#----------------------------------------------------
 
$logNames = Get-WmiObject Win32_NTEventLogFile -comp $Server
 
#----------------------------------------------------
# A For loop that gets the all the logs, but first creates the local dir to backup the evt
#----------------------------------------------------
 
If(!(Test-Path "\\$Server\c$\LogBackups")){New-Item "\\$Server\c$\LogBackups" -type Directory -force | out-Null}
 
foreach($log in $logNames)
{
	$log
	$path = "\\{0}\c$\LogBackups\{0}$a{1}.evt" -f $Server,$log.LogFileName
	$result = ($log.BackupEventLog($path)).ReturnValue
	move-Item $path -dest "C:\Logs\Backup\" -force
	$result
	if($result -eq 0){$log.ClearEventLog()}
	else {cmd /c blat -body "The Server $server failed to dump the logs with result error $result" -t me@me.com -s "$server Log dump errored out with error: $result" }
	if($result -ne 0) {break}
}
 
#----------------------------------------------------
# Now delete all files older then 14 days
#----------------------------------------------------
 
$oldlogfiles = Get-ChildItem C:\Logs\Backup
foreach($x in $oldlogfiles)
    {
	$y = ((Get-Date) - $x.CreationTime).Days
	if ($y -gt 14 -and $x.PsISContainer -ne $True)
            {$x.Delete()}
    }
}
[+][-]09.08.2008 at 01:50PM PDT, ID: 22421489

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.08.2008 at 01:54PM PDT, ID: 22421531

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.08.2008 at 01:56PM PDT, ID: 22421541

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.08.2008 at 01:56PM PDT, ID: 22421548

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.08.2008 at 01:57PM PDT, ID: 22421553

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.08.2008 at 02:00PM PDT, ID: 22421579

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.08.2008 at 02:02PM PDT, ID: 22421589

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.08.2008 at 02:04PM PDT, ID: 22421607

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.08.2008 at 02:05PM PDT, ID: 22421612

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.08.2008 at 02:12PM PDT, ID: 22421687

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.08.2008 at 02:15PM PDT, ID: 22421709

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.08.2008 at 02:18PM PDT, ID: 22421747

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.08.2008 at 02:19PM PDT, ID: 22421756

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.08.2008 at 02:33PM PDT, ID: 22421857

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.08.2008 at 02:33PM PDT, ID: 22421863

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.08.2008 at 02:56PM PDT, ID: 22422056

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.08.2008 at 03:15PM PDT, ID: 22422166

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.08.2008 at 04:40PM PDT, ID: 22422621

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.08.2008 at 05:57PM PDT, ID: 22423427

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Scripting Languages, MSH/Monad PowerShell
Sign Up Now!
Solution Provided By: BSonPosh
Participating Experts: 1
Solution Grade: A
 
 
[+][-]09.08.2008 at 05:58PM PDT, ID: 22423442

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20081112-EE-VQP-42 / EE_QW_EXPERT_20070906