Windows Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > PowerShell

Win32_NTEventLogFile BackupEventLog: Access denied

Closed Thread
 
Thread Tools Display Modes
Old 10-15-2006   #1 (permalink)
Maximilian Hänel
Guest


 

Win32_NTEventLogFile BackupEventLog: Access denied

I have some trouble calling BackupEventlog. Even if I'm logged on as an
Administrator I get an access denied error:

PS H:\> $log=gwmi "Win32_NTEventLogFile WHERE LogFileName='Application'"
PS H:\> $log.BackupEventlog("C:\Test.evt")
Ausnahme beim Aufrufen von "BackupEventlog": "Zugriff verweigert. "
Bei Zeile:1 Zeichen:20
+ $log.BackupEventlog( <<<< "C:\Test.evt")

The scripts found on the internet are using something like this when
binding to wmi:

"{impersonationLevel=impersonate,(Backup)}!\\"

How can this be done in PS?

tia

Max
Old 10-16-2006   #2 (permalink)
Brian McDermott
Guest


 

Re: Win32_NTEventLogFile BackupEventLog: Access denied

Stick this line in the mddle.

$log.PSBase.Scope.Options.EnablePrivileges = $true

For more info see

http://mow001.blogspot.com/2006/10/p...rt-in-rc2.html

BrianMcD


"Maximilian Hänel" <ngSpam@smjh.de> wrote in message
news:OCtgBQF8GHA.2092@TK2MSFTNGP03.phx.gbl...
>I have some trouble calling BackupEventlog. Even if I'm logged on as an
>Administrator I get an access denied error:
>
> PS H:\> $log=gwmi "Win32_NTEventLogFile WHERE LogFileName='Application'"
> PS H:\> $log.BackupEventlog("C:\Test.evt")
> Ausnahme beim Aufrufen von "BackupEventlog": "Zugriff verweigert. "
> Bei Zeile:1 Zeichen:20
> + $log.BackupEventlog( <<<< "C:\Test.evt")
>
> The scripts found on the internet are using something like this when
> binding to wmi:
>
> "{impersonationLevel=impersonate,(Backup)}!\\"
>
> How can this be done in PS?
>
> tia
>
> Max



Old 10-16-2006   #3 (permalink)
Maximilian Hänel
Guest


 

Re: Win32_NTEventLogFile BackupEventLog: Access denied

Hi Brian,

> Stick this line in the mddle.
>
> $log.PSBase.Scope.Options.EnablePrivileges = $true


Thanks a lot!!!

cu

Max
Closed Thread

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Access Denied, Access Denied- like a broken record! Sam Vista General 7 04-25-2008 11:54 PM
Can't Access Printer- Access Denied. =?Utf-8?B?Sm9yZGFuIEgu?= Vista networking & sharing 31 01-20-2008 09:22 PM
When standard users access Vista registry remotely, Access Denied Gayle Vista account administration 1 10-10-2007 11:48 AM
Access Denied trying to access Vista PC Ron Vista networking & sharing 7 09-30-2007 09:45 AM
Access is denied message when trying to access a remote printer MarkC Vista print fax & scan 1 03-08-2007 07:34 PM








Vistax64.com is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media 2005-2008

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