Quantcast
Channel: Hey, Scripting Guy! Blog
Viewing all articles
Browse latest Browse all 3333

PowerTip: Working with Alternate Credentials with WMI

$
0
0

Summary: Learn four  ways to supply alternate credentials with WMI and Windows PowerShell.

Hey, Scripting Guy! Question How can I supply alternate credentials for a remote WMI call when I am using the Get-WmiObject cmdlet?

Hey, Scripting Guy! Answer

a. Use the credential parameter as shown here.

Get-WmiObject Win32_BIOS -ComputerName Server01 -Credential (get-credential ` Domain01@User01)

b. Use the credential parameter as shown here.

$c = Get-Credential

Get-WmiObject Win32_DiskDrive -ComputerName Server01 -Credential $c

c. Create a CIM session to the remote system by using the New-CimSession.

d. Create a PS session to the remote system by using New-PSSession.


Viewing all articles
Browse latest Browse all 3333

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>