0

I'm running the following PowerShell command:

$colDisks = get-wmiobject Win32_LogicalDisk 
    -ComputerName $strComputer
    -Filter "DriveType = 3"

But I'm not having enough privileges to run this command for remote servers.

How can I add an authentification to this command to have more privileges?

3

1 Answer 1

2

try

$colDisks = get-wmiobject Win32_LogicalDisk
    -ComputeNname $strComputer
    -Filter "DriveType = 3"
    -Credential (get-credential)
Sign up to request clarification or add additional context in comments.

2 Comments

I need to enter my own credentiels, not windows one
You can enter a different account credentials with Get-Credential. Try it. Username format will be domainname\username or (for a local user account) computername\username.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.