![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| 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) |
| | Acces right with WMI Method Hi, I have a script to stop windows services.For this script, people must use a special user\pwd. This is a part of my script : $credential = Get-Credential $services =(Get-WmiObject -Credential $credential -computer u6mulw113 Win32_Service | where-object -Filterscript {$_.Name -like 'DEX*'}) foreach ($service in $services){ $nom =$service.Name (Get-WmiObject -Credential $credential -computer u6mulw113 Win32_Service -Filter "Name='$nom'").StopService() } StopService method doesn't run with credential option. Question : How i can use credential to stop a service ! |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Acces right with WMI Method can you tell your PowerShell version? -- WBR, Vadims Podans MVP: PowerShell PowerShell blog - www.sysadmins.lv "pg" <pg@xxxxxx> rakstīja ziņojumā "news:0ABCD8E9-023D-4BA2-8AE1-A886074A70F5@xxxxxx"... Quote: > Hi, > > I have a script to stop windows services.For this script, people must use > a > special user\pwd. > This is a part of my script : > > $credential = Get-Credential > > $services =(Get-WmiObject -Credential $credential -computer u6mulw113 > Win32_Service | where-object -Filterscript {$_.Name -like 'DEX*'}) > > foreach ($service in $services){ > $nom =$service.Name > (Get-WmiObject -Credential $credential -computer u6mulw113 Win32_Service > -Filter "Name='$nom'").StopService() > } > > StopService method doesn't run with credential option. > > Question : How i can use credential to stop a service ! |
My System Specs![]() |
| | #3 (permalink) |
| | Re: Acces right with WMI Method PowerShell version is 1.0 on windows 2008 server. "Vadims Podans [MVP]" wrote: Quote: > can you tell your PowerShell version? > -- > WBR, Vadims Podans > MVP: PowerShell > PowerShell blog - www.sysadmins.lv > > "pg" <pg@xxxxxx> rakstīja ziņojumā > "news:0ABCD8E9-023D-4BA2-8AE1-A886074A70F5@xxxxxx"... Quote: > > Hi, > > > > I have a script to stop windows services.For this script, people must use > > a > > special user\pwd. > > This is a part of my script : > > > > $credential = Get-Credential > > > > $services =(Get-WmiObject -Credential $credential -computer u6mulw113 > > Win32_Service | where-object -Filterscript {$_.Name -like 'DEX*'}) > > > > foreach ($service in $services){ > > $nom =$service.Name > > (Get-WmiObject -Credential $credential -computer u6mulw113 Win32_Service > > -Filter "Name='$nom'").StopService() > > } > > > > StopService method doesn't run with credential option. > > > > Question : How i can use credential to stop a service ! > |
My System Specs![]() |
| | #4 (permalink) |
| | Re: Acces right with WMI Method PowerShell 1.0 have a bug with invoking WMI methods on remote computers using alternate credentials. Using alternate credentials you can access to WMI properties, but not methods. In V2 this issue is resolved. -- WBR, Vadims Podans MVP: PowerShell PowerShell blog - www.sysadmins.lv "pg" <pg@xxxxxx> rakstīja ziņojumā "news:026035CD-B939-4A73-83E6-07EE7E8940DB@xxxxxx"... Quote: > PowerShell version is 1.0 on windows 2008 server. > > > "Vadims Podans [MVP]" wrote: > Quote: >> can you tell your PowerShell version? >> -- >> WBR, Vadims Podans >> MVP: PowerShell >> PowerShell blog - www.sysadmins.lv >> >> "pg" <pg@xxxxxx> rakstīja ziņojumā >> "news:0ABCD8E9-023D-4BA2-8AE1-A886074A70F5@xxxxxx"... Quote: >> > Hi, >> > >> > I have a script to stop windows services.For this script, people must >> > use >> > a >> > special user\pwd. >> > This is a part of my script : >> > >> > $credential = Get-Credential >> > >> > $services =(Get-WmiObject -Credential $credential -computer u6mulw113 >> > Win32_Service | where-object -Filterscript {$_.Name -like 'DEX*'}) >> > >> > foreach ($service in $services){ >> > $nom =$service.Name >> > (Get-WmiObject -Credential $credential -computer u6mulw113 >> > Win32_Service >> > -Filter "Name='$nom'").StopService() >> > } >> > >> > StopService method doesn't run with credential option. >> > >> > Question : How i can use credential to stop a service ! >> |
My System Specs![]() |
| | #5 (permalink) |
| | Re: Acces right with WMI Method Thanks but Powershell is a beta software ? Can we use it in a production system ? "Vadims Podans [MVP]" wrote: Quote: > PowerShell 1.0 have a bug with invoking WMI methods on remote computers > using alternate credentials. Using alternate credentials you can access to > WMI properties, but not methods. In V2 this issue is resolved. > -- > WBR, Vadims Podans > MVP: PowerShell > PowerShell blog - www.sysadmins.lv > > "pg" <pg@xxxxxx> rakstīja ziņojumā > "news:026035CD-B939-4A73-83E6-07EE7E8940DB@xxxxxx"... Quote: > > PowerShell version is 1.0 on windows 2008 server. > > > > > > "Vadims Podans [MVP]" wrote: > > Quote: > >> can you tell your PowerShell version? > >> -- > >> WBR, Vadims Podans > >> MVP: PowerShell > >> PowerShell blog - www.sysadmins.lv > >> > >> "pg" <pg@xxxxxx> rakstīja ziņojumā > >> "news:0ABCD8E9-023D-4BA2-8AE1-A886074A70F5@xxxxxx"... > >> > Hi, > >> > > >> > I have a script to stop windows services.For this script, people must > >> > use > >> > a > >> > special user\pwd. > >> > This is a part of my script : > >> > > >> > $credential = Get-Credential > >> > > >> > $services =(Get-WmiObject -Credential $credential -computer u6mulw113 > >> > Win32_Service | where-object -Filterscript {$_.Name -like 'DEX*'}) > >> > > >> > foreach ($service in $services){ > >> > $nom =$service.Name > >> > (Get-WmiObject -Credential $credential -computer u6mulw113 > >> > Win32_Service > >> > -Filter "Name='$nom'").StopService() > >> > } > >> > > >> > StopService method doesn't run with credential option. > >> > > >> > Question : How i can use credential to stop a service ! > >> > >> |
My System Specs![]() |
| | #6 (permalink) |
| | Re: Acces right with WMI Method At this time V2 is CTP3 (this equals prebeta status). I don't use V2 in production systems, only at home and test lab. Respectively CTP3 is relatively stable you can use V2, however issues may occur. -- WBR, Vadims Podans MVP: PowerShell PowerShell blog - www.sysadmins.lv "pg" <pg@xxxxxx> rakstīja ziņojumā "news:42D3A81E-55B7-4D15-96E8-0A61FAF75F40@xxxxxx"... Quote: > Thanks but Powershell is a beta software ? > Can we use it in a production system ? > > "Vadims Podans [MVP]" wrote: > Quote: >> PowerShell 1.0 have a bug with invoking WMI methods on remote computers >> using alternate credentials. Using alternate credentials you can access >> to >> WMI properties, but not methods. In V2 this issue is resolved. >> -- >> WBR, Vadims Podans >> MVP: PowerShell >> PowerShell blog - www.sysadmins.lv >> >> "pg" <pg@xxxxxx> rakstīja ziņojumā >> "news:026035CD-B939-4A73-83E6-07EE7E8940DB@xxxxxx"... Quote: >> > PowerShell version is 1.0 on windows 2008 server. >> > >> > >> > "Vadims Podans [MVP]" wrote: >> > >> >> can you tell your PowerShell version? >> >> -- >> >> WBR, Vadims Podans >> >> MVP: PowerShell >> >> PowerShell blog - www.sysadmins.lv >> >> >> >> "pg" <pg@xxxxxx> rakstīja ziņojumā >> >> "news:0ABCD8E9-023D-4BA2-8AE1-A886074A70F5@xxxxxx"... >> >> > Hi, >> >> > >> >> > I have a script to stop windows services.For this script, people >> >> > must >> >> > use >> >> > a >> >> > special user\pwd. >> >> > This is a part of my script : >> >> > >> >> > $credential = Get-Credential >> >> > >> >> > $services =(Get-WmiObject -Credential $credential -computer >> >> > u6mulw113 >> >> > Win32_Service | where-object -Filterscript {$_.Name -like 'DEX*'}) >> >> > >> >> > foreach ($service in $services){ >> >> > $nom =$service.Name >> >> > (Get-WmiObject -Credential $credential -computer u6mulw113 >> >> > Win32_Service >> >> > -Filter "Name='$nom'").StopService() >> >> > } >> >> > >> >> > StopService method doesn't run with credential option. >> >> > >> >> > Question : How i can use credential to stop a service ! >> >> >> >> |
My System Specs![]() |
| | #7 (permalink) |
| | Re: Acces right with WMI Method Thanks Vadims for your help. All it's right with V2. "Vadims Podans [MVP]" wrote: Quote: > At this time V2 is CTP3 (this equals prebeta status). I don't use V2 in > production systems, only at home and test lab. Respectively CTP3 is > relatively stable you can use V2, however issues may occur. > -- > WBR, Vadims Podans > MVP: PowerShell > PowerShell blog - www.sysadmins.lv > > "pg" <pg@xxxxxx> rakstīja ziņojumā > "news:42D3A81E-55B7-4D15-96E8-0A61FAF75F40@xxxxxx"... Quote: > > Thanks but Powershell is a beta software ? > > Can we use it in a production system ? > > > > "Vadims Podans [MVP]" wrote: > > Quote: > >> PowerShell 1.0 have a bug with invoking WMI methods on remote computers > >> using alternate credentials. Using alternate credentials you can access > >> to > >> WMI properties, but not methods. In V2 this issue is resolved. > >> -- > >> WBR, Vadims Podans > >> MVP: PowerShell > >> PowerShell blog - www.sysadmins.lv > >> > >> "pg" <pg@xxxxxx> rakstīja ziņojumā > >> "news:026035CD-B939-4A73-83E6-07EE7E8940DB@xxxxxx"... > >> > PowerShell version is 1.0 on windows 2008 server. > >> > > >> > > >> > "Vadims Podans [MVP]" wrote: > >> > > >> >> can you tell your PowerShell version? > >> >> -- > >> >> WBR, Vadims Podans > >> >> MVP: PowerShell > >> >> PowerShell blog - www.sysadmins.lv > >> >> > >> >> "pg" <pg@xxxxxx> rakstīja ziņojumā > >> >> "news:0ABCD8E9-023D-4BA2-8AE1-A886074A70F5@xxxxxx"... > >> >> > Hi, > >> >> > > >> >> > I have a script to stop windows services.For this script, people > >> >> > must > >> >> > use > >> >> > a > >> >> > special user\pwd. > >> >> > This is a part of my script : > >> >> > > >> >> > $credential = Get-Credential > >> >> > > >> >> > $services =(Get-WmiObject -Credential $credential -computer > >> >> > u6mulw113 > >> >> > Win32_Service | where-object -Filterscript {$_.Name -like 'DEX*'}) > >> >> > > >> >> > foreach ($service in $services){ > >> >> > $nom =$service.Name > >> >> > (Get-WmiObject -Credential $credential -computer u6mulw113 > >> >> > Win32_Service > >> >> > -Filter "Name='$nom'").StopService() > >> >> > } > >> >> > > >> >> > StopService method doesn't run with credential option. > >> >> > > >> >> > Question : How i can use credential to stop a service ! > >> >> > >> >> > >> |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
Acces problems | Microsoft Office | |||
| Method invocation failed because [System.String] doesn't contain a method | PowerShell | |||
| Cannot acces Vista from XP | Vista networking & sharing | |||
| Can't acces other computer | Vista networking & sharing | |||
| Acces to progs. | Vista installation & setup | |||