Is there any wat to turn off:
1. remote computers in the same workgroup
2. local computer
without any shutdown confirmation message ?
Is there any wat to turn off:
1. remote computers in the same workgroup
2. local computer
without any shutdown confirmation message ?
I use WMI for this.
For Reboot
(Get-WmiObject Win32_OperatingSystem -Com $server).Reboot()
For Shutdown
(Get-WmiObject Win32_OperatingSystem -Com $server).Shutdown()
"MiroslavK" <MiroslavK@discussions.microsoft.com> wrote in message
news:A16FC112-7750-4A39-A267-75D61A8F2461@microsoft.com...
> Is there any wat to turn off:
> 1. remote computers in the same workgroup
> 2. local computer
> without any shutdown confirmation message ?
(Get-WmiObject Win32_OperatingSystem -Com 10.0.0.10).Reboot()
not working!
error: Exception calling "Reboot" : "Privilege not held. "
whats wrong ?
"Brandon Shell" wrote:
> I use WMI for this.
>
> For Reboot
> (Get-WmiObject Win32_OperatingSystem -Com $server).Reboot()
>
> For Shutdown
> (Get-WmiObject Win32_OperatingSystem -Com $server).Shutdown()
You do not have rights on that machine to perform shutdown/reboot.
You need to be at least server operator I believe. You can pass creds to WMI
if you want to specify alternate creds.
"MiroslavK" <MiroslavK@discussions.microsoft.com> wrote in message
news:65802534-8F84-401C-AA32-8AB9ECE0E62B@microsoft.com...
> (Get-WmiObject Win32_OperatingSystem -Com 10.0.0.10).Reboot()
>
> not working!
>
> error: Exception calling "Reboot" : "Privilege not held. "
>
> whats wrong ?
>
>
>
> "Brandon Shell" wrote:
>
>> I use WMI for this.
>>
>> For Reboot
>> (Get-WmiObject Win32_OperatingSystem -Com $server).Reboot()
>>
>> For Shutdown
>> (Get-WmiObject Win32_OperatingSystem -Com $server).Shutdown()
>
I'm running that code line as administrator
"Brandon Shell" wrote:
> You do not have rights on that machine to perform shutdown/reboot.
>
> You need to be at least server operator I believe. You can pass creds to WMI
> if you want to specify alternate creds.
>
> "MiroslavK" <MiroslavK@discussions.microsoft.com> wrote in message
> news:65802534-8F84-401C-AA32-8AB9ECE0E62B@microsoft.com...
> > (Get-WmiObject Win32_OperatingSystem -Com 10.0.0.10).Reboot()
> >
> > not working!
> >
> > error: Exception calling "Reboot" : "Privilege not held. "
> >
> > whats wrong ?
> >
> >
> >
> > "Brandon Shell" wrote:
> >
> >> I use WMI for this.
> >>
> >> For Reboot
> >> (Get-WmiObject Win32_OperatingSystem -Com $server).Reboot()
> >>
> >> For Shutdown
> >> (Get-WmiObject Win32_OperatingSystem -Com $server).Shutdown()
> >
>
>
Not sure its related, but http://support.microsoft.com/kb/891864
Is this local call or remote?
"MiroslavK" <MiroslavK@discussions.microsoft.com> wrote in message
news:2CE80B44-AA6E-4C19-A698-32244EA38473@microsoft.com...
> I'm running that code line as administrator
>
> "Brandon Shell" wrote:
>
>> You do not have rights on that machine to perform shutdown/reboot.
>>
>> You need to be at least server operator I believe. You can pass creds to
>> WMI
>> if you want to specify alternate creds.
>>
>> "MiroslavK" <MiroslavK@discussions.microsoft.com> wrote in message
>> news:65802534-8F84-401C-AA32-8AB9ECE0E62B@microsoft.com...
>> > (Get-WmiObject Win32_OperatingSystem -Com 10.0.0.10).Reboot()
>> >
>> > not working!
>> >
>> > error: Exception calling "Reboot" : "Privilege not held. "
>> >
>> > whats wrong ?
>> >
>> >
>> >
>> > "Brandon Shell" wrote:
>> >
>> >> I use WMI for this.
>> >>
>> >> For Reboot
>> >> (Get-WmiObject Win32_OperatingSystem -Com $server).Reboot()
>> >>
>> >> For Shutdown
>> >> (Get-WmiObject Win32_OperatingSystem -Com $server).Shutdown()
>> >
>>
>>
local.
ok, I dont care is it bug or not, I found solution.
invoke item PsTools (pssutdown.exe - ...) from Sysinternals.
it is ugly solution, but solution after all
"Brandon Shell" wrote:
> Not sure its related, but http://support.microsoft.com/kb/891864
>
> Is this local call or remote?
"MiroslavK" <MiroslavK@discussions.microsoft.com> wrote in message
news:69930CCF-9211-4B84-99BF-8EB7CBCB6DC5@microsoft.com...
> local.
>
> ok, I dont care is it bug or not, I found solution.
> invoke item PsTools (pssutdown.exe - ...) from Sysinternals.
>
> it is ugly solution, but solution after all
Well SysInternals is now owned by Microsoft. Someone needs to hook up Mark
Russinovich (or whoever is working on the SysInternals tool suite) with
Jeffrey and the PowerShell Posse. I want to have the PowerShelled version
of the PsTools suite. :-)
--
Keith
It's not a bug you need to enable privileges first :
PoSH> $os.psbase.Scope.Options.EnablePrivileges = $true
PoSH> $os = (Get-WmiObject Win32_OperatingSystem -Com server)
PoSH> $os.psbase.Scope.Options.EnablePrivileges = $true
PoSH> $os.reboot()
__GENUS : 2
__CLASS : __PARAMETERS
__SUPERCLASS :
__DYNASTY : __PARAMETERS
__RELPATH :
__PROPERTY_COUNT : 1
__DERIVATION : {}
__SERVER :
__NAMESPACE :
__PATH :
ReturnValue : 0
Greetings /\/\o\/\/
http://thePowerShellGuy.com
"Keith Hill" wrote:
> "MiroslavK" <MiroslavK@discussions.microsoft.com> wrote in message
> news:69930CCF-9211-4B84-99BF-8EB7CBCB6DC5@microsoft.com...
> > local.
> >
> > ok, I dont care is it bug or not, I found solution.
> > invoke item PsTools (pssutdown.exe - ...) from Sysinternals.
> >
> > it is ugly solution, but solution after all
>
> Well SysInternals is now owned by Microsoft. Someone needs to hook up Mark
> Russinovich (or whoever is working on the SysInternals tool suite) with
> Jeffrey and the PowerShell Posse. I want to have the PowerShelled version
> of the PsTools suite. :-)
>
> --
> Keith
>
I use this on 100s of servers all the time... I have never had to enable
priviledges... I wonder what the difference is?
What do you think?
"/\/\o\/\/ [MVP]" <oMVP@discussions.microsoft.com> wrote in message
news:8226E218-9D3B-4C34-A346-F18981CFA571@microsoft.com...
> It's not a bug you need to enable privileges first :
>
> PoSH> $os.psbase.Scope.Options.EnablePrivileges = $true
> PoSH> $os = (Get-WmiObject Win32_OperatingSystem -Com server)
> PoSH> $os.psbase.Scope.Options.EnablePrivileges = $true
> PoSH> $os.reboot()
>
>
> __GENUS : 2
> __CLASS : __PARAMETERS
> __SUPERCLASS :
> __DYNASTY : __PARAMETERS
> __RELPATH :
> __PROPERTY_COUNT : 1
> __DERIVATION : {}
> __SERVER :
> __NAMESPACE :
> __PATH :
> ReturnValue : 0
>
> Greetings /\/\o\/\/
> http://thePowerShellGuy.com
>
> "Keith Hill" wrote:
>
>> "MiroslavK" <MiroslavK@discussions.microsoft.com> wrote in message
>> news:69930CCF-9211-4B84-99BF-8EB7CBCB6DC5@microsoft.com...
>> > local.
>> >
>> > ok, I dont care is it bug or not, I found solution.
>> > invoke item PsTools (pssutdown.exe - ...) from Sysinternals.
>> >
>> > it is ugly solution, but solution after all
>>
>> Well SysInternals is now owned by Microsoft. Someone needs to hook up
>> Mark
>> Russinovich (or whoever is working on the SysInternals tool suite) with
>> Jeffrey and the PowerShell Posse. I want to have the PowerShelled
>> version
>> of the PsTools suite. :-)
>>
>> --
>> Keith
>>
| Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Remote eventlog from a few computers | simon22 | PowerShell | 6 | 07 Dec 2008 |
| RE: FileSystem and Remote Computers | Shay Levy [MVP] | PowerShell | 0 | 13 Sep 2008 |
| turn off remote computers - part 2 | MiroslavK | PowerShell | 3 | 02 May 2007 |
| Can I turn off userid/password login screen for workgroup computers? | MrMikeH | Vista security | 2 | 12 Jan 2007 |
| remote computers | IT Staff | PowerShell | 4 | 15 Oct 2006 |