gwmi win32_service -ComputerName IP –credential userName returns Access denied but Enter-PSSession -ComputerName IP -Credential Personal works

1

Running this powershell command

Enter-PSSession -ComputerName 192.168.1.184 -Credential Personal

command works fine. The username and password is accepted. Again, running this command:

Invoke-Command -ComputerName 192.168.1.184 -ScriptBlock { Get-ChildItem C:\ } -credential Personal

Also works fine and it displays the folders in drive C. It also implies that i can login. When i run this command:

gwmi win32_service –credential Personal –computer 192.168.1.184

I get "gwmi : Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))"

So does this:

Copy-Item -Path c:\d\test.txt -Destination \\192.168.1.184\c$\dep\test.txt

I've tried everything i could think of and i still fail. My goal is to copy files to target computers and execute these files. I have about 52 machines and i need to be able to install these programs. Anyone knows why this isn't working?

powershell-5.0

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0