![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| 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. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | PSJobs & WMI Does anyone know why each of the following commands works: gwmi win32_computersystem start-psjob -command "gwmi win32_computersystem" gwmi win32_computersystem -comp Server1 but if I try: start-psjob -command "gwmi win32_computersystem -comp Server1" the job fails and the reason is "Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))" ?? |
My System Specs![]() |
| | #2 (permalink) |
| | Re: PSJobs & WMI Try to move the -computerName parameter out to the cmdlet context: start-psjob -command "gwmi win32_computersystem" -comp Server1 ----- Shay Levi $cript Fanatic http://scriptolog.blogspot.com Quote: > Does anyone know why each of the following commands works: > > gwmi win32_computersystem > start-psjob -command "gwmi win32_computersystem" > gwmi win32_computersystem -comp Server1 > but if I try: > > start-psjob -command "gwmi win32_computersystem -comp Server1" > > the job fails and the reason is "Access is denied. (Exception from > HRESULT: > 0x80070005 (E_ACCESSDENIED))" > ?? |
My System Specs![]() |
| | #3 (permalink) |
| | Re: PSJobs & WMI Mike D wrote: Quote: > Does anyone know why each of the following commands works: > > gwmi win32_computersystem > start-psjob -command "gwmi win32_computersystem" > gwmi win32_computersystem -comp Server1 > > but if I try: > > start-psjob -command "gwmi win32_computersystem -comp Server1" > > the job fails and the reason is "Access is denied. (Exception from HRESULT: > 0x80070005 (E_ACCESSDENIED))" > ?? start-psjob. This is interesting (to me) why it does *not* work though. The intent with the new remoting is to avoid remote calls that use "older" protocols. When you call get-wmiobject, you're using RPC, which isn't all that firewall friendly, to talk to a remote system. With start-psjob, you're using a simple HTTP or HTTPS based protocol between each end. Your command should retain your current credentials, so if you can run gwmi to the remote system, I'm not sure why doing this as a psjob fails. Something for me to look into... Marco -- Microsoft MVP - Windows PowerShell http://www.microsoft.com/mvp PowerGadgets MVP http://www.powergadgets.com/mvp Blog: http://marcoshaw.blogspot.com |
My System Specs![]() |
| | #4 (permalink) |
| | Re: PSJobs & WMI "Marco Shaw [MVP]" wrote: Quote: > Mike D wrote: Quote: > > Does anyone know why each of the following commands works: > > > > gwmi win32_computersystem > > start-psjob -command "gwmi win32_computersystem" > > gwmi win32_computersystem -comp Server1 > > > > but if I try: > > > > start-psjob -command "gwmi win32_computersystem -comp Server1" > > > > the job fails and the reason is "Access is denied. (Exception from HRESULT: > > 0x80070005 (E_ACCESSDENIED))" > > ?? > As Shay mentions, drop the "-comp Server1" from the command you pass to > start-psjob. > > This is interesting (to me) why it does *not* work though. > > The intent with the new remoting is to avoid remote calls that use > "older" protocols. When you call get-wmiobject, you're using RPC, > which isn't all that firewall friendly, to talk to a remote system. > > With start-psjob, you're using a simple HTTP or HTTPS based protocol > between each end. > > Your command should retain your current credentials, so if you can run > gwmi to the remote system, I'm not sure why doing this as a psjob fails. > > Something for me to look into... > > Marco > > -- > Microsoft MVP - Windows PowerShell > http://www.microsoft.com/mvp > > PowerGadgets MVP > http://www.powergadgets.com/mvp > > Blog: > http://marcoshaw.blogspot.com > cmdlets at some point, but for the moment I'm stuck with using the remote WMI connections. None of my remote PC's have powershell or ws-man installed. I would still like to take advantage of the other psjobs benefits, though. Mike |
My System Specs![]() |
| | #5 (permalink) |
| | Re: PSJobs & WMI > Thanks for the responses. I would like to use the remote features of psjob Quote: > cmdlets at some point, but for the moment I'm stuck with using the remote WMI > connections. None of my remote PC's have powershell or ws-man installed. start-psjob -command "gwmi win32_computersystem -comp Server1" You might also be able to try: $creds=get-credential start-psjob -command "gwmi win32_computersystem -comp Server1 -cred $creds" I'm going to try to fire up a couple of VMs now to try this out. Marco |
My System Specs![]() |
| | #6 (permalink) |
| | Re: PSJobs & WMI "Marco Shaw [MVP]" wrote: Quote: > In that case... Instead of this: > > start-psjob -command "gwmi win32_computersystem -comp Server1" > > You might also be able to try: > $creds=get-credential > start-psjob -command "gwmi win32_computersystem -comp Server1 -cred $creds" > > I'm going to try to fire up a couple of VMs now to try this out. > > Marco > "Cannot process argument transformation on parameter 'Credential'. Remote host method PromptForCredential is no longer implemented." |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| CTP2: Please do not abandon Windows XP and Server 2003 for remoting/psjobs at final release | PowerShell | |||
| [CTP2] No PSJobs if remoting isn't installed? | PowerShell | |||