Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.


Go Back   Vista Forums > Misc Newsgroups > PowerShell

RB

Vista - Win32_NTEventLogFile BackupEventLog: Access denied

Reply
 
10-15-2006   #1
Maximilian Hänel


 
 

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

My System SpecsSystem Spec
10-16-2006   #2
Brian McDermott


 
 

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



My System SpecsSystem Spec
10-16-2006   #3
Maximilian Hänel


 
 

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
My System SpecsSystem Spec
Reply

RB


Thread Tools


Similar Threads for: Win32_NTEventLogFile BackupEventLog: Access denied
Thread Forum
WMI ExecQuery from Win32_NTEventLogFile in a Workgroup environment VB Script
can't open access control editor. Access is denied General Discussion
Access Denied, Access Denied- like a broken record! Vista General
When standard users access Vista registry remotely, Access Denied Vista account administration
Access is denied message when trying to access a remote printer Vista print fax & scan


Vista Forums 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 Ltd