![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| 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) |
| | How to pass credentials? actually when we use get-wmiobject we pass the remote computer name but sometimes we need the user credentials to logon to that computer . But how to pass on the credetilas in get-wmiobject command |
My System Specs![]() |
| | #2 (permalink) |
| | Re: How to pass credentials? Hi, If I understand properly you want to pass your credentials to the target computer from within the gwmi cmdlet? If so, gwmi -computername . -credentials "Administrator" Will result in the username "Administrator" being presented and an authentication dialog popped up for you to enter the corresponding password. Note the period after the -computername parameter to signify the local machine. Thats about it AFAIK. It's also possible to send a credential "object" that can be synthesised via the get-credential cmdlet, but I've never even tried that personally. help get-wmiobject -detailed would be a good place to start. Good luck, Stuart |
My System Specs![]() |
| | #3 (permalink) |
| | Re: How to pass credentials? On Aug 20, 5:44*pm, Kryten <Kryte...@xxxxxx> wrote: Quote: > Hi, > > If I understand properly you want to pass your credentials to the > target computer from within the gwmi cmdlet? > > If so, > > gwmi -computername . -credentials "Administrator" > > Will result in the username "Administrator" being presented and an > authentication dialog popped up for you to enter > the corresponding password. Note the period after the -computername > parameter to signify the local machine. Thats about it AFAIK. > > It's also possible to send a credential "object" that can be > synthesised via the get-credential cmdlet, but I've never even tried > that personally. > > help get-wmiobject -detailed > > would be a good place to start. > > Good luck, > Stuart http://blogs.technet.com/robcost/arc...edentials.aspx if you want to persist the creds. |
My System Specs![]() |
| | #4 (permalink) |
| | Re: How to pass credentials? On Aug 20, 4:19*pm, how to display variable value? <howtodisplayvariableva...@xxxxxx> wrote: Quote: > actually when we use get-wmiobject we pass the remote computer name but > > sometimes we need the user credentials to logon to that computer . But how to > > pass on the credetilas in get-wmiobject command the following instead of getting prompted every time i do a WMI query in a loop or something like that. Example: $cred = Get-cred domain\user #when i need to pass it i will just do the following on the gwmi command as Kryten pointed out. gwmi -computername pc1 -cred $cred I find this works well if everything has the same credentials. You could even do some logic to use one cred and if it doesn't work use another. I hope this helps, PeterCS |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Help - Credentials | PowerShell | |||
| pass-through disk | Virtual Server | |||
| How do I pass credentials for email to be sent through Exchange 2003 | PowerShell | |||
| Why the Value not able to Pass to a Function | PowerShell | |||
| How to pass credentials to Authentication Window on the web. | PowerShell | |||