2

as a follow up from this question below:

Run a PowerShell script on a different server - from inside a SQL Server job

there you can see that for me tu run a powershell script from inside a sql server job, I need to create a proxy.

Both the powershell script and the proxy script are on that link.

what the powershell script does is to delete old backup files on a remote server.

the question that I still have is:

for the whole thing to work on windows server 2012, I could find not other way than granting Administrator on the remote box to the Proxy account. as you can see on the picture below.

enter image description here

another alternative was to create a powershell script that do both, backups and deletes, and create a sql server job with the following code:

enter image description here

Is this a powershell limitation when running on a remote server? Are there other ways to work around it, without having to grant admin to the proxy account?

PowerShell Basics: Managing Remote Servers & Sessions

1 Answer 1

3

The account being local Administrator is a requirement for using the Enter-PSSession:

To connect to a remote computer, you must be a member of the Administrators group on the remote computer.

As far as workarounds, I did find this answer on SU. I would read the article in detail that the answer points to fully understand, but this is the main command to adjust permissions:

If you decide you want to allow others, what you do is run the command:

Set-PSSessionConfiguration -Name Microsoft.PowerShell -showSecurityDescriptorUI 

Notice that this action could have a serious impact on your system so we ask you to confirm that you really want to do this.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.