Jan 11 2022 01:00 AM
While running this command I am getting Access denied error. I need to run this command for a particular user without any admin privileges. Without providing admin access, is there any alternative solution to get the data through this command.
Invoke-Command -ComputerName "-------------" -ScriptBlock{Get-Service} -Credential "Domain\User"
By giving this command I am able to pull the data for the above command (Get-Services), however by running this below command every user gets access to all Services.
sc sdset SCMANAGER D:(A;;CCLCRPRC;;;AU)(A;;CCLCRPWPRC;;;SY)(A;;KA;;;BA)S:(AU;FA;KA;;;WD)(AU;OIIOFA;GA;;;WD)
My requirement is to provide access only for a single particular ID and get all the services data. Please help me with the solution.
ThankYou.
Jan 11 2022 01:07 PM